Accessing the calendar from any php script

Started by Davy-D, September 15, 2004, 05:26:58 PM

Previous topic - Next topic

Davy-D

Hi all,

thanks for developing that great SMF software ... I really love it.

I would like to access the calendar events from a PHP script residing on the same server as SMF. I have seen that there are a few functions within the ssi_examples. My plan is to provide an event list outside of the board, too (there are a lot of ppl who are scared to register at a board before being able to lookup such event data).
I am aware of the fact that I can easily "read" the database contents, but maybe there's already someone who had the same idea/wish/problem.

Can anybody help me with that issue ?

Thanks in advance,
Davy-D

Oldiesmann

Easy - just put
include('http://www.yourdomain.com/smf/SSI.php?ssi_function=todaysEvents');
in your PHP script wherever you want to list the events. Remember to change the URL to match the actual location of your SMF installation.
Michael Eshom
Christian Metal Fans

Davy-D

Hi Oldiesmann,

I see what you mean - but I wanted to list the current month with all of its days + all events. And as far as I saw this is not possible with the standard API's SSI functions.

Thanks,
Davy-D

[Unknown]

The functions can be used through PHP to return arrays instead of outputting data, which you can freely format as you wish.

-[Unknown]

Davy-D

Hi,

okay I guess I understand what you mean.

In the ssi_examples.php file there is a function called "smf_loadCalendarInfo()".
As far as I understand it can parse all events entered in the SMF calendar.

Are there any code snippets that might be useful in displaying all events for the current year in an array ?

Any help (english & german) is pretty much appreciated.

Thanks in advance,
Davy-D

[Unknown]

Not just that.  You see the parameters on the functions?  If you pass 'array' as the $output_method, the function will return an array instead of outputting anything - this array can be customized.  The print_r function becomes very useful here.

-[Unknown]

Advertisement: