cvs: phpweb / index.php style.css
| From: | Gabor Hojtsy | Date: | Thu, 05 Jun 2003 18:46:22 +0000 |
| Subject: | cvs: phpweb / index.php style.css | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-18521@lists.php.net to get a copy of this message | ||
goba Thu Jun 5 14:46:22 2003 EDT
Modified files:
/phpweb index.php style.css
Log:
Use real HTML headers instead of simultaing them with
formatting markup
Drop the reference to <div class="small"> which was nonexistent,
and introduce a month header class to not list the month names at
all events, but only as a header
Reflect the latest changes in the comments too
Index: phpweb/index.php
diff -u phpweb/index.php:1.388 phpweb/index.php:1.389
--- phpweb/index.php:1.388 Sun Jun 1 15:16:54 2003
+++ phpweb/index.php Thu Jun 5 14:46:22 2003
@@ -145,14 +145,14 @@
// If we were able to open the file
if ($fp) {
- // Current month number (for delimiter additions)
+ // Current month number, current category and categories list
$cm = $ccat = 0;
- $cats = array('unknown','User Group
Events','Conferences','Training');
+ $cats = array('unknown', 'User Group Events', 'Conferences',
'Training');
// Event duplication check hash
$seen = array();
- $RSIDEBAR_DATA .= '<div align="left"><b>Upcoming
Events</b></div><div align="right"><a
href="submit-event.php">[add event]</a></div>';
+ $RSIDEBAR_DATA .= '<h3>Upcoming Events <a
href="submit-event.php">[add]</a></h3>';
// While we can read the events file
while (true) {
@@ -160,41 +160,41 @@
// Get information event elements from file
$elems = fgetcsv($fp, 8192);
if($elems === false) { break; }
- list($d, $m, $y, $ccode, $desc, $id, , , , , , ,$cat) = $elems;
+ list($d, $m, $y, $ccode, $desc, $id, , , , , , , $cat) = $elems;
// Fgetcvs() returns an array with a single null element
// for a blank line, which we need to skip
if ($d === NULL) { continue; }
- if ($ccat != (int)$cat) {
- $RSIDEBAR_DATA .= '<br /><div
align="left"><tt><u><b>'.$cats[$cat].'</b></u></tt><br
/></div>';
- $ccat = $cat;
- }
-
// If the month number changed
if ($cm != (int) $m) {
- // If we are not at the begining
- if ($cm) {
-# $RSIDEBAR_DATA .= "<br />\n";
- }
-
// Update current month information
$cm = (int) $m;
- // Get abbreviated month name
- $mon = strftime('%b', mktime(12, 0, 0, $cm, $d, $y));
+ // Start month with a header
+ $RSIDEBAR_DATA .= '<h4 class="eventmonth">' .
+ strftime('%B', mktime(12, 0, 0, $cm, $d, $y)) .
+ "</h4>\n";
// We have not seen any events in this month
$seen = array();
}
- // There is no event with this description in this month
+ // Start new category with a category header
+ if ($ccat != (int) $cat) {
+ $RSIDEBAR_DATA .= '<h4>' . $cats[$cat] . '</h4>';
+ $ccat = $cat;
+ }
+
+ // There is no event with this description in this month already seen
if (!isset($seen[$desc])) {
+
// Add event to sidebar
- $RSIDEBAR_DATA .= "<span class=\"event_$ccode\"><div
class=\"small\">$mon.$d <a href=\"cal.php?id=$id\">" .
+ $RSIDEBAR_DATA .= "<span class=\"event_$ccode\">$d. <a
href=\"cal.php?id=$id\">" .
htmlspecialchars(stripslashes($desc)) .
- "</a></div></span>\n";
+ "</a></span><br />\n";
+
// Set seen flag
$seen[$desc] = TRUE;
}
Index: phpweb/style.css
diff -u phpweb/style.css:1.41 phpweb/style.css:1.42
--- phpweb/style.css:1.41 Wed May 14 16:32:10 2003
+++ phpweb/style.css Thu Jun 5 14:46:22 2003
@@ -19,6 +19,15 @@
height: 1px;
}
+/* Event month header on homepage */
+h4.eventmonth {
+ border-style: solid;
+ border-color: black;
+ border-width: 0px 1px 1px 0px;
+ background-color: lightgray;
+ padding: 2px;
+}
+
body, ul, td, th {
font-family: verdana,arial,helvetica,sans-serif;
font-size: 85%;