Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-05-20 23:37:25

dave halliday
Member
Registered: 2008-02-29
Posts: 16

Integrating a 3rd-party app into Textpattern: EasyPHPCalendar

I am trying to get EasyPHPCalendar integrated into my Textpattern site and not having any luck with it…

I posted in their support forum and they suggested that I post here as well. I know this thread deals superficially with it:

http://forum.textpattern.com/viewtopic.php?id=20160

But it is from 2006 and I was wondering if anyone had a more recent experience with it.

Specifically, I am trying to get the small calendar display to fit into the right sidebar. I have tried adjusting the width to provide space and the links associated with the calendar show but the calendar does not.

http://www.easyphpcalendar.com/

Many thanks!
Dave

Offline

#2 2008-05-21 07:39:30

sthmtc
Member
From: CGN, GER
Registered: 2005-01-17
Posts: 586
Website

Re: Integrating a 3rd-party app into Textpattern: EasyPHPCalendar

is zem_event an option? just saying…

Offline

#3 2008-05-21 07:49:03

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Integrating a 3rd-party app into Textpattern: EasyPHPCalendar

You could just use a plugin:

Offline

#4 2008-05-21 21:17:13

dave halliday
Member
Registered: 2008-02-29
Posts: 16

Re: Integrating a 3rd-party app into Textpattern: EasyPHPCalendar

I looked at zem_event — installed it and played with it a lot.

It didn’t fit what I was looking for.

I did a cursory look at the other two:

mdp_calendar
jmc_event_manager

And they didn’t offer what I was looking for either.

EasyPHPCalendar is a commercial product but it does exactly what I am looking for (small calendar on front page with mouse-over popups and a full-screen calendar on a secondary page with text details of the events. Multiple users too.

So, back to the original question — I included this line of PHP code in the <head> section:

<?php $CSS=1; require(“/calendar/calendar.php”); ?>

And then these lines of PHP code here:

<!— right —> <div id=“sidebar-2”>

<?php $OL=1; require(“/calendar/calendar.php”); ?>

</div>

It should show the mini-calendar but it doesn’t.

Any ideas?

Thanks!
Dave

Offline

#5 2008-05-21 21:54:21

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

Re: Integrating a 3rd-party app into Textpattern: EasyPHPCalendar

A) Security: You must allow to use PHP for pages in the preferences.

Preferences: Allow PHP on pages?

When enabled, this setting allows PHP code within page and form templates.

PHP code must be without both opening and closing PHP tags, and enclosed within txp:php tags. Textbook: php

B) In Textpattern PHP is wrapped inside the <txp:php>PHP code here</txp:php> container tag. This template tag replaces (!) the standard <?php ... ?> PHP wrapping.


Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

#6 2008-05-23 01:54:51

dave halliday
Member
Registered: 2008-02-29
Posts: 16

Re: Integrating a 3rd-party app into Textpattern: EasyPHPCalendar

Thanks a lot — worked like a charm!

http://www.crossroadsgrocery.com/

Only question now is that to get all of the features in EasyPHPCalendar (mouse popups), you need to string several PHP statements together seperated by a “ ; “

<txp:php> doesn’t seem to like this as the calendar fails to display.

Here is a sample command:

<txp:php> $OL=1; require(“calendar.php”); </txp:php> – no calendar

<txp:php> require(“calendar.php”); </txp:php> – works great

Any ideas?

Thanks!
Dave

UPDATE: I tried playing around with the “ global “ function and met with no sucess…

Last edited by dave halliday (2008-05-23 04:22:40)

Offline

#7 2008-05-24 17:18:09

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

Re: Integrating a 3rd-party app into Textpattern: EasyPHPCalendar

I have no idea.

  • Set Textpattern production status to debug mode and check the debug output in the page and in the HTML source code of the rendered page.
  • Try to contact the EasyPHPCalendar developer community for correct syntax.

Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

#8 2008-05-24 20:40:29

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,306

Re: Integrating a 3rd-party app into Textpattern: EasyPHPCalendar

dave halliday wrote:

<txp:php> $OL=1; require(“calendar.php”); </txp:php> – no calendar
<txp:php> require(“calendar.php”); </txp:php> – works great

Any ideas?

I remember faintly I once read something similar to this. The solution was to divide the code and use some more <txp:php>-tags for wrapping. Have you tried so?


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#9 2008-05-25 19:18:02

dave halliday
Member
Registered: 2008-02-29
Posts: 16

Re: Integrating a 3rd-party app into Textpattern: EasyPHPCalendar

Hi merz1 — I will try your idea later today. I have been in contact with the EasyPHPCalendar forums and the syntax is correct. Additionally, if I add the code to a dummy web page off of the site, it works great so it is not the EasyPHP application…

Hi uli — I tried breaking it into two blocks and that did not work. I did not try nesting the tags, I will try that later today as well.

Both of you — many thanks for your ideas!

Offline

#10 2008-05-26 13:01:52

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

Re: Integrating a 3rd-party app into Textpattern: EasyPHPCalendar

OK, syntax is correct. Back to the start. Use a complete empty page:

  • Create a new section i.e. caltest, create/use a new empty CSS template, create/use a new empty page template
    • Don’t use header, footer or any other page design items. Just an empty plain HTML page
  • Only put <txp:php>$OL=1; require("calendar.php");</txp:php> on that empty page template and save it.
  • Call the new section in your browser http://domain.tld/caltest

Empty page example:

<html>
<head>
<title>caltest</title>
</head>
<body>
<p>Calendar Test</p>
<!-- Calendar Test -->
<txp:php>$OL=1; require("calendar.php");</txp:php>
<!-- Calendar Test - End -->
<hr />
<p>Calendar showing up above the horizontal ruler?</p>
</body>
</html>

What happens?

  • In production status ‘live’?
  • In production status ‘debug’?

Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

#11 2008-05-27 03:39:37

dave halliday
Member
Registered: 2008-02-29
Posts: 16

Re: Integrating a 3rd-party app into Textpattern: EasyPHPCalendar

Hi merz1 — many thanks for the time you are putting in on my problems…

I did what you said — live no calendar showed up.

When I removed the “ $OL=1; “ statement, it showed up fine but without the feature set that the “ $OL=1; “ gives (mouseover popups).

I switched to Debugging in the Admin section and got the same results.

It struck me that I also need to place this line just before the </head> entry:

<html>
<head>
<title>caltest</title>
<txp:php> $CSS=1; require("calendar/calendar.php"); </txp:php>
</head>

If the two statements on the line in the page aren’t getting processed correctly, I bet that the line in the head isn’t either…

I tried nesting two <txp:php> statements and that didn’t work.

The page is up at: caltest

Thanks!
Dave

Offline

#12 2008-05-27 10:40:58

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

Re: Integrating a 3rd-party app into Textpattern: EasyPHPCalendar

I tried to check your page, but: “You don’t have permission to access /caltest on this server.”

> I switched to Debugging

Did you check the HTML source code. There should be debugging output at the bottom.

I have no idea what your application (read: the PHP code) is doing. Maybe there is some risky action involved like posting/getting data from a server outside of your domain?

Again: I am just guessing and have no real idea how to solve the problem.

A) Maybe it is a problem which sticks much deeper in the output process like a problem with your server environment and the PHP configuration (version, memory, globals, timeout, etc.)?

B) Or it is much higher in the process chain :)
B1) You have to check the interaction between Browser and server (http, javascript, AJAX traffic)
B2) You have to check the action happening in your browser

What I know is that TXP is using a PHP >4 mechanism ‘Output Buffering [ob_start(), ob_end_flush()]’ which buffers all the output and after processing the whole page sends the ordered output to the browser.

Is it possible to set the calendar to debug mode?

If everything fails it might be a good idea to ask the calendar developers if they are willing to program a TXP plugin. A TXP plugin is pure PHP plus some help documentation so it should not be such a big problem and it will help to promote their product :)


Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

Board footer

Powered by FluxBB