home *** CD-ROM | disk | FTP | other *** search
/ PC World 2001 March / PCWorld_2001-03_cd.bin / KOMUNIK / progweb / progweb.exe / phpnuke / html / topics.php < prev    next >
PHP Script  |  2000-12-05  |  2KB  |  61 lines

  1. <?PHP
  2.  
  3. ######################################################################
  4. # PHP-NUKE: Web Portal System
  5. # ===========================
  6. #
  7. # Copyright (c) 2000 by Francisco Burzi (fburzi@ncc.org.ve)
  8. # http://phpnuke.org
  9. #
  10. # This modules is to display all available topics to your visitors
  11. #
  12. # This program is free software. You can redistribute it and/or modify
  13. # it under the terms of the GNU General Public License as published by
  14. # the Free Software Foundation; either version 2 of the License.
  15. ######################################################################
  16.  
  17. if (!IsSet($mainfile)) { include ('mainfile.php'); }
  18.  
  19.     include("header.php");
  20.     $result = mysql_query("select topicid, topicname, topicimage, topictext from topics order by topicname");
  21.     if (mysql_num_rows($result)==0) {
  22.         echo "<table border=0 bgcolor=000000 cellpadding=2 cellspacing=0 width=95%>
  23.         <tr><td>
  24.         <table border=0 bgcolor=FFFFFF cellpadding=1 cellspacing=0 width=100%>";
  25.     }
  26.     if (mysql_num_rows($result) > 0) {
  27.  
  28.     echo "<table border=0 bgcolor=000000 cellpadding=2 cellspacing=0 width=100%>
  29.     <tr><td>
  30.     <table border=0 bgcolor=FFFFFF cellpadding=1 cellspacing=0 width=100%>
  31.     <tr><td><font size=3><b><center>".translate("Current Active Topics")."</b><br>".translate("Click to list all articles in this topic")."</center><br>
  32.     <center><table border=0 width=100% align=center cellpadding=2><tr>";
  33.  
  34.  
  35.         while(list($topicid, $topicname, $topicimage, $topictext) = mysql_fetch_array($result)) {
  36. ?>
  37.             
  38.         <td align=center>
  39.         <?php echo "<a href=search.php?query=&topic=$topicid>"; ?><img src=<?php echo "$tipath$topicimage"; ?> border=0></a><br>
  40.         <font size=2><b><?php echo "$topictext"; ?>
  41.         </td>
  42.         <?php
  43.         
  44.         // Thanks to John Hoffmann from softlinux.org for the next 5 lines ;)
  45.         
  46.         $count++;
  47.         if ($count == 5) {
  48.             echo "</tr></tr>";
  49.             $count = 0;
  50.         }
  51.         }
  52.     echo "</tr></table>";
  53.     } 
  54.     ?>
  55.     </td></tr></table></td></tr></table>
  56.     <?php
  57.     mysql_free_result($result);
  58.     include("footer.php");
  59.  
  60. ?>
  61.