home *** CD-ROM | disk | FTP | other *** search
/ PC World 2005 April / PCWorld_2005-04_cd.bin / akce / web / unitednuke / unitednuke.exe / html / blocks / block-Forums.php < prev    next >
PHP Script  |  2004-01-10  |  2KB  |  41 lines

  1. <?php
  2.  
  3. /************************************************************************/
  4. /* PHP-NUKE: Web Portal System                                          */
  5. /* ===========================                                          */
  6. /*                                                                      */
  7. /* Copyright (c) 2002 by Francisco Burzi (fbc@mandrakesoft.com)         */
  8. /* http://phpnuke.org                                                   */
  9. /*                                                                      */
  10. /* This is a 2 min hack of the old forum block to work with the phpBB2  */
  11. /* port.                                                                */
  12. /*                                                                      */
  13. /* This program is free software. You can redistribute it and/or modify */
  14. /* it under the terms of the GNU General Public License as published by */
  15. /* the Free Software Foundation; either version 2 of the License.       */
  16. /************************************************************************/
  17.  
  18. if (eregi("block-Forums.php", $_SERVER['PHP_SELF'])) {
  19.     Header("Location: index.php");
  20.     die();
  21. }
  22.  
  23. global $prefix, $db, $sitename;
  24.  
  25. $result = $db->sql_query("SELECT forum_id, topic_id, topic_title FROM ".$prefix."_bbtopics ORDER BY topic_time DESC LIMIT 10");
  26. $content = "<br>";
  27. while ($row = $db->sql_fetchrow($result)) {
  28.     $forum_id = intval($row['forum_id']);
  29.     $topic_id = intval($row['topic_id']);
  30.     $topic_title = $row['topic_title'];
  31.     $row2 = $db->sql_fetchrow($db->sql_query("SELECT auth_view, auth_read FROM ".$prefix."_bbforums WHERE forum_id='$forum_id'"));
  32.     $auth_view = intval($row2['auth_view']);
  33.     $auth_read = intval($row2['auth_read']);
  34.     if (($auth_view < 2) OR ($auth_read < 2)) {
  35.         $content .= "<img src=\"images/arrow.gif\" border=\"0\" alt=\"\" title=\"\" width=\"9\" height=\"9\"> <a href=\"modules.php?name=Forums&file=viewtopic&t=$topic_id\">$topic_title</a><br>";
  36.     }
  37. }
  38.  
  39. $content .= "<br><center><a href=\"modules.php?name=Forums\"><b>"._BBFORUMS." $sitename</b></a><br><br></center>";
  40.  
  41. ?>