Improved index view
authorJoey Schulze <joey@infodrom.org>
Thu, 7 Dec 2006 14:50:00 +0000 (14:50 +0000)
committerJoey Schulze <joey@infodrom.org>
Thu, 7 Dec 2006 14:50:00 +0000 (14:50 +0000)
src/News/index.wml
src/News/shownews.wml

index b5f2b2d..885ce5b 100644 (file)
       $date = explode (" ", $row['releasedate']);
       $date = explode ("-", $date[0]);
       $date = sprintf ("%d.%d.%d", $date[2], $date[1], $date[0]);
-      printf ("<h3 class=\"newstitle\">%s</h3>", $row['subject']);
+
+      # if (!strncmp($row['body'], 'http://', 7))
+      if (!strcmp(substr($row['body'],0,7), 'http://'))
+       $url = $row['body'];
+      else
+       $url = sprintf ("shownews.php3?id=%d", $row['id']);
+
+      echo ("<div class=\"newsbox\">");
+
+      if (strlen ($row['body']) > 0)
+        printf ("<h3 class=\"newstitle\"><a href=\"%s\">%s</a></h3>", $url, $row['subject']);
+      else
+        printf ("<h3 class=\"newstitle\">%s</h3>", $row['subject']);
+
       printf ("<div class=\"newsauthor\">By: %s, %s</div>", $row['author'], $date);
       printf ("<div class=\"newscontent\">%s", $row['teaser']);
 
-      if (strlen ($row['body']) > 0) {
-        # if (!strncmp($row['body'], 'http://', 7))
-        if (!strcmp(substr($row['body'],0,7), 'http://'))
-         $url = $row['body'];
-       else
-         $url = sprintf ("shownews.php3?id=%d", $row['id']);
+      if (strlen ($row['body']) > 0)
         printf (" <a href=\"%s\"><phpmehr></a>", $url);
-      }
+
+      echo ("</div>");
       echo ("</div>");
   }
 ?>
index 02f089c..a821317 100644 (file)
       $date = explode (" ", $row['releasedate']);
       $date = explode ("-", $date[0]);
       $date = sprintf ("%d.%d.%d", $date[2], $date[1], $date[0]);
-      printf ("<h3 class=\"newstitle\">%s</h3>", $row['subject']);
+
+      # if (!strncmp($row['body'], 'http://', 7))
+      if (!strcmp(substr($row['body'],0,7), 'http://'))
+       $url = $row['body'];
+      else
+       $url = sprintf ("shownews.php3?id=%d", $row['id']);
+
+      echo ("<div class=\"newsbox\">");
+
+      if (strlen ($row['body']) > 0)
+        printf ("<h3 class=\"newstitle\"><a href=\"%s\">%s</a></h3>", $url, $row['subject']);
+      else
+        printf ("<h3 class=\"newstitle\">%s</h3>", $row['subject']);
+
       printf ("<div class=\"newsauthor\">By: %s, %s</div>", $row['author'], $date);
       printf ("<div class=\"newscontent\">%s", $row['teaser']);
 
-      if (strlen ($row['body']) > 0) {
-        # if (!strncmp($row['body'], 'http://', 7))
-        if (!strcmp(substr($row['body'],0,7), 'http://'))
-         $url = $row['body'];
-       else
-         $url = sprintf ("shownews.php3?id=%d", $row['id']);
+      if (strlen ($row['body']) > 0)
         printf (" <a href=\"%s\"><phpmehr></a>", $url);
-      }
+
+      echo ("</div>");
       echo ("</div>");
     }
   }