
December 18th, 2002, 07:31 PM
|
|
Registered User
|
|
Join Date: Apr 2007
Posts: 22,309
Time spent in forums: < 1 sec
Reputation Power: 24
|
|
|
lwtCalendar suggestion
Just wanted to pass this on to to others. If you want your calendar to open up on the next event here is a quick function to do so.
php Code:
Original
- php Code |
|
|
|
// Quick util function function get_next_event() { $db = new ltw_db; $calendar_table = $ltw_config['db_table_calendar']; $query = "SELECT UNIX_TIMESTAMP(event_date) as stamp FROM $calendar_table WHERE event_date > (DATE_SUB(now(), INTERVAL "1" DAY)) order by event_date LIMIT 1"; $result = $db->db_query($query); $row = $db->db_fetch_array($result); return($row['stamp']); } //end get_next_event()
Then near the very bottom of calendar.php under the default switch change $timestamp=time(); to $timestamp=get_next_event();
This could quickly be added as a config in lwtconfig. Just use an if-else statement.
To the author.... Just wanted to say thanks for putting the code out there. Very nice and clean. I need to make some modifications for my needs, but I really do appreciate the great lead you gave me.
Mike
mikejp.@.NOSPAM.videotron.ca.NOSPAM.
|