Events List for SMF 2.0

Started by fwitt, September 04, 2011, 04:22:00 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

fwitt

SMF 2.0 only

Think This is the right Board...

very simple custom ssi php file...

This is a simple customized ssi function, it uses your forums calender events to create a program.

Unless you have specified the boards you want to use for the program it uses all boards that user can see.

If you specify boards it uses those boards irrespective of board permissions, but only links to the topic if you have view permissions for that board. I implemented this with guest checking routine before I called the function.

it is called as follows

require_once('SSI,php');
require_once('EventList.php')
echo '<h3>EVENTS</h3>';
$boards = ($context['user']['is_guest'] ? array(1,2,3) : null );
ssi_ListEvents($max_events = 100, $output_method = 'echo',$dateFrom = date("Y-m-d"), $dateTo = (date("Y")+1) . '-' . date("m") . '-' .  date("d"),$boards);


This call puts a title of EVENTS using the css for <h3> the follows with up to ($max_events) 100 events, echoing as html (also available as an array, starting from the current date finishing in a year, with guests seeing events from boards 1,2,3 and signed in users all boards they have access to.

It is used on a forum for a real world organization for a program of events with the guest options showing basic info on our public events.

It was written for a specific site, probably should have put some of the complicated bit of the call into the function itself.

Skhilled

So this creates a list of the calendar events like birthdays and whatever other events are in the calendar?

And where do you put Eventlist.php?

fwitt

Quote from: Skhilled on September 04, 2011, 04:28:51 AM
So this creates a list of the calendar events like birthdays and whatever other events are in the calendar?

And where do you put Eventlist.php?

Doesn't pull birthdays. pulls Events that are linked to the calender, so when you post a topic if you link it to calender this will pull it. Basically anything that appears on the calender that links to a topic.

It doesnt matter where you put the EventList.php as long at the require_once has the right path in it.

I personally have a scripts folder on my website to keep custom stuff separate from the forum.

This script was never originally intended for public release, but I thought it would be interesting to see if anyone else thought it was useful and if so what improvements they would make.

I am considering making it into a proper mod so the List will appear in a custom tab in the forum itself or perhaps as a special board. But that would be part of a process of moving my website into the forum more portal style and I have plenty more I was to sort out on the site first before I work on that.

Skhilled

Cool! I've have to add some events and give it a shot. :)