Submitter
SUPPORT TOPIC File Information
- Submitted: Aug 21 2008 08:59 PM
- Last Updated: Aug 21 2008 09:47 PM
- File Size: 2.08K
- Views: 2343
- Downloads: 393
Previous Versions
Download upcoming_events
//upcoming_events
//grabs next 5 events from zcal and makes a list
// sure this could be cleaner using the etomite apis but was under time constraints :)
$hostname_eto0614 = $GLOBALS['database_server']; //localhost
$username_eto0614 = $GLOBALS['database_user']; //root
$password_eto0614 = $GLOBALS['database_password']; //password
$database_eto0614 = trim($GLOBALS['dbase'],'`'); //database
$eto0614 = mysql_pconnect($hostname_eto0614, $username_eto0614, $password_eto0614) or die(mysql_error());
$maxRows_zcal = 5;
$pageNum_zcal = 0;
if (isset($HTTP_GET_VARS['pageNum_zcal'])) {
$pageNum_zcal = $HTTP_GET_VARS['pageNum_zcal'];
}
$startRow_zcal = $pageNum_zcal * $maxRows_zcal;
$colname_zcal = "1";
if (isset($HTTP_SERVER_VARS['sdate'])) {
$colname_zcal = (get_magic_quotes_gpc()) ? $HTTP_SERVER_VARS['sdate'] : addslashes($HTTP_SERVER_VARS['sdate']);
}
mysql_select_db($database_eto0614, $eto0614);
$query_zcal = sprintf("SELECT * FROM etomite_zcalendar WHERE sdate >= CURDATE() ORDER BY sdate ASC", $colname_zcal);
$query_limit_zcal = sprintf("%s LIMIT %d, %d", $query_zcal, $startRow_zcal, $maxRows_zcal);
$zcal = mysql_query($query_limit_zcal, $eto0614) or die(mysql_error());
$row_zcal = mysql_fetch_assoc($zcal);
if (isset($HTTP_GET_VARS['totalRows_zcal'])) {
$totalRows_zcal = $HTTP_GET_VARS['totalRows_zcal'];
} else {
$all_zcal = mysql_query($query_zcal);
$totalRows_zcal = mysql_num_rows($all_zcal);
}
$totalPages_zcal = ceil($totalRows_zcal/$maxRows_zcal)-1;
//-----------here's the output stuff change the title link, and link text if you like...--------------------------------
$output .=('<p id="rightcontenttitle">Public Seminars</p> ');
$output .=('<ul class="upcomingevents">');
do {
$output .=('<li>');
$output .=($row_zcal['title']);
$output .=(' - ');
$output .=date("F j, Y", strtotime($row_zcal['sdate']));
$output .=('</li>');
} while ($row_zcal = mysql_fetch_assoc($zcal));
$output .=('</ul>');
$output .=('<br/><div id="view"><a href="Calendar.html">View our Calendar</a></div>');
mysql_free_result($zcal);
return $output;
edited to validate....
- 248 Total Files
- 19 Total Categories
- 50 Total Authors
- 131,652 Total Downloads
- TripTracker Gallery Latest File
- Dean Latest Submitter












