Welcome, Guest. Please Login or Register.
June 26, 2024, 10:06:58 AM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Completed mods  |  [BETA 1.4.1] Fetch Calendar Info 1.0 Bèta « previous next »
Pages: [1] Reply Ignore Print
Author Topic: [BETA 1.4.1] Fetch Calendar Info 1.0 Bèta  (Read 8029 times)
sylvester
YaBB God
*****
Posts: 525


[BETA 1.4.1] Fetch Calendar Info 1.0 Bèta
« on: September 05, 2002, 07:06:21 PM »
Reply with quote

<id>
Fetch Calendar Info</id>

<version>
1.0 Bèta
</version>

<author>
sylvester ([email protected])
</author>

<homepage>
http://www.computerfreakz.net
</homepage>

<mod info>
With this mod, you can fetch info from the calendar (events,holidays,birthdays) with SSI.php

Readme:
   - Install this mod with boardmod or manually ;)
   - Open the page you want the info on it
   - Include SSI.php
   - Use the following functions:
      * FetchCalendar('bdays')
      * FetchCalendar('holidays')
      * FetchCalendar('events')
   - Enjoy :)
</mod info>

<edit file>
SSI.php
</edit file>

<search for>
<tr><td align=right>$pass:&nbsp;</td><td><input type=password name="passwrd" size="9"></td></tr>
<tr><td>&nbsp;</td><td><input type=hidden name="cookielength" value="$txt[yse50]"><input type="submit" value="$txt[34]"></td></tr></table></form>
EOT;
}
</search for>

<add after>
function FetchCalendar($what=NULL) {
   global $db_prefix,$txt,$scripturl,$timeoffset,$scripturl;
   $timeUserOff = (isset($settings[18]) ? $settings[18] : 0);
   list($day,$month,$year) = explode('/',date('d/m/Y',time()+(($timeoffset+$timeUserOff)*3600)));
   
// Birthdates
   if($what == 'bdays') {
      $bdays_query = mysql_query("SELECT realName,memberName,year(birthdate) FROM {$db_prefix}members WHERE (dayofmonth(birthdate) = {$day} AND month(birthdate) = {$month})");
      if(mysql_num_rows($bdays_query) > 0)
         $return = '<B>'.$txt['calendar3'].'</B><BR>';
      while($bdays_result = mysql_fetch_row($bdays_query)) {
         $return .= '<A HREF=\''.$scripturl.'?action=viewprofile;user='.$bdays_result[1].'\'>'.$bdays_result[0].'</A> ('.($year - $bdays_result[2]).')<BR>';
      }
   }

// Events
   if($what == 'events') {
      $events_query = mysql_query("SELECT title,id_board,id_topic FROM {$db_prefix}calendar WHERE (day = {$day} AND month = {$month} AND year = {$year})");
      if(mysql_num_rows($events_query) > 0)
         $return =  '<B>'.$txt['calendar4'].'</B><BR>';
      while($events_result = mysql_fetch_row($events_query)) {
         $return .= '<A HREF=\''.$scripturl.'?action=display;board='.$events_result[1].';threadid='.$events_result[2].'\'>'.$events_result[0].'</A><BR>';
      }
   }

// Holidays
   if($what == 'holidays') {
      $holidays_query = mysql_query("SELECT title FROM {$db_prefix}calendar_holiday WHERE (day = {$day} AND month = {$month} AND (year IS NULL || year = {$year}))");
      if(mysql_num_rows($holidays_query) > 0)
         $return =  '<B>Holidays:</B><BR>';
      while($holidays_result = mysql_fetch_row($holidays_query)) {
         $return .= '<B>'.$holidays_result[0].'</B><BR>';
      }
   }

   if(isset($return)) {
      echo $return;
   }
}
</add after>
http://www.yabb.info/community/index.php?board=141;action=display;threadid=12537
« Last Edit: September 05, 2002, 07:07:15 PM by sylvester » Logged

I'm back
tore-
Sr. Member
****
Posts: 291


I love YaBB SE!

Re:[BETA 1.4.1] Fetch Calendar Info 1.0 Bèta
« Reply #1 on: September 05, 2002, 07:15:59 PM »
Reply with quote

this looks cool mate! Ive waited so long for this, thanks!
Logged

Star wars rules!
Horseman
YaBB God
*****
Posts: 784


'MAS VALE CABALLO QUE CAUDAL!'

ICQ - 44729151 WWW
Re:[BETA 1.4.1] Fetch Calendar Info 1.0 Bèta
« Reply #2 on: September 06, 2002, 02:27:55 PM »
Reply with quote

i have you mod installed and translated for german users. good work  8)

thx
hm
Logged
sylvester
YaBB God
*****
Posts: 525


Re:[BETA 1.4.1] Fetch Calendar Info 1.0 Bèta
« Reply #3 on: September 06, 2002, 07:15:08 PM »
Reply with quote

Quote from: Horseman on September 06, 2002, 02:27:55 PMi have you mod installed and translated for german users. good work  8)

thx
hm
thnx
You're welcome 8)
Logged

I'm back
tore-
Sr. Member
****
Posts: 291


I love YaBB SE!

Re:[BETA 1.4.1] Fetch Calendar Info 1.0 Bèta
« Reply #4 on: September 10, 2002, 09:28:32 PM »
Reply with quote

is this an non-beta now or not*?=
Logged

Star wars rules!
Thomas
Full Member
***
Posts: 203


WWW
Re:[BETA 1.4.1] Fetch Calendar Info 1.0 Bèta
« Reply #5 on: September 10, 2002, 10:07:31 PM »
Reply with quote

This is just what I have been looking for. I have problems calling it though. Is it right to use the following code:

<!--#include virtual="/forum/SSI.php?function=FetchCalendar('events')" -->

/MR.T
Logged
Horseman
YaBB God
*****
Posts: 784


'MAS VALE CABALLO QUE CAUDAL!'

ICQ - 44729151 WWW
Re:[BETA 1.4.1] Fetch Calendar Info 1.0 Bèta
« Reply #6 on: September 10, 2002, 10:39:27 PM »
Reply with quote

Quote from: MR.T on September 10, 2002, 10:07:31 PMThis is just what I have been looking for. I have problems calling it though. Is it right to use the following code:

<!--#include virtual="/forum/SSI.php?function=FetchCalendar('events')" -->

/MR.T

in the first line require ssi.php
<? require("/homepages/xx/dxxxxxxxx/htdocs/forum/SSI.php"); ?>
and placed this:
<? FetchCalendar('bdays') ?> or ('events')
you will see the events, birthdays or holidays
Logged
Thomas
Full Member
***
Posts: 203


WWW
Re:[BETA 1.4.1] Fetch Calendar Info 1.0 Bèta
« Reply #7 on: September 10, 2002, 10:50:22 PM »
Reply with quote

I am going to use it at an shtml page - not php.

How do I do it then?

/MR.T
Logged
Horseman
YaBB God
*****
Posts: 784


'MAS VALE CABALLO QUE CAUDAL!'

ICQ - 44729151 WWW
Re:[BETA 1.4.1] Fetch Calendar Info 1.0 Bèta
« Reply #8 on: September 10, 2002, 10:55:09 PM »
Reply with quote

you can make a little php file and view this as a
<iframe> link to the php file </iframe> in you shtml page

hm
Logged
Thomas
Full Member
***
Posts: 203


WWW
Re:[BETA 1.4.1] Fetch Calendar Info 1.0 Bèta
« Reply #9 on: September 10, 2002, 11:02:16 PM »
Reply with quote

Interesting - I'll try that.

Is it not possible to use this with shtml. It works fine for the other stuff which is in ssi.php - for instance:

<!--#include virtual="/forum/SSI.php?function=whosOnline" -->

and

<!--#include virtual="/forum/SSI.php?function=recentTopics" -->

By the way. Is it possible to for instance view the events for the next x-days?

/MR.T
Logged
sylvester
YaBB God
*****
Posts: 525


Re:[BETA 1.4.1] Fetch Calendar Info 1.0 Bèta
« Reply #10 on: September 11, 2002, 06:54:22 PM »
Reply with quote

Quote[..]Is it not possible to use this with shtml. It works fine for the other stuff which is in ssi.php - for instance[..]
No, I use a function with an argument :-\
Perhaps someone else would make this SHTML-compatible ;) ;D
Logged

I'm back
tore-
Sr. Member
****
Posts: 291


I love YaBB SE!

Re:[BETA 1.4.1] Fetch Calendar Info 1.0 Bèta
« Reply #11 on: December 01, 2002, 05:25:55 PM »
Reply with quote

I FOUND A BUG!

For some wierd reason, the month stored in "yabbse_calendar" in the db, uses 0 (januar) to 11 (december).

Therefor, it wont show events. This aint a problem when there is holidays, because there they use 1-12 on the months.

They way i fixed is, was by doing this:
Find:
// Events
   if($what == 'events') {

Add after:
$month--;
And everything is fixed! :)
Logged

Star wars rules!
tore-
Sr. Member
****
Posts: 291


I love YaBB SE!

Re:[BETA 1.4.1] Fetch Calendar Info 1.0 Bèta
« Reply #12 on: December 01, 2002, 06:04:06 PM »
Reply with quote

I've made many changed to my version of the script, if there is no event,bday,holiday present, it will return with "No event/bday...."

Here is my full script:
function FetchCalendar($what=NULL) {
   global $db_prefix,$txt,$scripturl,$timeoffset,$scripturl;
   $timeUserOff = (isset($settings[18]) ? $settings[18] : 0);
   list($day,$month,$year) = explode('/',date('d/m/Y',time()+(($timeoffset+$timeUserOff)*3600)));
   
// Birthdates
   if($what == 'bdays') {
      $bdays_query = mysql_query("SELECT realName,memberName,year(birthdate) FROM {$db_prefix}members WHERE (dayofmonth(birthdate) = {$day} AND month(birthdate) = {$month})");
     if(mysql_num_rows($bdays_query) == 1) {
      if(mysql_num_rows($bdays_query) > 0)
         $return = '<B>'.$txt['calendar3'].'</B><BR>';
      while($bdays_result = mysql_fetch_row($bdays_query)) {
         $return .= '<A HREF=\''.$scripturl.'?action=viewprofile;user='.$bdays_result[1].'\'>'.$bdays_result[0].'</A> ('.($year - $bdays_result[2]).')<BR>';
     }
      }
     if(mysql_num_rows($bdays_query) == 0) { echo "No birthdays today"; }
   }

// Events
   if($what == 'events') {
     $month--;
      $events_query = mysql_query("SELECT title,id_board,id_topic FROM {$db_prefix}calendar WHERE (day = {$day} AND month = {$month} AND year = {$year})");
     if(mysql_num_rows($events_query) == 1) {
      if(mysql_num_rows($events_query) > 0)
         $return =  '<B>'.$txt['calendar4'].'</B><BR>';
      while($events_result = mysql_fetch_row($events_query)) {
         $return .= '<A HREF=\''.$scripturl.'?action=display;board='.$events_result[1].';threadid='.$events_result[2].'\'>'.$events_result[0].'</ A><BR>';
      }
   }
   if(mysql_num_rows($events_query) == 0) { echo "No events"; }
}
// Holidays
   if($what == 'holidays') {
      $holidays_query = mysql_query("SELECT title FROM {$db_prefix}calendar_holiday WHERE (day = {$day} AND month = {$month} AND (year IS NULL || year = {$year}))");
     if(mysql_num_rows($holidays_query) == 1) {
     if(mysql_num_rows($holidays_query) > 0)
         $return =  '<B>Holidays:</B><BR>';
      while($holidays_result = mysql_fetch_row($holidays_query)) {
         $return .= '<B>'.$holidays_result[0].'</B><BR>';
      }
   }
if(mysql_num_rows($holidays_query) == 0) { echo "No holiday today"; }
   }
   if(isset($return)) {
      echo $return;
   }
}
« Last Edit: December 01, 2002, 06:27:48 PM by tore- » Logged

Star wars rules!
tore-
Sr. Member
****
Posts: 291


I love YaBB SE!

Re:[BETA 1.4.1] Fetch Calendar Info 1.0 Bèta
« Reply #13 on: December 04, 2002, 05:38:47 PM »
Reply with quote

I think this should be in 1.5.0, dont know with you guys
Logged

Star wars rules!
DVS
Noobie
*
Posts: 28


WWW
Re:[beta 1.4.1] Fetch Calendar Info 1.0 Bèta
« Reply #14 on: August 22, 2003, 12:33:46 PM »
Reply with quote

This is an old topic, but hopefully someone can help.

I just installed this in YaBBSE and it works great if there is only one item (birthday, event, holiday) per day, but if there are more than one birthday, for example, on a day, it doesn't give a result.

Any ideas on how to fix this?

Thanks!

Anthony
Logged

Digital Vision Syndicate - www.dvsyndicate.com
Detroit Electronic Expo - www.detroitelectronic.com
Detroit Entertainment - www.detroitentertainment.tv
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Completed mods  |  [BETA 1.4.1] Fetch Calendar Info 1.0 Bèta « 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.038 seconds with 16 queries.