News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

Display Calendar on front with SSI

Started by Orkie, March 26, 2008, 04:48:12 AM

Previous topic - Next topic

Orkie

I'm having trouble displaying my calendar on front... I've included ssi.php as first and then at the box where the user info stands (at top of forum), this is my code:

// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo '

<a href="......."> Ga naar het forum </a> <br />
<a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a> <br />
<a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br />
',$context['calendar_events'],'<br />';
}
// Otherwise they're a guest - send them a lovely greeting...
else
echo $txt['welcome_guest'];


I've also changed the ',$context['calendar_events'],' to stuff like:

<?php ssi_todaysCalendar();?> (Displays nothing)
<?php ssi_todaysEvents();?> (Displays nothing)
ssi_todaysCalendar() (Displays ssi_todaysCalendar() )

What am I doing wrong?!



Orkie

No, already searched them and did what they said, didn't help.

In other pages it does work :S

Spaceman-Spiff

#4
Are you getting an error message or everything is okay but no events show up?

Quote from: Orkie on March 26, 2008, 04:48:12 AM
I've also changed the ',$context['calendar_events'],' to stuff like:

<?php ssi_todaysCalendar();?> (Displays nothing)
<?php ssi_todaysEvents();?> (Displays nothing)
ssi_todaysCalendar() (Displays ssi_todaysCalendar() )

What am I doing wrong?!

These functions only work or show up something if you have an event in Today's calendar. If you don't, it will show nothing (blank).

Are you using SMF 2.0 or 1.x?

Orkie

1.x and i ofcourse planned events in the days when i was testing it ;)

jamesk

#6
I initially wrote a whole reply about how you may have to load smf_loadCalendarInfo(); and then echo'ing the $context['calendar_events'] array in a foreach loop, but then realized that the SSI.php ssi_todaysEvents(); function does exactly that so I re-looked at your code and comment and think you may be putting the <?php ssi_todaysEvents();?> inside the echo statement... 

So, I think this is all you need to do to resolve your problem (editing your code):

// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo '
<a href="......."> Ga naar het forum </a> <br />
<a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a> <br />
<a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br />',ssi_todaysEvents(),'<br />';
}
// Otherwise they're a guest - send them a lovely greeting...
else
echo $txt['welcome_guest'];

Advertisement: