Great post but I already did something similiar for annual events. I used the year 1900 instead

Year 0000 gave me problems.
I just never got around to posting it here. Too busy setting up the site.
Quote:
Originally posted by Lionel
My holidays are non Americans.
I still have it installed but cannot use it as the db does not seem to see "every year" and therefore not displaying event in front page (from hack to display event same like birthday). Once I reverted from recurring to 2002 it showed.
|
I think I know which hack you are referring to.
This is a section from that original hack.
Find:
PHP Code:
$today = vbdate("Y-m-d",time());
$events=$DB_site->query("SELECT eventid, subject, eventdate, public FROM calendar_events WHERE eventdate='$today' AND ((userid = '$bbuserinfo[userid]') OR (public = 1))");
Replace with:
PHP Code:
$todayactual = vbdate("Y-m-d",time());
$today = vbdate("m-d",time());
$events=$DB_site->query("SELECT eventid, subject, eventdate, public FROM calendar_events WHERE ((eventdate LIKE '1900-$today') OR (eventdate = '$todayactual')) AND ((userid = '$bbuserinfo[userid]') OR (public = 1))") ;
and in another original section of that hack
Find:
PHP Code:
while ($event=$DB_site->fetch_array($events)) {
$eventsubject = htmlspecialchars($event[subject]);
Replace with:
PHP Code:
while ($event=$DB_site->fetch_array($events)) {
$annualevent = '';
if (substr($event[eventdate],0,4) == '1900') {
$annualevent = '*';
}
$eventsubject = $annualevent . htmlspecialchars($event[subject]);
This just precedes the event subject with an '*'.
Note again that I used 1900 instead of the mentioned 0000. A year of 0000 gave me troubles.