home *** CD-ROM | disk | FTP | other *** search
/ PC World 2001 March / PCWorld_2001-03_cd.bin / KOMUNIK / progweb / progweb.exe / phpnuke / html / article.php < prev    next >
Encoding:
PHP Script  |  2000-12-05  |  3.8 KB  |  76 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 module is to manage articles/news in the home
  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. if(!isset($sid) && !isset($tid)) { exit(); }
  19.  
  20. if($save) {
  21.     cookiedecode($user);
  22.     mysql_query("update users set umode='$mode', uorder='$order', thold='$thold' where uid='$cookie[0]'");
  23.     getusrinfo($user);
  24.     $info = base64_encode("$userinfo[uid]:$userinfo[uname]:$userinfo[pass]:$userinfo[storynum]:$userinfo[umode]:$userinfo[uorder]:$userinfo[thold]:$userinfo[noscore]");
  25.     setcookie("user","$info",time()+$cookieusrtime);
  26. }
  27.  
  28. if($op == "Reply") Header("Location: comments.php?op=Reply&pid=0&sid=$sid&mode=$mode&order=$order&thold=$thold");
  29. $result = mysql_query("select aid, time, title, hometext, bodytext, topic, informant, notes FROM stories where sid=$sid");
  30. list($aid, $time, $title, $hometext, $bodytext, $topic, $informant, $notes) = mysql_fetch_row($result);
  31. mysql_query("UPDATE stories SET counter=counter+1 where sid=$sid");
  32. $artpage = 1;
  33. include ('header.php');
  34. $artpage = 0;
  35. formatTimestamp($time);
  36. $title = stripslashes($title);
  37. $hometext = stripslashes($hometext);
  38. $bodytext = stripslashes($bodytext);
  39. $notes = stripslashes($notes);
  40.  
  41. if($bodytext == "") { $bodytext = "$hometext<br><br>$notes"; } else { $bodytext = "$hometext<br><br>$notes<br><br>$bodytext"; }
  42. if($informant == "") $informant = $anonymous;
  43.  
  44. getTopics($sid);
  45.  
  46. echo "<table width=100% border=0><tr><td valign=top>";
  47.     themearticle($aid, $informant, $datetime, $title, $bodytext, $topic, $topicname, $topicimage, $topictext);
  48. echo "</td><td> </td><td valign=top width=200>";
  49.     $boxtitle = "".translate("Related Links")."";
  50.     $boxstuff = "";
  51.     $result=mysql_query("select name, url from related where tid=$topic");
  52.     while(list($name, $url) = mysql_fetch_row($result)) {
  53.         $boxstuff .= "<li><a href=$url target=new>$name</a>";
  54.     }
  55.     $boxstuff .= "<li><a href=search.php?topic=$topic>".translate("More about")." $topictext</a>";
  56.     $boxstuff .= "<li><a href=search.php?author=$aid>".translate("News by")." $aid</a>";
  57.     $boxstuff .= "<br><br><hr noshade width=95% size=1><center><b>".translate("Most read story about")." $topictext:</b><br>";
  58.     $result2=mysql_query("select sid, title from stories where topic=$topic order by counter desc limit 0,1");
  59.     list($topstory, $ttitle) = mysql_fetch_row($result2);
  60.     $boxstuff .= "<a href=article.php?sid=$topstory>$ttitle</a></center><br><br>";
  61.     $boxstuff .= "<center><b>".translate("Last news about")." $topictext:</b><br>";
  62.     $boxstuff .= "<img name=\"placeholder\" src=images/pix.gif border=0 width=180 height=42 vspace=2></center><br><br>";
  63.     $boxstuff .= "<table border=0 width=100%><tr><td align=left>";
  64.     if ($anonpost==1 OR $admin OR $user) {
  65.     $boxstuff .= "<a href=\"comments.php?op=Reply&pid=0&sid=$sid\"><img src=$uimages/comment.gif border=0></a>";
  66.     }
  67.     $boxstuff .= "</td><td align=right>";
  68.     $boxstuff .= "<a href=print.php?sid=$sid><img src=images/print.gif border=0 Alt=\"".translate("Printer Friendly Page")." width=15 height=11\"></a>  ";
  69.     $boxstuff .= "<a href=friend.php?op=FriendSend&sid=$sid><img src=images/friend.gif border=0 Alt=\"".translate("Send this Story to a Friend")." width=15 height=11\"></a>";
  70.     $boxstuff .= "</td></tr></table>";
  71.     themesidebox($boxtitle, $boxstuff);
  72. echo "</td></tr></table>";
  73. cookiedecode($user);
  74. if($mode != "nocomments") include('comments.php');
  75. include ('footer.php');
  76. ?>