Welcome, Guest. Please Login or Register.
May 04, 2024, 11:26:40 PM
Home Help Search Log in Register
News: SMF is the next generation in forum software, almost completely re-written from the ground up, make sure you don't fall for cheap imitations that suffer from feature bloat!

YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Calendar in Yabbse 1.5.4 « previous next »
Pages: [1] Reply Ignore Print
Author Topic: Calendar in Yabbse 1.5.4  (Read 3032 times)
crash5456
Guest
Calendar in Yabbse 1.5.4
« on: November 21, 2003, 06:05:36 AM »
Reply with quote

Has anyone or is there an update for the calender so that when you add an event to the calender it stays in the correct order of dates posted.

Just wondering?
Logged
crash5456
Guest
Calendar in Yabbse 1.5.4 ...Need help!
« Reply #1 on: November 22, 2003, 07:32:34 AM »
Reply with quote

Got a question about the calendar.

I would like to be able to display 5 days of events on the main yabbse page instead of one day, how do I go about doing that.

Any help would be appreciated!

Thx
Logged
Ayeka
Jr. Member
**
Posts: 80


Good & Evil, there is never one without the other.

WWW
Re:Calendar in Yabbse 1.5.4
« Reply #2 on: November 23, 2003, 11:31:49 PM »
Reply with quote

This is from somebody else's hack.  Simply search for this:

// Called from BoardIndex.php to display the current day's events on the board index.

function CalendarDoIndex()
{


Replace the entire function with this:
Note that this should be the very last function in the file Sources\Calendar.php


// Called from BoardIndex.php to display the current day's events on the board index.

function CalendarDoIndex()
{
  global $modSettings, $db_prefix, $txt, $imagesdir, $settings, $scripturl, $mydate;

  if ($modSettings['cal_enabled'] != 1)
     return;

  // Make sure at least one of the options is checked.
  if ($modSettings['cal_showeventsonindex'] != 1 && $modSettings['cal_showbdaysonindex'] != 1 && $modSettings['cal_showholidaysonindex'] != 1)
     return;

  //$today = localtime(CalendarGetAnyTime());
  //$month = $today[4];
  //$year = $today[5] + 1900;
  //$day = $today[3];

  $todaytime2 = CalendarGetCurrentTime();
  $header =  '
     <tr>
        <td class="catbg" colspan="2"><b>' . $txt['calendar47'] . '</b></td>
     </tr><tr>
        <td class="windowbg" width="20" valign="middle" align="center">
           <a href="' . $scripturl . '?action=calendar">
              <img src="' . $imagesdir . '/calindex.gif" border="0" width="20" alt="' . $txt['calendar24'] . '" />
           </a>
        </td><td class="windowbg2" width="100%"><table class="windowbg2" width="100%">';

  $bechoedHeader = false;
  $bPrintedHeader = true;
  echo $header;
  $PrintedHeader2 = false;
  for ($i = 0; $i < 15; $i++)
  {
  $todaytime = $todaytime2 + 3600 * 24 * $i;

  $today = localtime($todaytime);
  $month = $today[4];
  $year = $today[5] + 1900;
  $day = $today[3];
  $mydate = date("l, F jS, Y", $todaytime);

  if ($modSettings['cal_showholidaysonindex'] == 1)
  {
     $holidays = CalendarCreateHolidayArray($month + 1, $year, $day);
     if (isset($holidays[$day]))
     {
        if (!$bPrintedHeader)
        {
           echo $header;
           $bPrintedHeader = true;
        }
        echo '<tr class="windowbg2" width="100%"><font size="1" color="#' . $modSettings['cal_holidaycolor'] . '"><b>' . $mydate . '</b>: ' . $holidays[$day] . '</font>';
        $PrintedHeader2 = true;
     }
  }
  if ($modSettings['cal_showbdaysonindex'] == 1)
  {
     $bday = CalendarCreateBirthdayArray($month + 1, $year, $day);
     if (isset($bday[$day]))
     {
        if (!$bPrintedHeader)
        {
           echo $header;
           $bPrintedHeader = true;
        }
        if (isset($holidays[$day]))
           echo '<br />';
        echo '<tr class="windowbg2" width="100%"><font size="1"><b>' . $mydate . '</b>: ' . $bday[$day] . '</font>';
        $PrintedHeader2 = true;
     }
  }
  if ($modSettings['cal_showeventsonindex'] == 1)
  {
     $bPowerUser = ($settings[7] == 'Administrator' || $settings[7] == 'Global Moderator');
     $cats = array();
     $rs = mysql_query("SELECT ID_CAT,membergroups FROM {$db_prefix}categories") or database_error(__FILE__, __LINE__);
     while ($row = mysql_fetch_array($rs))
        $cats[$row[0]] = explode(',', $row[1]);
     $events = CalendarCreateEventArray($bPowerUser, $cats, $month, $year, $day);
     if (isset($events[$day]))
     {
        if (!$bPrintedHeader)
        {
           echo $header;
           $bPrintedHeader = TRUE;
        }
        if (isset($bday[$day]) || isset($holidays[$day]))
           echo '<br />';
        echo '<tr class="windowbg2" width="100%"><font size="1"><b>' . $mydate . '</b>: ' . $events[$day] . '</font>';
        $PrintedHeader2 = true;
     }
  }
  if ($bPrintedHeader)
     echo '
        </td>';
  }
  if (!$PrintedHeader2)
     echo 'Nothing is scheduled.</td>';
  echo '
     </tr></table></tr>';


Then once you've done that, look for this (in that new same function:


  $bPrintedHeader = true;
  echo $header;
  $PrintedHeader2 = false;
  for ($i = 0; $i < 15; $i++)
  {

and change the < 15 to < 6 ( number of days to display + one)

Hope this helps, looks great on my board. :)
Logged

--Ayeka
Master of the purple!
HAHAhahahahahaha!
crash5456
Guest
Re:Calendar in Yabbse 1.5.4
« Reply #3 on: November 24, 2003, 02:15:17 AM »
Reply with quote

Thanks :)
That worked perfectly on my board!!!!


Can't thank you enough, for your help Ayeka  ;D
Logged
Ayeka
Jr. Member
**
Posts: 80


Good & Evil, there is never one without the other.

WWW
Re:Calendar in Yabbse 1.5.4
« Reply #4 on: November 24, 2003, 03:42:54 PM »
Reply with quote

Any time.  ;D
Logged

--Ayeka
Master of the purple!
HAHAhahahahahaha!
Martinus
Noobie
*
Posts: 2


Re:Calendar in Yabbse 1.5.4
« Reply #5 on: December 12, 2003, 05:42:22 AM »
Reply with quote

Would it be terribly painful to have a calendar event posting call a notify action? I would like to enable certain folk on a forum to post events that notify by email all members who either have the "new events" flagged under notification or simply take the same permission as for announcement boards.
Logged
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Calendar in Yabbse 1.5.4 « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.021 seconds with 21 queries.