My calendar links?

Creating and modifying plugins.
Post Reply
heinsvig
Posts: 3
Joined: Fri Feb 17, 2006 6:23 pm

My calendar links?

Post by heinsvig »

I use my calendar as a family birthday reminder and I don't know "anything" about PHP and MySQL.

I made each eventlink to go to a wrapurl index.php?/wpages/congratulation.html but I would like to have the wrap page congratulation.html to display something like:

The <eventdate> is <eventname>'s brithday, congratulation.

How do I do that? Witch PHP code do I have to put in to the html and how do I call the page(I guess something like index.php?/wpages/congratulation.html&data1=X&data2=Y. I have enabled Append GET-Variables)

Sorry if this isn't a question for this forum.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: My calendar links?

Post by garvinhicking »

You cannot append any GET variables to static page permalinks because then they wouldn't get recognized as the staticpage URL then.

You would need to use index.php?serendipity[subpage]=XXX, where XXX is the 'backward shorthand url name" of your staticpage, then you can use any other GET variables.

But then you'll have a problem because you cannot use PHP code in your static pages.

Thus, the bottom line is to use a different plugin for your "dynamic page".

The "serendipity_event_externalphp" plugin ("External PHP application") is suitable for this. Fetch it via Spartacus or CVS and install it.

Configure the plugin with these values:

Permalink: Your choice, you are not going to use it actually
Include file: /path/to/your/serendipity/dynamicpage.php
Pagetitle: dynamicpage
Format as Article: Yes

Now you need to create the PHP file that will render your output. Create the file "dynamicpage.php" (the one you referred to in the 'include file' option). Put these contents inside:

Code: Select all

<?php
echo 'The ' . htmlspecialchars($_REQUEST['eventdate']) . ' is ' . htmlspecialchars($_REQUEST['eventname']) . '\'s birthday, congratulation.';
?>
After you saved that file, you can call the output via:

Code: Select all

http://yourhost/index.php?serendipity[subpage]=dynamicpage&eventdate=2005-10-28&eventname=Garvin
HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
heinsvig
Posts: 3
Joined: Fri Feb 17, 2006 6:23 pm

Post by heinsvig »

I think that it is what I need but I can't make it work.

I get this error:

Warning: serendipity_event_externalphp::include() [function.include]: Failed opening '' for inclusion (include_path='.::/customers/heinsvig.net/heinsvig.net/httpd.www/web/:/customers/heinsvig.net/heinsvig.net/httpd.www/web/bundled-libs/') in /customers/heinsvig.net/heinsvig.net/httpd.www/web/plugins/serendipity_event_externalphp/serendipity_event_externalphp.php on line 104
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

How did you configure the plugin? The error message means that you did not specify any file to include...

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
heinsvig
Posts: 3
Joined: Fri Feb 17, 2006 6:23 pm

Post by heinsvig »

You where right it wasn't configured right, now it works. Thanks! :D
Post Reply