Now I see. In my attempt to add the start time (time_start1) in the event list, I happened to comment out the part that I shouldn't. I wasn't quite sure what I was doing though. Now it is corrected and displaying the way I wanted it.
Please check my index.php and see if there is any potential problem with the codes that I added (cut and paste from event.php). I marked the added codes as "Sam added."
Text Formatted Code
<?php
// +-----------------------------------------------------------------------------+
// | evList A calendar solution for Geeklog |
// | Date: Aug, 2007 |
// +-----------------------------------------------------------------------------+
// | index.php |
// +-----------------------------------------------------------------------------+
// | Copyright (C) 2007 by: |
// | evList Plugin Author: |
// | Alford Deeley - ajdeeley@summitpages.ca |
// +-----------------------------------------------------------------------------+
// | Geeklog Common Code |
// | Copyright (C) 2000-2007 by the following authors: |
// | Authors: Tony Bibbs - tony@tonybibbs.com |
// | Mark Limburg - mlimburg@users.sourceforge.net |
// | Jason Whittenburg - jwhitten@securitygeeks.com |
// | Dirk Haun - dirk@haun-online.de |
// +-----------------------------------------------------------------------------+
// | |
// | This program is licensed under the terms of the GNU General Public License |
// | as published by the Free Software Foundation; either version 2 |
// | of the License, or (at your option) any later version. |
// | |
// | This program is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
// | See the GNU General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software Foundation, |
// | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
// | |
// +-----------------------------------------------------------------------------+
require_once('../lib-common.php');
if (!function_exists('evlist_hit')){
//just refresh page to index
print COM_refresh($_CONF['site_url']);
exit;
}
if (DB_getItem($_TABLES['evlist_settings'], 'allow_anon_view') != '1' && $_USER['uid'] < 2) {
$display = COM_siteHeader ('menu', $LANG_EVLIST00[4]);
$display .= COM_startBlock ($LANG_EVLIST00[4], '',
COM_getBlockTemplate ('_msg_block', 'header'));
$display .= $LANG_EVLIST00[5];
$display .= COM_endBlock (COM_getBlockTemplate ('_msg_block', 'footer'));
$display .= COM_siteFooter ();
COM_accessLog ("An anonymous user, {$_SERVER['REMOTE_ADDR']}, tried to illegally access the evList index page.");
echo $display;
exit;
}
function evlist_listevents($range = '', $category = '') {
global $_CONF, $_USER, $_TABLES, $LANG_EVLIST02, $LANG_EVLIST03;
$retval = '';
$t = new Template($_CONF['path'] . 'plugins/evlist/templates/');
$t->set_file('index', 'index.thtml');
$Sresult = DB_query("SELECT allow_anon_add, allow_user_add, allow_html, enable_categories FROM {$_TABLES['evlist_settings']}");
$S = DB_fetchArray($Sresult);
if (($_USER['uid'] < 2 && $S['allow_anon_add'] == '1') || ($_USER['uid'] > 1 && $S['allow_user_add'] == '1') || SEC_hasRights('evlist.edit')) {
$add_event_link = '<a href="' . $_CONF['site_url'] . '/evlist/event.php?op=new'
. '">' . $LANG_EVLIST02[17] . '</a>';
} else {
$add_event_link = '';
}
$t->set_var(array(
'action' => $_CONF['site_url'] . '/evlist/index.php',
'query_label' => $LANG_EVLIST02[10],
'range_options' => evlist_getRangeOptions($range),
'go' => $LANG_EVLIST02[16],
'add_event_link' => $add_event_link
));
if ($S['enable_categories'] == '1') {
if (DB_count($_TABLES['evlist_categories'], 'status', '1') >= 1) {
$t->set_file('category_form', 'category_dd.thtml');
$t->set_var(array(
'category_label' => $LANG_EVLIST03[22],
'category_options' => evlist_getCategoryOptions($category)
));
$t->parse ('category_dd','category_form');
}
}
$result = evlist_events_query($range, '', $category);
if (empty($result)) {
//return empty list msg
$t->set_var('empty_listmsg', $LANG_EVLIST02[1]);
} else {
//populate list
$t->set_file(array(
'item' => 'list_item.thtml',
'editlinks' => 'edit_links.thtml',
'category_form' => 'category_dd.thtml'
));
if (!empty($range)) {
$andrange = '&range=' . $range;
} else $andrange = '&range=2';
if (!empty($category)) {
$andcat = '&cat=' . $category;
} else $andcat = '';
while ($A = DB_fetchArray($result)) {
if ($A['recurring'] == '1') {
//are we displaying a recurrence?
//if so add a timestamp to the appropriate urls.
$timestamp = "&ts=" . strtotime($A['date_start1']);
} else $timestamp = '&ts=0';
$titlelink = COM_buildURL($_CONF['site_url'] . '/evlist/event.php?eid=' . $A['id'] . $timestamp . $andrange . $andcat);
$titlelink = '<a href="' . $titlelink . '">' . COM_stripslashes($A['title']) . '</a>';
$summary = PLG_replaceTags(COM_stripslashes($A['summary']));
$datesummary = sprintf($LANG_EVLIST02[3], evlist_displayFormatedDate(strtotime($A['date_start1'])));
$morelink = COM_buildURL($_CONF['site_url'] . '/evlist/event.php?eid=' . $A['id'] . $timestamp . $andrange . $andcat);
$morelink = '<a href="' . $morelink . '">' . $LANG_EVLIST02[4] . '</a>';
$contactlink = $_CONF['site_url'] . '/profiles.php?uid=' . $A['owner_id'];
$contactlink = '<a href="' . $contactlink . '">' . $LANG_EVLIST02[5] . '</a>';
// Sam added for showing start datetime
# check for $timestamp here and supply the appropriate dates.
# timestamp represents the interval between the original and the new start date.
# you are viewing a recurrence of an event so dates will not be as original.
# add the diff between date_start1 and timestamp to the other dates
if (!empty($timestamp)) {
$timediff = $timestamp - strtotime($A['date_start1']);
$A['date_start1'] = evlist_displayFormatedDate($timestamp);
$A['date_end1'] = (!empty($A['date_end1']) && $A['date_end1'] != '0000-00-00') ? evlist_displayFormatedDate(strtotime($A['date_end1']) + $timediff) : '';
$A['date_start2'] = (!empty($A['date_start2']) && $A['date_start2'] != '0000-00-00') ? evlist_displayFormatedDate(strtotime($A['date_start2']) + $timediff) : '';
$A['date_end2'] = (!empty($A['date_end2']) && $A['date_end2'] != '0000-00-00') ? evlist_displayFormatedDate(strtotime($A['date_end2']) + $timediff) : '';
} else {
$A['date_start1'] = evlist_displayFormatedDate(strtotime($A['date_start1']));
$A['date_end1'] = (!empty($A['date_end1']) && $A['date_end1'] != '0000-00-00') ? evlist_displayFormatedDate(strtotime($A['date_end1'])) : '';
$A['date_start2'] = (!empty($A['date_start2']) && $A['date_start2'] != '0000-00-00') ? evlist_displayFormatedDate(strtotime($A['date_start2'])) : '';
$A['date_end2'] = (!empty($A['date_end2']) && $A['date_end2'] != '0000-00-00') ? evlist_displayFormatedDate(strtotime($A['date_end2'])) : '';
}
if (!empty($A['date_start1']) && $A['date_start1'] != '0000-00-00') {
//$datestart1 = evlist_displayFormatedDate(strtotime($A['date_start1']));
$datestart1 = $LANG_EVLIST03[3] . $A['date_start1'];
if (!empty($A['time_start1'])) {
$timestart1 = ', ' . evlist_displayFormatedTime(strtotime($A['time_start1']));
} else {
$timestart1 = '';
}
if ($A['allday'] == '1') {
$allday = '<br />' . $LANG_EVLIST03[14];
} else {
$allday = '';
}
if ($A['recurring'] == '1') {
$every = array(1 => $LANG_EVLIST03[17], 2 => $LANG_EVLIST03[18],
3 => $LANG_EVLIST03[19], 4 => $LANG_EVLIST03[20], 5 => $LANG_EVLIST03[18]);
switch ($A['rec_option']) {
case 1:
case 2:
case 3:
case 5:
$recurring = '<br />' . sprintf($LANG_EVLIST03[15], $every[$A['rec_option']]);
break;
case 4:
$weekstart = $S['week_begins'];//DB_getItem($_TABLES['evlist_settings'], 'week_begins');
if ($weekstart == 1) {
$weekdaysA = array(1 => $LANG_EVLIST12[1]);
} else {
$weekdaysA = array(0 => $LANG_EVLIST12[1]);
}
array_push($weekdaysA, $LANG_EVLIST12[2], $LANG_EVLIST12[3], $LANG_EVLIST12[4],
$LANG_EVLIST12[5], $LANG_EVLIST12[6], $LANG_EVLIST12[7]);
$daynumsA = explode(";", $A['rec_data']);
$daynumsA = explode(",", $daynumsA[0]);
$daycount = count($daynumsA);
$weekdays = '';
for ($i = 0; $i < $daycount; $i++) {
if (!empty($daynumsA[$i])) {
if ($i == $daycount - 1) {
if ($daycount > 0 ) {
$weekdays .= $LANG_EVLIST03[21];
}
$weekdays .= $weekdaysA[$daynumsA[$i]];
} else {
$weekdays .= $weekdaysA[$daynumsA[$i]] . ', ';
}
}
}
$recurring = '<br />' . sprintf($LANG_EVLIST03[15], sprintf($every[$A['rec_option']], $weekdays));
break;
#case 6:
# $recurring = '<br />' . sprintf();
# break;
}
} else {
$recurring = '';
}
} else {
//of course this should never happen cuz ds1 is now required
$datestart1 = '';
}
if (!empty($A['date_end1']) && $A['date_end1'] != '0000-00-00') {
//$dateend1 = evlist_displayFormatedDate(strtotime($A['date_end1']));
$dateend1 = '<br />' . $LANG_EVLIST03[4] . $A['date_end1'];
if (!empty($A['time_end1'])) {
$timeend1 = ', ' . evlist_displayFormatedTime(strtotime($A['time_end1']));
} else {
$timeend1 = '';
}
} else {
$dateend1 = '';
}
if (!empty($A['date_start2']) && $A['date_start2'] != '0000-00-00') {
//$datestart2 = evlist_displayFormatedDate(strtotime($A['date_start2']));
$datestart2 = '<br />' . $LANG_EVLIST03[3] . $A['date_start2'];
if (!empty($A['time_start2'])) {
$timestart2 = ', ' . evlist_displayFormatedTime(strtotime($A['time_start2']));
} else {
$timestart2 = '';
}
} else {
$datestart2 = '';
}
if (!empty($A['date_end2']) && $A['date_end2'] != '0000-00-00') {
//$dateend2 = evlist_displayFormatedDate(strtotime($A['date_end2']));
$dateend2 = '<br />' . $LANG_EVLIST03[4] . $A['date_end2'];
if (!empty($A['time_end2'])) {
$timeend2 = ', ' . evlist_displayFormatedTime(strtotime($A['time_end2']));
} else {
$timeend2 = '';
}
} else {
$dateend2 = '';
}
// End Sam added
$t->set_var(array(
'title' => $titlelink,
'date_summary' => $datesummary,
'summary' => $summary,
'more_link' => $morelink,
'contact_link' => $contactlink,
// Sam added
'time_start1' => $timestart1,
'time_start2' => $timestart2,
// End Sam added
));
//display delete and edit links
if (SEC_hasRights('evlist.edit')) {
$editlink = $_CONF['site_url'] . '/evlist/event.php?eid=' . $A['id'] . '&op=edit';
$editlink = '<a href="' . $editlink . '">' . $LANG_EVLIST03[8] . '</a>';
$t->set_var('edit_link', $editlink);
$deletelink = $_CONF['site_url'] . '/evlist/event.php?eid=' . $A['id'] . '&op=del';
$deletelink = '<a href="' . $deletelink . '">' . $LANG_EVLIST03[9] . '</a>';
$t->set_var('delete_link', $deletelink);
$t->parse('edit_links', 'editlinks');
}
$t->parse ('event_item','item', true);
}
}
$t->parse ('output', 'index');
$retval .= $t->finish($t->get_var('output'));
return $retval;
}
/*
* Main Function
*/
COM_setArgNames(array('op','range','cat'));
$op = COM_applyFilter(COM_getArgument('op'));
$range = COM_applyFilter(COM_getArgument('range'),true);
$category = COM_applyFilter(COM_getArgument('cat'),true);
if (!empty($category)) {
$catname = DB_getItem($_TABLES['evlist_categories'], 'name', "id = '$category'");
}
#if (!empty($_REQUEST['op'])) {
# $op = COM_applyFilter($_REQUEST['op'], true);
#} else $op = '';
#if (!empty($_REQUEST['range'])) {
# $range = COM_applyFilter($_REQUEST['range'], true);
#} else $range = '';
#if (!empty($_REQUEST['cat'])) {
# $category = COM_applyFilter($_REQUEST['cat'], true);
# $catname = DB_getItem($_TABLES['evlist_categories'], 'name', "id = '$category'");
#} else $category = '';
if (!empty($_REQUEST['msg'])) {
$msg = COM_applyFilter($_REQUEST['msg'], true);
} else $msg = '';
// Sam changed the following line
// $display = COM_siteHeader();
$display = COM_siteHeader('menu', $LANG_EVLIST00[2]);
if (!empty($msg)) {
//msg block
$display .= COM_startBlock('','','blockheader-message.thtml');
$display .= $LANG_EVLIST07[$msg];
$display .= COM_endBlock('blockfooter-message.thtml');
}
if ($range == '1') { // past events
$block_title = $LANG_EVLIST02[8];
if (!empty($category)) {
$block_title .= ' / ' . $LANG_EVLIST02[15] . ': ' . $catname;
}
} elseif ($range == '2') { // upcoming events
$block_title = $LANG_EVLIST02[9];
if (!empty($category)) {
$block_title .= ' / ' . $LANG_EVLIST02[15] . ': ' . $catname;
}
} elseif ($range == '3') { // next 7 days
$block_title = $LANG_EVLIST02[11];
if (!empty($category)) {
$block_title .= ' / ' . $LANG_EVLIST02[15] . ': ' . $catname;
}
} elseif ($range == '4') { // next 1 month
$block_title = $LANG_EVLIST02[12];
if (!empty($category)) {
$block_title .= ' / ' . $LANG_EVLIST02[15] . ': ' . $catname;
}
} else { // upcoming events
$block_title = $LANG_EVLIST02[2];
if (!empty($category)) {
$block_title .= ' / ' . $LANG_EVLIST02[15] . ': ' . $catname;
}
}
$display .= COM_startBlock($block_title);
//more ops to come later if needed
if ($op == 'list') {
$display .= evlist_listevents($range, $category);
} else {
//default
$display .= evlist_listevents($range, $category);
}
$display .= evlist_pagenav($range, $category);
$display .= COM_endBlock();
$display .= COM_siteFooter(true);
echo $display;
?>
Using this added coded, I added {time_start1}{time_start2} to the list_item.thtml.