[ PHPXref.com ] [ Generated: Sun Jul 20 19:38:51 2008 ] [ PHP-Fusion 6.00.305 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/php-files/infusions/shoutbox_panel/ -> shoutbox_panel.php (source)

   1  <?php
   2  /*---------------------------------------------------+

   3  | PHP-Fusion 6 Content Management System

   4  +----------------------------------------------------+

   5  | Copyright  2002 - 2005 Nick Jones

   6  | http://www.php-fusion.co.uk/

   7  +----------------------------------------------------+

   8  | Released under the terms & conditions of v2 of the

   9  | GNU General Public License. For details refer to

  10  | the included gpl.txt file or visit http://gnu.org

  11  +----------------------------------------------------*/
  12  if (!defined("IN_FUSION")) { header("Location:../../index.php"); exit; }
  13  
  14  openside($locale['120']);
  15  if (iMEMBER || $settings['guestposts'] == "1") {
  16      if (isset($_POST['post_shout'])) {
  17          if (iMEMBER) {
  18              $shout_name = $userdata['user_id'];
  19          } elseif ($settings['guestposts'] == "1") {
  20              $shout_name = trim(stripinput($_POST['shout_name']));
  21              $shout_name = preg_replace("(^[0-9]*)", "", $shout_name);
  22              if (isNum($shout_name)) $shout_name="";
  23          }
  24          $shout_message = str_replace("\n", " ", $_POST['shout_message']);
  25          $shout_message = preg_replace("/^(.{255}).*$/", "$1", $shout_message);
  26          $shout_message = preg_replace("/([^\s]{25})/", "$1\n", $shout_message);
  27          $shout_message = trim(stripinput(censorwords($shout_message)));
  28          $shout_message = str_replace("\n", "<br>", $shout_message);
  29          if ($shout_name != "" && $shout_message != "") {
  30              if (dbcount("(*)", "shoutbox", "shout_message='$shout_message' AND shout_datestamp+84600>".time())) {
  31                  redirect("Location: ".FUSION_SELF.(FUSION_QUERY ? "?".FUSION_QUERY : ""));
  32              } else {
  33                  $result = dbquery("INSERT INTO ".$db_prefix."shoutbox (shout_name, shout_message, shout_datestamp, shout_ip) VALUES ('$shout_name', '$shout_message', '".time()."', '".USER_IP."')");
  34              }
  35          }
  36          header("Location: ".FUSION_SELF.(FUSION_QUERY ? "?".FUSION_QUERY : ""));
  37      }
  38      echo "<form name='chatform' method='post' action='".FUSION_SELF.(FUSION_QUERY ? "?".str_replace("&","&amp;",FUSION_QUERY) : "")."'>
  39  <table align='center' cellpadding='0' cellspacing='0'>
  40  <tr>
  41  <td colspan='2'>\n";
  42      if (iGUEST) {
  43          echo $locale['121']."<br>
  44  <input type='text' name='shout_name' value='' class='textbox' maxlength='30' style='width:140px;'><br>
  45  ".$locale['122']."<br>\n";
  46      }
  47      echo "<textarea name='shout_message' rows='4' class='textbox' style='width:140px;'></textarea>
  48  </td>
  49  </tr>
  50  <tr>
  51  <td><input type='submit' name='post_shout' value='".$locale['123']."' class='button'></td>
  52  <td align='right' class='small'><a href='".INFUSIONS."shoutbox_panel/shoutboxhelp.php' class='side'>".$locale['124']."</a></td>
  53  </tr>
  54  </table>
  55  </form>
  56  <br>\n";
  57  } else {
  58      echo "<center>".$locale['125']."</center><br>\n";
  59  }
  60  $result = dbquery("SELECT count(shout_id) FROM ".$db_prefix."shoutbox");
  61  $numrows = dbresult($result, 0);
  62  $result = dbquery(
  63      "SELECT * FROM ".$db_prefix."shoutbox LEFT JOIN ".$db_prefix."users
  64      ON ".$db_prefix."shoutbox.shout_name=".$db_prefix."users.user_id
  65      ORDER BY shout_datestamp DESC LIMIT 0,".$settings['numofshouts']
  66  );
  67  if (dbrows($result) != 0) {
  68      $i = 0;
  69      while ($data = dbarray($result)) {
  70          echo "<span class='shoutboxname'><img src='".THEME."images/bullet.gif' alt=''> ";
  71          if ($data['user_name']) {
  72              echo "<a href='".BASEDIR."profile.php?lookup=".$data['shout_name']."' class='side'>".$data['user_name']."</a>\n";
  73          } else {
  74              echo $data['shout_name']."\n";
  75          }
  76          echo "</span><br>\n<span class='shoutboxdate'>".showdate("shortdate", $data['shout_datestamp'])."</span>";
  77          if (iADMIN && checkrights("S")) {
  78              echo "\n[<a href='".ADMIN."shoutbox.php?action=edit&amp;shout_id=".$data['shout_id']."' class='side'>".$locale['048']."</a>]";
  79          }
  80          echo "<br>\n<span class='shoutbox'>".parsesmileys($data['shout_message'])."</span><br>\n";
  81          if ($i != $numrows) echo "<br>\n";
  82      }
  83      if ($numrows > $settings['numofshouts']) {
  84          echo "<center>\n<img src='".THEME."images/bullet.gif' alt=''>
  85  <a href='".INFUSIONS."shoutbox_panel/shoutbox_archive.php' class='side'>".$locale['126']."</a>
  86  <img src='".THEME."images/bulletb.gif' alt=''></center>\n";
  87      }
  88  } else {
  89      echo "<div align='left'>".$locale['127']."</div>\n";
  90  }
  91  closeside();
  92  ?>


[ Powered by PHPXref - Served by Debian GNU/Linux ]