[Trivialibre] r397 - trivialibre/trunk

trivialibre at enix.org trivialibre at enix.org
Dim 27 Aou 19:51:00 CEST 2006


Author: thomas
Date: Sun Aug 27 19:51:00 2006
New Revision: 397

Modified:
   trivialibre/trunk/html.php

Log:

 * html.php:

  - Affiche seulement les sections contenant des sections.



Modified: trivialibre/trunk/html.php
==============================================================================
--- trivialibre/trunk/html.php	(original)
+++ trivialibre/trunk/html.php	Sun Aug 27 19:51:00 2006
@@ -31,16 +31,13 @@
 {
   $db = new db();
 
-  echo "<h1>Questions <i>" . category_get($category) . "</i>";
+  /* Fetch author name */
   if ($author != "")
     {
       $req = $db->query("select author_name from tvl_questions where author_email='" . $author . "' limit 1");
       $item = mysql_fetch_object($req);
-      echo " de " . $item->author_name;
+      $author_name = $item->author_name;
     }
-  if ($status == 0)
-    echo " en attente de modération";
-  echo "</h1>\n";
 
   $sql = "select question, answer from tvl_questions where status=" . $status . " and category=" . $category;
   if ($author != "")
@@ -49,6 +46,16 @@
   $req = $db->query ($sql);
   $count = 0;
 
+  if (mysql_num_rows($req) != 0)
+    {
+      echo "<h1>Questions <i>" . category_get($category) . "</i>";
+      if ($author != "")
+	echo " de " . $author_name;
+      if ($status == 0)
+	echo " en attente de modération";
+      echo "</h1>\n";
+    }
+
   echo "<table width=\"100%\">";
   while ($item = mysql_fetch_object($req))
     {


Plus d'informations sur la liste de diffusion Trivialibre