ssi code

Started by Bobn, March 09, 2011, 07:35:40 PM

Previous topic - Next topic

Bobn

I need to use ssi to show a calendar of events on our website. I would like to have the dates cover about 6 months and have the dates auto delete when they expire. The only code I can find is upcoming events bit its only shows about 2 weeks ahead. Anybody know how to do this?

GalaticNetwork

Have you looked at this.

// Show all calendar entires for today. (birthdays, holodays, and events.)
function ssi_todaysCalendar($output_method = 'echo')
{
global $modSettings, $txt, $scripturl, $user_info;

$eventOptions = array(
'include_birthdays' => true,
'include_holidays' => true,
'include_events' => true,
'num_days_shown' => empty($modSettings['cal_days_for_index']) || $modSettings['cal_days_for_index'] < 1 ? 1 : $modSettings['cal_days_for_index'],
);
$return = cache_quick_get('calendar_index_offset_' . ($user_info['time_offset'] + $modSettings['time_offset']), 'Subs-Calendar.php', 'cache_getRecentEvents', array($eventOptions));

if ($output_method != 'echo')
return $return;

if (!empty($return['calendar_holidays']))
echo '
<span class="holiday">' . $txt['calendar_prompt'] . ' ' . implode(', ', $return['calendar_holidays']) . '<br /></span>';
if (!empty($return['calendar_birthdays']))
{
echo '
<span class="birthday">' . $txt['birthdays_upcoming'] . '</span> ';
foreach ($return['calendar_birthdays'] as $member)
echo '
<a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['name'], isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', !$member['is_last'] ? ', ' : '';
echo '
<br />';
}
if (!empty($return['calendar_events']))
{
echo '
<span class="event">' . $txt['events_upcoming'] . '</span> ';
foreach ($return['calendar_events'] as $event)
{
if ($event['can_edit'])
echo '
<a href="' . $event['modify_href'] . '" style="color: #ff0000;">*</a> ';
echo '
' . $event['link'] . (!$event['is_last'] ? ', ' : '');
}
}
}


Im pretty sure you could change the days to like i don't no say 250 so it shows the next 250 days, But im sure some can give more info. I thought i would show you what i found
Time controlls everyone, if we could master time we could master anything.
_________________________________________
Where space folds into one :D

GalaticNetwork

Check this out

<?php

$eventlist 
ssi_recentEvents(7'array');

echo 
'<ul>';

foreach (
$eventlist as $mday => $array)
{
  foreach (
$array as $event)
  {
    echo 
'<li>'$event['start_date'] , ' - ' $event['link'];

    if (
$event['can_edit'])
      echo 
' <a href="' $event['modify_href'] . '" style="color: #FF0000;">*</a> ';
  }
}
?>


You can change ssi_recentEvents(7, 'array'); the 7 to how many you want it show. This is the closest i have found so far.

Check out http://www.simplemachines.org/community/index.php?topic=217165.msg1392528#msg1392528

Some has made the code you want, but requires editing ssi.php which isn't suggested for these commands. But have a look.
Time controlls everyone, if we could master time we could master anything.
_________________________________________
Where space folds into one :D

Bobn

#3
Thank you!

GalaticNetwork

Time controlls everyone, if we could master time we could master anything.
_________________________________________
Where space folds into one :D

Advertisement: