[ Index ]
 

Code source de PHP NUKE 7.9

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

title

Body

[fermer]

/modules/Journal/ -> add.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      /* Journal 2.0 Enhanced and Debugged 2004                               */

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

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

  35      /************************************************************************/

  36  if ( !defined('MODULE_FILE') )
  37  {
  38      die("You can't access this file directly...");
  39  }
  40      require_once ("mainfile.php");
  41      $module_name = basename(dirname(__FILE__));
  42      get_lang($module_name);
  43      $pagetitle = "- "._USERSJOURNAL."";
  44  include ("header.php");
  45  include("modules/$module_name/functions.php");
  46      include("modules/$module_name/kses.php");
  47      if (is_user($user)) {
  48  cookiedecode($user);
  49  $username = $cookie[1];
  50      }
  51      $user = filter($user, "nohtml");
  52      $username = filter($username, "nohtml");
  53      $sitename = filter($sitename, "nohtml");
  54      if (isset($jbodytext)) { $jbodytext = kses(ADVT_stripslashes($jbodytext), $allowed); }
  55      else { $jbodytext = ""; }
  56      $debug = filter($debug, "nohtml");
  57      if ($debug == "true") :
  58      echo ("UserName:$username<br>SiteName: $sitename");
  59      endif;
  60      startjournal($sitename, $user);
  61  #####################################################

  62  # Check to see if the current user of add.php is a  #

  63  # member of the site. If not, inform them that they #

  64  # must register before posting.                    #

  65  #####################################################

  66  
  67      if (!is_user($user)) :
  68      echo ("<br>");
  69      openTable();
  70      echo ("<div align=center>"._YOUMUSTBEMEMBER."<br></div>");
  71      closeTable();
  72      journalfoot();
  73      die();
  74  endif;
  75  
  76  #####################################################

  77  # Build Journal Entry Form.                    #

  78  # NOTE: The mood list is dynamic!!! To add/edit the #

  79  # list of available moods, just upload or remove    #

  80  # gifs and jpgs from the                 #

  81  # modules/Journal/Images/moods directory.        #

  82  #####################################################

  83      if (is_user($user)) {
  84  echo "<br>";
  85  OpenTable();
  86  echo ("<div align=center class=title>"._ADDJOURNAL."</div><br>");
  87  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>");
  88  CloseTable();
  89  echo "<br>";
  90  OpenTable();
  91  print  ("<form action='modules.php?name=$module_name&file=savenew' method='post'>");
  92  print  ("<table align=center border=0>");
  93  print  ("<tr>");
  94  print  ("<td align=right valign=top><strong>"._TITLE.": </strong></td>");
  95  print  ("<td valign=top><input type=\"text\" value=\"\" size=50 maxlength=80 name=\"title\"></td>");
  96  print  ("</tr>");
  97  print  ("<tr>");
  98  print  ("<td align=right valign=top><strong>"._BODY.": </strong></td>");
  99  print  ("<td valign=top><textarea name=\"jbodytext\" cols=\"70\" rows=\"15\"></textarea><br>"._HTMLNOTALLOWED."<br></td>");
 100  print  ("</tr>");
 101  print  ("<tr>");
 102  print  ("<td align=right valign=top><strong>"._LITTLEGRAPH.": </strong><br>"._OPTIONAL."</td>");
 103  echo "<td valign=top><table cellpadding=3><tr>";
 104  $tempcount = 0;
 105          $tempcount = intval($tempcount);
 106          $direktori = "$jsmiles";
 107          $handle = opendir($direktori);
 108          while ($file = readdir($handle)) {
 109              if (is_file($file) && strtolower(substr($file, -4)) == '.gif' || '.jpg') {
 110                  $filelist[] = $file;
 111              } else {
 112                  OpenTable();
 113                  echo "<center><b>"._ANERROR."</b></center>";
 114                  CloseTable();
 115                  exit;
 116              }
 117  }
 118  asort($filelist);
 119  while (list ($key, $file) = each ($filelist)) {
 120      if (!ereg(".gif|.jpg",$file)) { }
 121      elseif ($file == "." || $file == "..") {
 122          $a=1;
 123      } else {
 124      if ($tempcount == 6):
 125          echo "</tr><tr>";
 126                  echo "<td><input type='radio' name='mood' value='$file'></td><td><img src=\"$jsmiles/$file\" alt=\"$file\" title=\"$file\"></td>";
 127          $tempcount = 0;
 128      else :
 129                  echo "<td><input type='radio' name='mood' value='$file'></td><td><img src=\"$jsmiles/$file\" alt=\"$file\" title=\"$file\"></td>";
 130      endif;
 131      $tempcount = $tempcount + 1;
 132      }
 133  }
 134  echo "</tr></table>";
 135  print  ("</td>");
 136  print  ("</tr>");
 137  print  ("<tr>");
 138  print  ("<tr>");
 139  print  ("<td align=right valign=top><strong>"._PUBLIC.": </strong></td>");
 140  print  ("<td align=left valign=top>");
 141  print  ("<select name='status'>");
 142  print  ("<option value=\"yes\" SELECTED>"._YES."</option>");
 143  print  ("<option value=\"no\">"._NO."</option>");
 144  print  ("</select>");
 145  print  ("</td>");
 146  print  ("</tr>");
 147  print  ("<td colspan=2 align=center><input type='submit' name='submit' value='"._ADDENTRY."'><br><br>"._TYPOS."</td>");
 148  print  ("</tr>");
 149  print  ("</table>");
 150  print  ("</form>");
 151  closeTable();
 152  echo ("<br>");
 153  journalfoot();
 154      } else {
 155          echo ("<br>");
 156          openTable();
 157          echo ("<div align=center>"._YOUMUSTBEMEMBER."<br></div>");
 158          closeTable();
 159          journalfoot();
 160          die();
 161      }
 162  
 163  ?>


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