Brock
Noobie
Posts: 18
|
|
Re:Get the calendar events for x days
« Reply #1 on: September 03, 2002, 07:31:01 PM » |
|
Here's some simple code to grab the entire calendar for you - adding the other functionality you want should be simple with this base.
<?php
$types_to_register = array('GET','POST','COOKIE','SESSION','SERVER'); foreach ($types_to_register as $type) { $arr = @${'HTTP_' . $type . '_VARS'}; if (@count($arr) > 0) { extract($arr, EXTR_OVERWRITE); } }
function page_top() { print("<html>\n<head>\n <title>Yabbse Calendar</title>\n"); print("</head>\n"); print("<body font size=4>\n\n"); }
function list_calendar() {
print("<table border=4 bordercolorlight=#333399 bordercolordark=#333399"); print(" cellpadding=3 width='90%'>\n"); print(" <th align=left>Event</th>\n"); print(" <th align=left>Date</th>\n");
$result = mysql_query("SELECT * from yabbse_calendar order by month,day,year");
while ($myrow = mysql_fetch_row($result)) { /* Schema : * * id int(10) unsigned NOT NULL auto_increment, * id_board int(10) unsigned NOT NULL default '0', * id_topic int(10) unsigned NOT NULL default '0', * title char(30) NOT NULL default '', * id_member int(10) unsigned NOT NULL default '0', * month tinyint(4) NOT NULL default '0', * day tinyint(4) NOT NULL default '0', * year smallint(6) NOT NULL default '0', * PRIMARY KEY (id), * KEY idx_year_month (year,month) * * To make a link to the relevant topic posting on your yabbse board, * build the urls as such : * <url>/index.php?board=id_board;action=display;threadid=id_topic * */
printf("<tr><td>%s</td>", $myrow[3]); printf("<td>%02d/%02d/%04d</td></tr>\n", $myrow[5],$myrow[6],$myrow[7]); } print("</table>\n"); }
error_reporting (E_ALL ^ E_NOTICE);
$dbcon = mysql_connect('localhost', 'username', 'password'); mysql_select_db('yabbse');
page_top(); list_calendar(); print("<br>\n"); print("<html>"); ?>
Obviously, replace relevant parts of this with the values for your system.
|