Improve layout for the front page, use CSS instead of HTML
[infodrom.org/oldenburg.linux.de] / src / index.wml
index 529b3eb..ad7a71e 100644 (file)
@@ -15,10 +15,10 @@ function next_date()
   global $max_days;
   global $datedb;
 
-  $head = '<div class="news"><div class="newsbody"><h3 class="newstitle">%s</h3><div class="date">';
-  $head .= '<table class="font" cellpadding=1 cellspacing=2 width=100%%><tr><th>Wann</th><th>Was</th><th>Wo</th></tr>';
+  $head = '<div class="news"><div class="datesbody"><h3 class="newstitle">%s</h3><div class="date">';
+  $head .= '<table class="font" cellpadding=2 cellspacing=0 width=100%%><tr class="head"><th>Wann</th><th>Was</th><th>Wo</th></tr>';
   $foot = '</table></div></div></div>';
-  $row = '<tr%s><td>%s</td><td>%s</td><td>%s</td></tr>';
+  $row = '<tr class="%s"><td>%s</td><td>%s</td><td>%s</td></tr>';
   $pivot = time() + 60*60*24*$max_days;
   $now = mktime(0,0,0, date('m'), date('d'), date('Y'));
 
@@ -49,10 +49,10 @@ function next_date()
 
          if ($when == $now) {
            $date = '<strong>heute, ' . $match[4].'</strong>';
-           $color = ' bgcolor="#ffff00"';
+           $class = 'today';
          } else {
            $date = strftime("%e.%m.%y", $when) . ', ' . $match[4];
-           $color = '';
+           $class = ($class == 'row0'?'row1':'row0');
          }
 
          if (empty($match[7]))
@@ -60,7 +60,7 @@ function next_date()
          else
            $what = '<a href="'.$match[7].'">'.$match[5].'</a>';
 
-         printf($row, $color, $date, $what, $match[6]);
+         printf($row, $class, $date, $what, $match[6]);
        }
       }
       echo $foot;