[ Index ]
 

Code source de PHP NUKE 7.9

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/modules/Journal/ -> modify.php (source)

   1  <?php
   2  
   3  /************************************************************************/

   4  /* Journal &#167 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  /* Required: PHPNuke 5.5 ( http://www.phpnuke.org/ ) and phpbb2         */

  15  /* ( http://bbtonuke.sourceforge.net/ ) forums port.                    */

  16  /*                                                                      */

  17  /* Member's Journal did not work on a PHPNuke 5.5 portal which had      */

  18  /* phpbb2 port integrated.  Thus was Journal &#167 ZX created with the  */

  19  /* Member's Journal author's blessings.                                 */

  20  /*                                                                      */

  21  /* To install, backup everything first and then FTP the Journal package */

  22  /* files into your site's module directory.  Also run the tables.sql    */

  23  /* script so the proper tables and fields can be created and used.  The */

  24  /* default table prefix is "nuke" which is hard-coded throughout the    */

  25  /* entire system as a left-over from Member's Journal.  If a demand     */

  26  /* exists, that can be changed for a future release.                    */

  27  /*                                                                      */

  28  /* This program is free software. You can redistribute it and/or modify */

  29  /* it under the terms of the GNU General Public License as published by */

  30  /* the Free Software Foundation; either version 2 of the License.       */

  31  /************************************************************************/

  32  /* Additional security checking code 2003 by chatserv                   */

  33  /* http://www.nukefixes.com -- http://www.nukeresources.com             */

  34  /************************************************************************/

  35      /* Journal 2.0 Enhanced and Debugged 2004                               */

  36      /* by sixonetonoffun -- http://www.netflake.com --                      */

  37      /* Images Created by GanjaUK -- http://www.GanjaUK.com                  */

  38      /************************************************************************/

  39  if ( !defined('MODULE_FILE') )
  40  {
  41      die("You can't access this file directly...");
  42  }
  43      require_once ("mainfile.php");
  44      $module_name = basename(dirname(__FILE__));
  45      get_lang($module_name);
  46      include("modules/$module_name/functions.php");
  47      include("modules/$module_name/kses.php");
  48      if (!isset($jid) OR !is_numeric($jid)) { die("No journal specified."); }
  49      $pagetitle = "- "._USERSJOURNAL."";
  50      include ("header.php");
  51      if (is_user($user)) {
  52          cookiedecode($user);
  53          $username = $cookie[1];
  54          $user = filter($user, "nohtml");
  55          $username = filter($username, "nohtml");
  56          $sitename = filter($sitename, "nohtml");
  57          $jid = intval($jid);
  58          if ($debug == "true") :
  59          echo ("UserName:$username<br>SiteName: $sitename<br>JID: $jid");
  60          endif;
  61          startjournal($sitename, $user);
  62          echo "<br>";
  63          OpenTable();
  64          echo ("<div align=center class=title>"._EDITJOURNAL."</div><br>");
  65          echo ("<div align=center> [ <a href=\"modules.php?name=$module_name&file=add\">"._ADDENTRY."</a> | <a href=\"modules.php?name=$module_name&file=edit&op=last\">"._YOURLAST20."</a> | <a href=\"modules.php?name=$module_name&file=edit&op=all\">"._LISTALLENTRIES."</a> ]</div>");
  66          CloseTable();
  67          echo "<br>";
  68          OpenTable();
  69          $jid = intval($jid);
  70  $sql = "SELECT * FROM ".$prefix."_journal WHERE jid = '$jid'";
  71          $result = $db->sql_query($sql);
  72          while ($row = $db->sql_fetchrow($result)) {
  73              $jaid = filter($row['aid'], "nohtml");
  74              if (!is_admin($admin)):
  75              if ($username != $jaid):
  76                  echo ("<br>");
  77              OpenTable();
  78              echo ("<div align=center>"._NOTYOURS2."</div>");
  79              CloseTable();
  80              CloseTable();
  81              journalfoot();
  82              include ("footer.php");
  83              die();
  84              endif;
  85              endif;
  86              $jid = intval($jid);
  87              $jtitle = filter($row['title'], "nohtml");
  88              $jbodytext = $row['bodytext'];
  89              $jbodytext = kses(ADVT_stripslashes($jbodytext), $allowed);
  90              $jmood = filter($row['mood'], "nohtml");
  91              print ("<form action='modules.php?name=$module_name&file=edit' method='post'>");
  92              print ("<input type='hidden' name='edit' value='1'>");
  93              print ("<input type='hidden' name='jid' value='$jid'>");
  94              print ("<table align=center border=0>");
  95              print ("<tr>");
  96              print ("<td align=right valign=top><strong>"._TITLE.": </strong></td>");
  97              printf ("<td valign=top><input type='text' value='%s' size=50 maxlength=80 name='title'></td>", $jtitle);
  98              print ("</tr>");
  99              print ("<tr>");
 100              print ("<td align=right valign=top><strong>"._BODY.": </strong></td>");
 101              printf ("<td valign=top><textarea name='jbodytext' cols=\"70\" rows=\"15\">%s</textarea><br>"._HTMLNOTALLOWED."<br></td>", $jbodytext);
 102              print ("</tr>");
 103              print ("<tr>");
 104              print ("<td align=right valign=top><strong>"._LITTLEGRAPH.": </strong><br>"._OPTIONAL."</td>");
 105              echo "<td valign=top><table cellpadding=3><tr>";
 106              $tempcount = 0;
 107              $tempcount = intval($tempcount);
 108              $checked = "";
 109              $direktori = "$jsmiles";
 110              $handle = opendir($direktori);
 111              while ($file = readdir($handle)) {
 112                  if (is_file($file) && strtolower(substr($file, -4)) == '.gif' || '.jpg') {
 113                      $filelist[] = $file;
 114                  } else {
 115                      OpenTable();
 116                      echo "<center><b>"._ANERROR."</b></center>";
 117                      CloseTable();
 118                      include ("footer.php");
 119                      exit;
 120                  }
 121              }
 122              closedir($handle);
 123              asort($filelist);
 124              while (list ($key, $file) = each ($filelist)) {
 125                  if (!ereg(".gif|.jpg",$file)) { }
 126                  elseif ($file == "." || $file == "..") {
 127                      $a = 1;
 128                  } else {
 129                      if ($file == $jmood) {
 130                          $checked = "checked";
 131                      } else {
 132                          $checked = "";
 133                      }
 134                      if ($tempcount == 6):
 135                          echo "</tr><tr>";
 136                      echo "<td><input type='radio' name='mood' value='$file' $checked></td><td><img src=\"$jsmiles/$file\" alt=\"$file\" title=\"$file\"></td>";
 137                      $tempcount = 0;
 138                      else :
 139                      echo "<td><input type='radio' name='mood' value='$file' $checked></td><td><img src=\"$jsmiles/$file\" alt=\"$file\" title=\"$file\"></td>";
 140                      endif;
 141                      $tempcount = $tempcount + 1;
 142                  }
 143              }
 144              echo "</tr></table>";
 145              print ("</td>");
 146              print ("</tr>");
 147              print ("<tr>");
 148              print ("<td align=right valign=top><strong>"._PUBLIC.": </strong></td>");
 149              print ("<td align=left valign=top>");
 150              print ("<select name='status'>");
 151              $jstatus = filter($row['status'], "nohtml");
 152              if ($jstatus == 'yes'):
 153                  print ("<option value=\"yes\" SELECTED>"._YES."</option>");
 154              else :
 155              print ("<option value=\"yes\">"._YES."</option>");
 156              endif;
 157              if ($jstatus == 'no'):
 158                  print ("<option value=\"no\" SELECTED>"._NO."</option>");
 159              else :
 160              print ("<option value=\"no\">"._NO."</option>");
 161              endif;
 162              print ("</select>");
 163              print ("</td>");
 164              print ("</tr>");
 165              print ("<td colspan=2 align=center><input type='submit' name='submit' value='"._MODIFYENTRY."'><br><br>"._TYPOS."</td>");
 166              print ("</tr>");
 167              print ("</table>");
 168              print ("</form>");
 169          }
 170          CloseTable();
 171          journalfoot();
 172      }
 173      if (is_admin($admin)) {
 174          cookiedecode($user);
 175          $username = $cookie[1];
 176          $user = filter($user, "nohtml");
 177          $username = filter($username, "nohtml");
 178          $sitename = filter($sitename, "nohtml");
 179          $jid = intval($jid);
 180          if ($debug == "true") :
 181          echo ("UserName:$username<br>SiteName: $sitename<br>JID: $jid");
 182          endif;
 183          startjournal($sitename, $user);
 184          echo "<br>";
 185          OpenTable();
 186          echo ("<div align=center class=title>"._EDITJOURNAL."</div><br>");
 187          echo ("<div align=center> [ <a href=\"modules.php?name=$module_name&file=add\">"._ADDENTRY."</a> | <a href=\"modules.php?name=$module_name&file=edit&op=last\">"._YOURLAST20."</a> | <a href=\"modules.php?name=$module_name&file=edit&op=all\">"._LISTALLENTRIES."</a> ]</div>");
 188          CloseTable();
 189          echo "<br>";
 190          OpenTable();
 191          $jid = intval($jid);
 192          $sql = "SELECT * FROM ".$prefix."_journal WHERE jid = '$jid'";
 193          $result = $db->sql_query($sql);
 194          while ($row = $db->sql_fetchrow($result)) {
 195              $jaid = filter($row['aid'], "nohtml");
 196              $jid = intval($jid);
 197              $jtitle = filter($row['title'], "nohtml");
 198              $jbodytext = $row['bodytext'];
 199              $jbodytext = kses(ADVT_stripslashes($jbodytext), $allowed);
 200              $jmood = filter($row['mood'], "nohtml");
 201              print ("<form action='modules.php?name=$module_name&file=edit' method='post'>");
 202              print ("<input type='hidden' name='edit' value='1'>");
 203              print ("<input type='hidden' name='jid' value='$jid'>");
 204              print ("<table align=center border=0>");
 205              print ("<tr>");
 206              print ("<td align=right valign=top><strong>"._TITLE.": </strong></td>");
 207              printf ("<td valign=top><input type='text' value='%s' size=50 maxlength=80 name='title'></td>", $jtitle);
 208              print ("</tr>");
 209              print ("<tr>");
 210              print ("<td align=right valign=top><strong>"._BODY.": </strong></td>");
 211              printf ("<td valign=top><textarea name='jbodytext' cols=\"70\" rows=\"15\">%s</textarea><br>"._HTMLNOTALLOWED."<br></td>", $jbodytext);
 212              print ("</tr>");
 213              print ("<tr>");
 214              print ("<td align=right valign=top><strong>"._LITTLEGRAPH.": </strong><br>"._OPTIONAL."</td>");
 215              echo "<td valign=top><table cellpadding=3><tr>";
 216              $tempcount = 0;
 217              $tempcount = intval($tempcount);
 218              $checked = "";
 219              $direktori = "$jsmiles";
 220              $handle = opendir($direktori);
 221              while ($file = readdir($handle)) {
 222                  if (is_file($file) && strtolower(substr($file, -4)) == '.gif' || '.jpg') {
 223                      $filelist[] = $file;
 224                  } else {
 225                      include ("header.php");
 226                      OpenTable();
 227                      echo "<center><b>"._ANERROR."</b></center>";
 228                      CloseTable();
 229                      include ("footer.php");
 230                      exit;
 231                  }
 232              }
 233              closedir($handle);
 234              asort($filelist);
 235              while (list ($key, $file) = each ($filelist)) {
 236                  if (!ereg(".gif|.jpg",$file)) { }
 237                  elseif ($file == "." || $file == "..") {
 238                      $a = 1;
 239                  } else {
 240                      if ($file == $jmood) {
 241                          $checked = "checked";
 242                      } else {
 243                          $checked = "";
 244                      }
 245                      if ($tempcount == 6):
 246                          echo "</tr><tr>";
 247                      echo "<td><input type='radio' name='mood' value='$file' $checked></td><td><img src=\"$jsmiles/$file\" alt=\"$file\" title=\"$file\"></td>";
 248                      $tempcount = 0;
 249                      else :
 250                      echo "<td><input type='radio' name='mood' value='$file' $checked></td><td><img src=\"$jsmiles/$file\" alt=\"$file\" title=\"$file\"></td>";
 251                      endif;
 252                      $tempcount = $tempcount + 1;
 253                  }
 254              }
 255              echo "</tr></table>";
 256              print ("</td>");
 257              print ("</tr>");
 258              print ("<tr>");
 259              print ("<td align=right valign=top><strong>"._PUBLIC.": </strong></td>");
 260              print ("<td align=left valign=top>");
 261              print ("<select name='status'>");
 262              $jstatus = filter($row['status'], "nohtml");
 263              if ($jstatus == 'yes'):
 264                  print ("<option value=\"yes\" SELECTED>"._YES."</option>");
 265              else :
 266              print ("<option value=\"yes\">"._YES."</option>");
 267              endif;
 268              if ($jstatus == 'no'):
 269                  print ("<option value=\"no\" SELECTED>"._NO."</option>");
 270              else :
 271              print ("<option value=\"no\">"._NO."</option>");
 272              endif;
 273              print ("</select>");
 274              print ("</td>");
 275              print ("</tr>");
 276              print ("<td colspan=2 align=center><input type='submit' name='submit' value='"._MODIFYENTRY."'><br><br>"._TYPOS."</td>");
 277              print ("</tr>");
 278              print ("</table>");
 279              print ("</form>");
 280          }
 281          CloseTable();
 282          journalfoot();
 283      }
 284      $pagetitle = "- "._YOUMUSTBEMEMBER."";
 285      $pagetitle = filter($pagetitle, "nohtml");
 286      OpenTable();
 287      echo "<center><b>"._YOUMUSTBEMEMBER."</b></center>";
 288      CloseTable();
 289      include ("footer.php");
 290      die();
 291  
 292  ?>


Généré le : Sun Apr 1 11:11:59 2007 par Balluche grâce à PHPXref 0.7