home *** CD-ROM | disk | FTP | other *** search
/ PC World 2005 April / PCWorld_2005-04_cd.bin / akce / web / unitednuke / unitednuke.exe / html / modules / Journal / display.php < prev    next >
Encoding:
PHP Script  |  2004-01-10  |  7.8 KB  |  147 lines

  1. <?php
  2.  
  3. /************************************************************************/
  4. /* Journal § ZX                                                     */
  5. /* ================                                                     */
  6. /*                                                                      */
  7. /* Original work done by Joseph Howard known as Member's Journal, which */
  8. /* was based on Trevor Scott's vision of Atomic Journal.                */
  9. /*                                                                      */
  10. /* Modified on 25 May 2002 by Paul Laudanski (paul@computercops.biz)    */
  11. /* Copyright (c) 2002 Modifications by Computer Cops.                   */
  12. /* http://computercops.biz                                              */
  13. /*                                                                      */
  14. /* Member's Journal did not work on a PHPNuke 5.5 portal which had      */
  15. /* phpbb2 port integrated.  Thus was Journal § ZX created with the  */
  16. /* Member's Journal author's blessings.                                 */
  17. /*                                                                      */
  18. /* To install, backup everything first and then FTP the Journal package */
  19. /* files into your site's module directory.  Also run the tables.sql    */
  20. /* script so the proper tables and fields can be created and used.  The */
  21. /* default table prefix is "nuke" which is hard-coded throughout the    */
  22. /* entire system as a left-over from Member's Journal.  If a demand     */
  23. /* exists, that can be changed for a future release.                    */
  24. /*                                                                      */
  25. /* This program is free software. You can redistribute it and/or modify */
  26. /* it under the terms of the GNU General Public License as published by */
  27. /* the Free Software Foundation; either version 2 of the License.       */
  28. /************************************************************************/
  29.  
  30. if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
  31.     die ("You can't access this file directly...");
  32. }
  33.  
  34. require_once("mainfile.php");
  35. $module_name = basename(dirname(__FILE__));
  36. get_lang($module_name);
  37.  
  38. $pagetitle = "- "._USERSJOURNAL."";
  39. include("header.php");
  40. include("modules/$module_name/functions.php");
  41.  
  42. cookiedecode($user);
  43. $username = $cookie[1];
  44.  
  45. if ($debug == "true") :
  46.     echo ("UserName:$username<br>SiteName: $sitename");
  47. endif;
  48.  
  49. startjournal($sitename,$user);
  50. $jid = intval($jid);
  51. if ($jid == "") :
  52.     opentable();
  53.     echo ("<div align=\"center\">"._ANERROR."</div>");
  54.     closetable();
  55.     echo ("<br><br>");
  56.     journalfoot();
  57. endif;
  58.  
  59. $sql = "SELECT j.jid, j.aid, j.title, j.pdate, j.ptime, j.mdate, j.mtime, j.bodytext, j.status, j.mood, u.user_id, u.username FROM ".$prefix."_journal j, ".$user_prefix."_users u WHERE u.username=j.aid and j.jid = '$jid'";
  60. $result = $db->sql_query($sql);
  61.  
  62. while ($row = $db->sql_fetchrow($result)) {
  63.     $owner = $row[aid];
  64.     if (($row[status] == 'no') && ($row[aid] != $username)):
  65.     OpenTable();
  66.     echo "<center><br>"._ISPRIVATE."<br></center>";
  67.     CloseTable();
  68.     journalfoot();
  69.     endif;
  70.     echo "<br>";
  71.     OpenTable();
  72.     printf ("<div class=title align=center>%s</div>", $row[title]);
  73. //The Following line had an incorrect uname entry.//
  74.     printf ("<div align=center>"._BY.": <a href=\"modules.php?name=Your_Account&op=userinfo&username=$row[username]\">%s</a></div>", $row[aid], $row[aid]);
  75.     printf ("<div align=center class=tiny>"._POSTEDON.": %s @ %s</div>", $row[pdate], $row[ptime]);
  76.     CloseTable();
  77.     echo "<br>";
  78.     openTable();
  79.     $row[bodytext]=check_html($row[bodytext], $strip);
  80.     printf ("%s", $row[bodytext]);
  81.     if ($row[mood] != ""):
  82.         printf ("<br><div align=center><img src=\"modules/$module_name/images/moods/%s\" alt=\"%s\" title=\"%s\"></div>", $row[mood], $row[mood], $row[mood]);
  83.     endif;
  84.     printf ("<br><br><div class=tiny align=center>"._LASTUPDATED." %s @ %s</div><br>", $row[mdate], $row[mtime]);
  85.     printf ("<div class=tiny align=center>[ <a href=\"modules.php?name=$module_name&file=friend&jid=%s\">"._SENDJFRIEND."</a> ]</div>", $row[jid]);
  86.     closeTable();
  87.     print  ("<br>");
  88.     openTable();
  89.     print  ("<table width=\"100%\" align=\"center\"><tr>");
  90.     if ($row[aid] == $username):
  91.     echo "<td align=\"center\" width=\"15%\"><a href=\"modules.php?name=$module_name&file=modify&jid=$jid\"><img src=\"modules/$module_name/images/edit.gif\" border=0 alt=\""._EDIT."\" title=\""._EDIT."\"><br>"._EDIT."</a></td>";
  92.     echo "<td align=\"center\" width=\"15%\"><a href=\"modules.php?name=$module_name&file=delete&jid=$jid&forwhat=$jid\"><img src=\"modules/$module_name/images/trash.gif\" border=0 alt=\""._DELETE."\" title=\""._DELETE."\"><br>"._DELETE."</a></td>";
  93.     endif;
  94.     if ($username != ""):
  95.     echo "<td align=\"center\" width=\"15%\"><a href=\"modules.php?name=$module_name&file=comment&onwhat=$jid\"><img src=\"modules/$module_name/images/write.gif\" border=0 alt=\""._WRITECOMMENT."\" title=\""._WRITECOMMENT."\"><br>"._WRITECOMMENT."</a></td>";
  96.     endif;
  97.     echo "<td align=\"center\" width=\"15%\"><a href=\"modules.php?name=$module_name&file=search&bywhat=aid&forwhat=$row[aid]\"><img src=\"modules/$module_name/images/binocs.gif\" border=0 alt=\""._VIEWMORE."\" title=\""._VIEWMORE."\"><br>"._VIEWMORE."</a></td>";
  98. //The following line had an incorrect uname entry.//
  99.     echo "<td align=\"center\" width=\"15%\"><a href=\"modules.php?name=Your_Account&op=userinfo&username=$row[username]\"><img src=\"modules/$module_name/images/nuke.gif\" border=0 alt=\""._USERPROFILE."\" title=\""._USERPROFILE."\"><br>"._USERPROFILE."</a></td>";
  100.     if ($username != "" AND is_active("Private_Messages")):
  101. //the following line had a uname entry and a reference to reply.php which doesn't exist.//
  102.     echo "<td align=\"center\" width=\"15%\"><a href=\"modules.php?name=Private_Messages&mode=post&u=$row[user_id]\"><img src=\"modules/$module_name/images/chat.gif\" border=0 alt=\""._SENDMESSAGE."\" title=\""._SENDMESSAGE."\"><br>"._SENDMESSAGE."</a></td>";
  103.     endif;
  104.     if ($username == ""):
  105.     echo "<td align=\"center\" width=\"15%\"><a href=\"modules.php?name=Your_Account\"><img src=\"modules/$module_name/images/folder.gif\" border=0 alt=\"Create an account\" title=\"Create an account\"><br>"._CREATEACCOUNT."</a></td>";
  106.     endif;
  107.     print  ("</tr></table>");
  108.     closeTable();
  109. }
  110.  
  111. $commentheader = "no";
  112. //The following line had an incorrect u.uid entry.//
  113. $sql = "SELECT j.cid, j.rid, j.aid, j.comment, j.pdate, j.ptime, u.user_id FROM ".$prefix."_journal_comments j, ".$user_prefix."_users u WHERE j.aid=u.username and j.rid = '$jid'";
  114. $result = $db->sql_query($sql);
  115.  
  116. while ($row = $db->sql_fetchrow($result)) {
  117.     if ($row == 0):
  118.         $commentheader = "yes";
  119.     else:
  120.     if ($commentheader == "no"):
  121.         echo "<br>";
  122.         if ($username == "" OR $username == $anonymous) {
  123.         $ann_co = "<br><div align=center class=tiny>"._REGUSERSCOMM."</div>";
  124.         } else {
  125.         $ann_co = "";
  126.         }
  127.         title("Posted Comments$ann_co");
  128.         $commentheader = "yes";
  129.     elseif ($commentheader = "yes"):
  130.         // Do not print comment header.
  131.     endif;
  132.     endif;
  133.     openTable();
  134. //The following line had an incorrect uname entry.//
  135.     printf (""._COMMENTBY.": <a href=\"modules.php?name=Your_Account&op=userinfo&username=$row[username]\">%s</a> <div class=tiny>("._POSTEDON." $row[pdate] @ $row[ptime])</div><br>", $row[aid], $row[aid], $row[pdate], $row[ptime]);
  136.     $row[comment]=check_html($row[comment], $strip);        
  137.     printf ("<strong>Comment:</strong> %s", $row[comment]);
  138.     if ($username == $owner):
  139.     printf ("<br><div align=center>[ <a href=\"modules.php?name=$module_name&file=commentkill&onwhat=%s&ref=$jid\">"._DELCOMMENT."</a> ]</div>", $row[cid], $row[jid]);
  140.     endif;
  141.     closeTable();
  142.     print  ("<br><br>");
  143. }
  144.  
  145. journalfoot();
  146.  
  147. ?>