Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Gintulio Klausimai/Prašymai

Parašė gintulys· 2009 Lap. 24 17:11:16
#41

Reikia sutvarkyt iš tokio:


Į tokį:


Panėlės kodas:

<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------+
| Shoutbox 5.00 - Modded by Shedrock/Xandra 2007
+----------------------------------------------------*/
if (!defined("IN_FUSION")) { header("Location: ../../index.php"); exit; }

if (file_exists(INFUSIONS."shoutbox_panel/locale/".$settings['locale'].".php")) {
   include INFUSIONS."shoutbox_panel/locale/".$settings['locale'].".php";
} else { include INFUSIONS."shoutbox_panel/locale/English.php"; }

require_once INFUSIONS."shoutbox_panel/parser.php";
require_once INFUSIONS."shoutbox_panel/functions.php";

/*******************************************************************
* Set minimum and maximum shouts you want displayed on each level
* and color of the boxover tips used for user info.
*******************************************************************/

$min = 6;   // minimum visible shouts in first level.
$max = 1;   // maximum number of shouts in second level (hidden).
$textcolor = "#244A60";   // sets miscellaneous text in the boxover tips.

/******************************************************************/

echo "<script type='text/javascript'>
<!--
var basedir = '".BASEDIR."';
var fusion_self = '".FUSION_SELF."';
var aid = '".(iADMIN ? substr($aidlink, 5) : "")."';
var admin = '".ADMIN."shoutbox.php';
var pageURL = '".INFUSIONS."shoutbox_panel/post.php';
var altSubmit = '".FUSION_SELF.(FUSION_QUERY ? "?".FUSION_QUERY : "")."';
var waitText = '<div align=\"center\" style=\"padding-top: 81px; padding-bottom: 81px; font-weight: bold;\">".$locale['fb_044']." <img src=\"".INFUSIONS."shoutbox_panel/images/loading.gif\" width=\"16\" height=\"16\" alt=\"".$locale['fb_044']."\"></ div>';
setTimeout(\"shoutbox_refresh()\", 1000);
//-->
</script>
<script type='text/javascript' src='".INFUSIONS."shoutbox_panel/functions.js'></script>";

$sb_action = isset($sb_action) ? stripinput($sb_action) : "";

switch($sb_action) {

   case "delete":
      if (isNum($shout_id) && checkrights("S") && $aid == iAUTH) {
         $result = dbquery("DELETE FROM ".$db_prefix."shoutbox WHERE shout_id='$shout_id'");
      }
      break;

   case "ban":
      $aid = stripinput($aid);
      $user_id = isNum($uid) ? $uid : 0;
      if (!empty($user_id) && $user_id != 1 && checkrights("S") && $aid == iAUTH) {
         $result = dbquery("UPDATE ".$db_prefix."users SET user_status='1'
            WHERE user_id='$user_id' AND user_id!='".$userdata['user_id']."' AND user_level!='103'"
         );
      }
      break;

   case "unban":
      $aid = stripinput($aid);
      $user_id = isNum($uid) ? $uid : 0;
      if (!empty($user_id) && $user_id != 1 && checkrights("S") && $aid == iAUTH) {
         $result = dbquery("UPDATE ".$db_prefix."users SET user_status='0' WHERE user_id='$user_id'");
      }
      break;
}

openside($locale['120']);

if (iMEMBER || $settings['guestposts'] == "1") {
   if (isset($_POST['shout_message'])) {
      $flood = false;
      if (iMEMBER) { $shout_name = $userdata['user_id']; }
      elseif ($settings['guestposts'] == "1") {
         $shout_name = trim(stripinput($_POST['shout_name']));
         $shout_name = preg_replace("(^[0-9]*)", "", $shout_name);
         if (isNum($shout_name)) { $shout_name = ""; }
      }
      $shout_message = str_replace("\n", " ", $_POST['shout_message']);
      $shout_message = preg_replace("/^(.{200}).*$/", "$1", $shout_message);
      $shout_message = preg_replace("/([^\s]{45})/", "$1\n", $shout_message);
      $shout_message = trim(stripinput(censorwords($shout_message)));
      $shout_message = str_replace("\n", "<br>", $shout_message);

      // Added by Yuras. Scan for links in the shout. If there is, replace it with [URL]

      $i = 0; $ShoutNew = "";
      $ShoutArray = explode(" ",$shout_message);
      foreach($ShoutArray as $ShoutPart) {
         $ShoutPart =    str_replace("<br>", "", $ShoutPart);
         if (eregi("http:\/\/", $ShoutPart)) {
            // fix for users adding text to the beginning of links: HACKhttp://www.website.com
            $ShoutPartL = strtolower($ShoutPart);
            $spot = strpos($ShoutPartL,"http://");
            if ($spot > 0) { $ShoutPart = substr($ShoutPart, $spot); }
            $ShoutNew[$i] = "&#91;<a target='_blank' href='$ShoutPart'><b>Nuoroda!</b></a>&#93;";
         } elseif (eregi("ftp:\/\/", $ShoutPart)) {
            $ShoutPartL = strtolower($ShoutPart);
            $spot = strpos($ShoutPartL,"ftp://");
            if ($spot > 0) { $ShoutPart = substr($ShoutPart, $spot); }
            $ShoutNew[$i] = "&#91;<a target='_blank' href='$ShoutPart'>FTP</a>&#93;";
         } elseif (eregi("irc:\/\/", $ShoutPart)) {
            $ShoutPartL = strtolower($ShoutPart);
            $spot = strpos($ShoutPartL,"irc://");
            if ($spot > 0) { $ShoutPart = substr($ShoutPart, $spot); }
            $ShoutNew[$i] = "&#91;<a href='$ShoutPart'>IRC</a>&#93;";
         } elseif (eregi("teamspeak:\/\/", $ShoutPart)) {
            $ShoutPartL = strtolower($ShoutPart);
            $spot = strpos($ShoutPartL,"teamspeak://");
            if ($spot > 0) { $ShoutPart = substr($ShoutPart, $spot); }
            $ShoutNew[$i] = "&#91;<a href='$ShoutPart'>TeamSpeak</a>&#93;";
         } elseif (eregi("aim:goim", $ShoutPart)) {
            $ShoutPartL = strtolower($ShoutPart);
            $spot = strpos($ShoutPartL,"aim:goim");
            if ($spot > 0) { $ShoutPart = substr($ShoutPart, $spot); }
            $ShoutNew[$i] = "&#91;<a href='$ShoutPart'>AIM</a>&#93;";
         } elseif (eregi("gopher:\/\/", $ShoutPart)) {
            $ShoutPartL = strtolower($ShoutPart);
            $spot = strpos($ShoutPartL,"gopher://");
            if ($spot > 0) { $ShoutPart = substr($ShoutPart, $spot); }
            $ShoutNew[$i] = "&#91;<a href='$ShoutPart'>Gopher</a>&#93;";
         } elseif (eregi("mailto:", $ShoutPart)) {
            $ShoutPartL = strtolower($ShoutPart);
            $spot = strpos($ShoutPartL,"mailto:");
            if ($spot > 0) { $ShoutPart = substr($ShoutPart, $spot); }
            $ShoutNew[$i] = "&#91;<a href='$ShoutPart'>E-Mail</a>&#93;";
         } elseif (eregi("www\.", $ShoutPart)) {
            $ShoutPartL = strtolower($ShoutPart);
            $spot = strpos($ShoutPartL,"www.");
            if ($spot > 0) { $ShoutPart = substr($ShoutPart, $spot); }
            $ShoutPart = "http://" . $ShoutPart;
            $ShoutNew[$i] = "&#91;<a target='_blank' href='$ShoutPart'>Nuoroda</a>&#93;";
         } elseif ((eregi("\.com", $ShoutPart)) OR (eregi("\.net", $ShoutPart)) OR (eregi("\.org", $ShoutPart)) OR (eregi("\.mil", $ShoutPart)) OR (eregi("\.gov", $ShoutPart)) OR (eregi("\.info", $ShoutPart)) OR (eregi("\.us", $ShoutPart)) OR (eregi("\.biz", $ShoutPart)) OR (eregi("\.tv", $ShoutPart)) OR (eregi("\.cc", $ShoutPart)) OR (eregi("\.ws", $ShoutPart)) OR (eregi("\.name", $ShoutPart)) OR (eregi("\.pro", $ShoutPart)) OR (eregi("\.co\.uk", $ShoutPart)) OR (eregi("\.ca", $ShoutPart)) OR (eregi("\.de", $ShoutPart)) OR (eregi("\.jp", $ShoutPart)) OR (eregi("\.ro", $ShoutPart)) OR (eregi("\.be", $ShoutPart)) OR (eregi("\.fm", $ShoutPart)) OR (eregi("\.ms", $ShoutPart)) OR (eregi("\.tc", $ShoutPart)) OR (eregi("\.co\.za", $ShoutPart)) OR (eregi("\.co\.nz", $ShoutPart)) OR (eregi("\.ph", $ShoutPart)) OR (eregi("\.dk", $ShoutPart)) OR (eregi("\.st", $ShoutPart)) OR (eregi("\.ac", $ShoutPart)) OR (eregi("\.gs", $ShoutPart)) OR (eregi("\.vg", $ShoutPart)) OR (eregi("\.sh", $ShoutPart)) OR (eregi("\.kz", $ShoutPart)) OR (eregi("\.as", $ShoutPart)) OR (eregi("\.lt", $ShoutPart)) OR (eregi("\.to", $ShoutPart)) OR (eregi("\.co\.il", $ShoutPart))) {
            $ShoutPart = "http://" . $ShoutPart;
            $ShoutNew[$i] = "&#91;<a target='_blank' href='$ShoutPart'>Nuoroda</a>&#93;";
         } elseif (strlen($ShoutPart) > 45) {
            $ShoutNew[$i] = wordwrap($ShoutPart, 45, " ", 1);
         } else { $ShoutNew[$i] = $ShoutPart; }
         $i++;
      }
      $shout_message = implode(" ",$ShoutNew);
      // End

      if ($shout_name != "" && $shout_message != "") {
         $result = dbquery("SELECT MAX(shout_datestamp) AS last_shout FROM ".$db_prefix."shoutbox WHERE shout_ip='".USER_IP."'");
         if (!iSUPERADMIN && dbrows($result) != 0) {
            $data = dbarray($result);
            if ((time() - $data['last_shout']) < $settings['flood_interval']) {
               $flood = true;
               $result = dbquery("INSERT INTO ".$db_prefix."flood_control (flood_ip, flood_timestamp) VALUES ('".USER_IP."', '".time()."')");
               if (dbcount("(flood_ip)", "flood_control", "flood_ip='".USER_IP."'") > 4) {
                  if (iMEMBER) {
                     $result = dbquery("UPDATE ".$db_prefix."users SET user_status='1' WHERE user_id='".$userdata['user_id']."'");
                  }
               }
            }
         }
         if (!$flood) {
            $result = dbquery("INSERT INTO ".$db_prefix."shoutbox (shout_name, shout_message, shout_datestamp, shout_ip)
               VALUES ('$shout_name', '$shout_message', '".time()."', '".USER_IP."')"
            );
         }
      }
      fallback(FUSION_SELF.(FUSION_QUERY ? "?".FUSION_QUERY : ""));
   }
   echo "<div id='sb_form_and_display'>
<div id='sb_form'>
<form name='shoutform' method='post' action='javascript:void(0)'>
<div align='center'>".$locale['fb_001']." <input type='text' name='commentlen' value='200' maxlength='3' size='3' style='margin-top:5px; margin-bottom:2px; text-align:center;' class='textbox' readonly></div>
<table align='center' cellpadding='0' cellspacing='0'>
<tr>
<td colspan='2'>\n";
   if (iGUEST) {
      echo $locale['121']."<br>
<input type='text' name='shout_name' value='' maxlength='30' style='width:140px;' class='textbox'><br>".$locale['122']."<br>\n";
   }
   echo "<center><textarea id='shout_message' name='shout_message' onKeyDown=\"textCounter(this.form.shout_message, this.form.commentlen, 200);\" onKeyUp=\"textCounter(this.form.shout_message, this.form.commentlen, 200);\" onFocus=\"textCounter(this.form.shout_message, this.form.commentlen, 200);\" rows='4' style='margin-bottom:-5px; width:140px;' class='textbox'></textarea></center>
</td>
</tr>
<tr>
<td align='center'>
<input type='button' name='post_shout'  onclick=\"sendData('shout', ''); return false\" value='".$locale['123']."' title='".$locale['fb_002']."' style='margin-top:10px; margin-bottom:10px;' class='button'>&nbsp; <input type='button' name='post_shout'  onclick=\"sendData('shout', ''); return false\" value='Atnaujinti' title='Atnaujinti' style='margin-top:10px; margin-bottom:10px;' class='button'>
<div style='margin-top:-5px; margin-bottom:-1px;' align='center' class='tbl2'>
<a onClick=\"return overlay(this, 'shout_smiley', 'rightbottom')\" style='text-decoration:none; cursor: pointer; font-size:9px; font-weight:normal;'>".$locale['fb_003']."</a> |
<div id='shout_smiley' align='center' style='background-image:url(".INFUSIONS."shoutbox_panel/images/sb_bg.gif); position:absolute; display:none; border: 1px solid black; width: 200px; height: auto;' class='tbl1'>
".displaysmileys("shout_message", "shout_smiley", "shoutform")."
</div>
<a href=\"javascript:fuzetext('shout_message','','');\" style='text-decoration:none; font-size:9px; font-weight:normal;'>".$locale['fb_004']."</a> |
<a onClick=\"return overlay(this, 'shout_palette', 'rightbottom')\" style='text-decoration:none; cursor: pointer; font-size:9px; font-weight:normal;'>".$locale['fb_005']."</a> |
<div id='shout_palette' align='center' style='background-image:url(".INFUSIONS."shoutbox_panel/images/sb_bg.gif); position:absolute; display:none; border: 1px solid black; width: auto; height: auto;' class='tbl1'>";
colorPalette("v", IMAGES, 10, 7);
echo "</div>
<span style='cursor:default; font-size:9px; font-weight:normal; text-decoration: none;' title=\"header=[<img src='".INFUSIONS."shoutbox_panel/images/info.gif' style='vertical-align: middle;'> ".$locale['fb_016']."] body=[".phpentities($locale['fb_017'])."] delay=[0] fade=[on]\">".$locale['fb_018']."</span><br />
</div>
</td>
</tr>
</table>
</form>
</div><br />\n";

} else {
   echo "<center>".$locale['125']."</center><br>\n";
}
echo "<div id='sb_display'>";
$shout_counter = 0;
$result = dbquery("SELECT * FROM ".$db_prefix."shoutbox LEFT JOIN ".$db_prefix."users
   ON shout_name=user_id ORDER BY shout_datestamp DESC LIMIT ".($min + $max)
);
$numrows = dbrows($result);
if ($numrows != 0) {
   $i = 0;
   while ($data = dbarray($result)) {

/*******************************************************************
* Begin show more feature.
********************************************************************/

      if ($shout_counter == $min) {
         echo "";
      }

/*******************************************************************
* End show more feature.
********************************************************************/

/*******************************************************************
* Modded for user ban display names, send private message and member homepage.
*******************************************************************/

      if (iMEMBER) {
         if ($data['user_id'] == $userdata['user_id']) {
            echo "<img alt='' src='".THEME."images/bullet.gif'> ";
         } elseif ($data['user_status'] != 1) {
            if (!isset($data['user_id']) || $data['user_id'] != $userdata['user_id']) {
               echo "<span class='shoutboxname'><a onClick=\"fuzetext('shout_message','@".(isset($data['user_name']) ? $data['user_name'] : $data['shout_name']).": - ','');\" style='cursor:pointer;'><img src='".INFUSIONS."shoutbox_panel/images/amp.png' title=\"header=[<img src='".INFUSIONS."shoutbox_panel/images/info.gif' style='vertical-align: middle;'> ".$locale['fb_006']."] body=[".phpentities($locale['fb_034'])."] delay=[0] fade=[on]\" alt='' border='0'></a></span> ";
            }
            if (isset($data['user_id']) && $data['user_id'] != $userdata['user_id']) {
               echo "<a href='".BASEDIR."messages.php?msg_send=".$data['user_id']."'><img src='".INFUSIONS."shoutbox_panel/images/pm.png' title=\"header=[<img src='".INFUSIONS."shoutbox_panel/images/info.gif' style='vertical-align: middle;'> ".$locale['fb_007']."] body=[".phpentities($locale['fb_035'])."] delay=[0] fade=[on]\" alt='' border='0'></a> ";
            }
            if ($data['user_web']) {
               if (!strstr($data['user_web'], "http://")) { $urlprefix = "http://"; } else { $urlprefix = ""; }
               echo "<a href='".$urlprefix."".$data['user_web']."' target='_blank'><img alt='' src='".INFUSIONS."shoutbox_panel/images/w3.png' title=\"header=[<img src='".INFUSIONS."shoutbox_panel/images/info.gif' style='vertical-align: middle;'> ".$locale['fb_013']."] body=[".phpentities($locale['fb_037'])."] delay=[0] fade=[on]\" border='0'></a> ";
            }
         } elseif ($data['user_status'] == 1) {
            echo "<img alt='' style='vertical-align:middle;' src='".INFUSIONS."shoutbox_panel/images/banned.png' title=\"header=[<img src='".INFUSIONS."shoutbox_panel/images/info.gif' style='vertical-align: middle;'> ".$locale['fb_012']."] body=[".phpentities($locale['fb_038'])."] delay=[0] fade=[on]\">";
         }
      } else {
         if ($data['user_status'] == 1) {
            echo "<img alt='' style='vertical-align:middle;' src='".INFUSIONS."shoutbox_panel/images/banned.png' title=\"header=[<img src='".INFUSIONS."shoutbox_panel/images/info.gif' style='vertical-align: middle;'> ".$locale['fb_012']."] body=[".phpentities($locale['fb_038'])."] delay=[0] fade=[on]\">";
         } else { echo "<img alt='' src='".THEME."images/bullet.gif'> "; }
      }

/*******************************************************************
* End ban display names.
*******************************************************************/

/*******************************************************************
* Modded for colored names.
*******************************************************************/

      $shoutcount = dbcount("(shout_id)", "shoutbox", "shout_name='".$data['user_id']."'");
      if ($data['user_level'] == "103") { $userx = "<font color='#F75013'><b>".$data['user_name']."</b></font>"; }
      elseif ($data['user_level'] == "102") { $userx = "<font color='#008000'><b>".$data['user_name']."</b></font>"; }
      elseif ($data['user_level'] == "101") { $userx = "<font color='#3333FF'><b>".$data['user_name']."</b></font>"; }
      if ($data['user_status'] == 1) { $userx = "<font color='#A38C54'><b>".$data['user_name']."</b></font>"; }

/*******************************************************************
* End color mod.
*******************************************************************/

      $lastseen = time() - $data['user_lastvisit'];
      if ($lastseen < 60) {
         $lastseen = "<img src='".INFUSIONS."shoutbox_panel/images/online.png' title=\"header=[<img src='".INFUSIONS."shoutbox_panel/images/info.gif' style='vertical-align: middle;'> ".$locale['fb_014']."] body=[<font color='red'><b>".phpentities($data['user_name']."</b></font>, ".$locale['fb_040'])."] delay=[0] fade=[on]\" alt='' style='vertical-align: middle;'>";
      } else {
         $lastseen = "<img src='".INFUSIONS."shoutbox_panel/images/offline.png' title=\"header=[<img src='".INFUSIONS."shoutbox_panel/images/info.gif' style='vertical-align: middle;'> ".$locale['fb_015']."] body=[<font color='red'><b>".phpentities($data['user_name']."</b></font>, ".$locale['fb_041'])."] delay=[0] fade=[on]\" alt='' style='vertical-align: middle;'>";
      }
      if ($data['user_status'] == 1) {
         echo "<span style='cursor:default; text-decoration: none;' title=\"header=[".$data['user_name']." - <font color='red'>".$locale['fb_033']."</font>] body=[".rawurlencode("<center><img src='".INFUSIONS."shoutbox_panel/images/banned.gif'></center></span><br><br>
<font color='$textcolor'><b>".$locale['fb_025']."</b>".$data['user_name']." - <b><font color='red'><i>".$locale['fb_026']."</i></b></font><br><br>
<font color='$textcolor'><b>".$locale['fb_027']."</b>".$locale['fb_028']."<br><br>
<b>".$locale['fb_029']."</b>".showdate("shortdate", $data['user_joined'])."<br><br>
<b>".$locale['fb_030']."</b>".showdate("shortdate", $data['user_lastvisit'])."<br><br>
<b>".$locale['fb_031']."</b>$shoutcount ".$locale['fb_032']."")."] delay=[0] fade=[on]\">
<a href='".INFUSIONS."shoutbox_panel/banned.php?shout_user=".$data['shout_name']."' onClick=\"MyWindow=window.open('".INFUSIONS."shoutbox_panel/banned.php?shout_user=".$data['shout_name']."','shoutbox','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=240,height=250'); return false;\" class='side'>$userx</a>
</span> - <font color='red'>".$locale['fb_022']."</font>";
      } else {
         if ($data['user_name']) {
            if ($data['user_avatar'] != "") { $avatar = "<img src='".IMAGES."avatars/".$data['user_avatar']."'>"; }
            else { $avatar = "<img src='".IMAGES."noimage.gif'>"; }
            echo "<span style='cursor:default; text-decoration: none;' title=\"header=[".$data['user_name']."] body=[".rawurlencode("<center>$avatar</center></span><br><br>
<span class='$textcolor'><b>".$locale['fb_025']."</b>$userx<br><br>
<b>Vieta: </b>".$data['user_location']." <br><br>
<b>Gimimo data: </b>".$data['user_birthdate']."")."] delay=[0] fade=[on]\">
<a href='".BASEDIR."profile.php?lookup=".$data['user_id']."' class='side'>$userx</a>
</span>&nbsp;$lastseen";
         } else { echo $data['shout_name']."\n"; }
      }
      echo "<br>\n<span class='shoutboxdate'>".showdate("shortdate", $data['shout_datestamp'])."</span>";
      if (iADMIN && checkrights("S")) {
         echo "<br>\n[<a href=\"javascript:void(0)\" onClick=\"sendData('edit', '".$data['shout_id']."');\" class='side'>".$locale['048']."</a> - <a href=\"javascript:void(0)\" onClick=\"sendData('delete', '".$data['shout_id']."')\" class='side'>".$locale['fb_043']."</a>] ";
         if ($data['user_status'] == "1") {
            echo "[<a href=\"javascript:void(0)\" onClick=\"sendData('unban', '".$data['user_id']."')\" class='side'>".$locale['fb_009']."</a>]";
         } elseif ($data['user_status'] == "0" && $data['user_level'] != "103" && $data['user_id'] != $userdata['user_id']) {
echo "[<a href=\"javascript:void(0)\" onClick=\"sendData('ban', '".$data['user_id']."')\" class='side'>".$locale['fb_010']."</a>]";
         }
         echo "<br><span style='font-size:8px;'>".$locale['fb_011'].$data['user_ip']."</span><br>";
      } else { echo "<br>\n"; }
      echo "<span class='shoutbox'>".parseshoutubb(parseubb(parsesmileys($data['shout_message'])))."</span><br>\n";
      if ($i != $numrows) { echo "<br>\n"; }
      $shout_counter ++;
   }
} else { echo "<div align='left'>".$locale['127']."</div>\n"; }
if (iMEMBER){
echo "</div></div>";} else { echo "</div>"; }
if ($shout_counter > $min) { echo "</div>"; }
if (iMEMBER) {
   echo "<hr><center>
<img src='".THEME."images/bullet.gif' alt='' border='0'>&nbsp;
<a href='".INFUSIONS."shoutbox_panel/shoutbox_archive.php' class='side'>".$locale['126']."</a>&nbsp;
<img src='".THEME."images/bulletb.gif' alt='' border='0'>
</center>\n";
}

closeside();
?>