Show events as features
-
Open the events.php page in the /enc/ folder.
-
Find the lines:
if ($event) { echo ""; $desquery = "SELECT Name, Description FROM " .$DB_Prefix ."_events WHERE Date='$event'"; $desresult = mysql_query($desquery, $dblink) or die ("Unable to select. Try again later."); while ($desrow = mysql_fetch_row($desresult)) { $eventname = stripslashes($desrow[0]); $description = stripslashes($desrow[1]); if (strstr($description, '<') == FALSE AND strstr($description, '>') == FALSE) $description = str_replace (" ", "
", $description); $splitdate = explode("-",$event); $eventdate = date("l, F j, Y", mktime(0,0,0,$splitdate[1],$splitdate[2],$splitdate[0])); echo ""; echo "$eventname"; echo "
"; echo "
$eventdate$description
"; } echo ""; echo "All $curdate Events"; echo "
"; }and change them to:
if ($event) { $event_display = ""; $desquery = "SELECT Name, Description FROM " .$DB_Prefix ."_events WHERE Date='$event'"; $desresult = mysql_query($desquery, $dblink) or die ("Unable to select. Try again later."); while ($desrow = mysql_fetch_row($desresult)) { $eventname = stripslashes($desrow[0]); $description = stripslashes($desrow[1]); if (strstr($description, '<') == FALSE AND strstr($description, '>') == FALSE) $description = str_replace (" ", "
", $description); $splitdate = explode("-",$event); $eventdate = date("l, F j, Y", mktime(0,0,0,$splitdate[1],$splitdate[2],$splitdate[0])); $event_display .= ""; $event_display .= "$eventname"; $event_display .= "
"; $event_display .= "
$eventdate$description
"; } $event_display .= ""; $event_display .= "All $curdate Events"; $event_display .= "
"; }Note that the first echo is changed to $event_display = while the rest of the echo statements are changed to $event_display .= with a dot in front of the equal sign.
-
Now do a find/replace for #event in that same page and remove that text. So the line:
echo "$c";
would be changed to:
echo "$c";
and the line:
echo "$eventname ($eventdate)";
would be changed to:
echo "$eventname ($eventdate)";
-
Open the featured.php page in the /enc/ folder, and
-
If you want the events to appear *instead* of the featured items, just under the very first line:
add the code:
if ($event AND $event_display) echo $event_display; else {and just above the very last line:
?>
add:
}
-
OR if you want the events to appear underneath the featured items (ie. the featured items will still show up), just under the very first line:
add the code:
if ($event AND $event_display) echo $event_display;
-