home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 May / INTERNET103.ISO / pc / software / windows / building / php_nuke / html / blocks / block-forums.php < prev    next >
Encoding:
PHP Script  |  2002-09-16  |  3.0 KB  |  65 lines

  1. <?php
  2.  
  3. ######################################################################
  4. # Modulo Splatt Forum per PHP-NUKE ver.5.6
  5. #-------------------------
  6. # BLOCCO FORUM
  7. #-------------------------
  8. # Versione: 3.2
  9. #
  10. # Copyright (c) 2002 by:
  11. #
  12. # Giorgio Ciranni (~Splatt~)
  13. # (http://www.splatt.it)
  14. # (webmaster@splatt.it)
  15. #
  16. # Supporto tecnico disponibile sul Forum di www.splatt.it 
  17. ######################################################################
  18. # Splatt Forum is free software. You can redistribute it and/or modify
  19. # it under the terms of the GNU General Public License as published by
  20. # the Free Software Foundation; either version 2 of the License.
  21. # Splatt Forum is distributed in the hope that it will be useful,
  22. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  23. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  24. # GNU General Public License for more details.
  25. #
  26. # You should have received a copy of the GNU General Public License
  27. # along with this program; if not, write to the Free Software
  28. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA   
  29. # 02111-1307  USA
  30. ######################################################################
  31.  
  32.  
  33. if (eregi("block-Forums.php",$PHP_SELF)) {
  34.     Header("Location: index.php");
  35.     die();
  36. }
  37.  
  38. require_once("mainfile.php");
  39. get_lang(Forums);  
  40.  
  41. global $prefix, $dbi;
  42.  
  43. $result = sql_query("SELECT t1.topic_id,t1.topic_title,t1.topic_time,t1.forum_id  FROM ${prefix}_forums t0,${prefix}_forumtopics t1 WHERE t0.forum_type=0  AND t0.forum_id=t1.forum_id ORDER BY t1.topic_time DESC LIMIT 0, 10", $dbi);
  44. while(list($topic_id, $topic_title, $topic_time, $forum_id) = sql_fetch_row($result, $dbi)) {
  45.     $res = sql_query("select image from ".$prefix."_posts where topic_id='$topic_id'", $dbi);
  46.     list ($image) = sql_fetch_row($res, $dbi);
  47.     if($image == "") {
  48.     $image= "icon33.gif";
  49.     }
  50.     $title2 = ereg_replace("_", " ", $topic_title);
  51.     $title2 = stripslashes($title2);
  52.     $title3 = substr("$title2", 0,18);
  53.     $content1 .= "<table><tr><td width=\"25\"><img src=\"images/forum/subject/$image\" alt=\"$title2 - $topic_time\"></td><td><a href=\"modules.php?name=Forums&file=viewtopic&topic=$topic_id&forum=$forum_id \"> $title3...</a></td></tr>";
  54. }
  55.  
  56. $content = "<center><form action=\"modules.php?name=Forums&file=searchbb\" method=\"post\">";
  57. $content .= "<input type=\"hidden\" name=\"addterm\" value=\"any\">";
  58. $content .= "<input type=\"hidden\" name=\"sortby\" value=\"p.post_time\">";
  59. $content .= "<table width=\"95%\"><tr><td class=\"headgreyline\" align=\"center\"><b>"._FCERCF."</b><br> <input type=\"text\" name=\"term\" class=\"formbut\" size=\"15\">";
  60. $content .= "<input type=\"hidden\" name=\"submit\" value=\"submit\"><br>[ <a href=\"modules.php?name=Forums&file=index\"><i>"._FINDEX."</i></a> ]</form>";
  61. $content .= "</td></tr></table>";
  62. $content .= "<i>"._FULTM."</i></center><br>$content1</table><br><center><hr width=\"50%\"><a href=\"http://www.splatt.it\" target=\"_blank\">Powered by:<br>Splatt Forum v3.2!</a></center>";
  63.  
  64. ?>
  65.