Page 1 of 1

My calendar links?

Posted: Fri Feb 17, 2006 6:49 pm
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.

Re: My calendar links?

Posted: Sat Feb 18, 2006 5:19 pm
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

Posted: Sun Feb 19, 2006 12:45 am
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

Posted: Mon Feb 20, 2006 10:20 am
by garvinhicking
How did you configure the plugin? The error message means that you did not specify any file to include...

Regards,
Garvin

Posted: Mon Feb 20, 2006 11:15 am
by heinsvig
You where right it wasn't configured right, now it works. Thanks! :D