right after it add
<option value="0000" $year0000selected>every year</option>
edit calendar.php
find in (action==display)
PHP Code:
WHERE eventdate
LIKE '$year-$doublemonth-%' AND ((userid = '$bbuserinfo[userid]' AND public = 0) OR (public = 1))");
and replace it with
PHP Code:
WHERE (eventdate LIKE '$year-$doublemonth-%' OR eventdate LIKE '0000-$doublemonth-%') AND ((userid = '$bbuserinfo[userid]' AND public = 0) OR (public = 1))");
find in (action==update)
PHP Code:
if (!checkdate($month,$day,$year))
replace it with
PHP Code:
if ($year=="0000") {
$testyear= date("Y");
} else {
$testyear=$year;
}
if (!checkdate($month,$day,$testyear))
jump to ($action == "getday")
under
PHP Code:
$eventdate = explode("-",$info[eventdate]);
add
PHP Code:
if ($eventdate[0]=="0000") {
$eventdate[0]=$year;
}
thats it. Now enter a calendar event and when you pick the year, choose the new option 'every year'. the event will show up this year, next year, the year after. hell it will even show up last year.
I just did it and haven't tested it really well, but it sure looks like it works. let me know what ya think
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
It would be a the same update for the homepage as in calendar.php. I'll have to look at it and tell you exactly what to change.
I have a request. does anybody have a db of holidays? since we can have re-occurring events, I thought it would be nice to add the holidays to the calendar but I don't want to type them all in. if someone has a txt file listing holidays and dates (maybe even holiday descriptions) I'll make a little improt script and post it with the db.
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.
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))");
$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.