Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.

Fangree Productions:: Center Shoutbox Panel

Here is the code for the Center Shoutbox Panel used on the home.php page of my site fangree.co.uk.

First BACKUP shoutbox_panel.php shoutbox_archive.php and locale/English/global.php

Copy and paste these codes into your existing shoutbox files or create a new shoutbox if you want eitherr way it works.

Upload the 2 online offline images to root/images/ and upload a noav.gif to root/images/avatars

www.fangree.co.uk/images/offline.gif www.fangree.co.uk/images/online.gif


Shoutbox_panel.php

CodeDownload  
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2010 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: shoutbox_panel.php
| Author: Nick Jones (Digitanium)
| Enhanced by Fangree Productions
| Site: http://www.fangree.co.uk
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }

$link = FUSION_SELF.(FUSION_QUERY ? "?".FUSION_QUERY : "");
$link = preg_replace("^(&amp;|\?)s_action=(edit|delete)&amp;shout_id=\d*^", "", $link);
$sep = stristr($link, "?") ? "&amp;" : "?";

if (iMEMBER && (isset($_GET['s_action']) && $_GET['s_action'] == "delete") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
   if ((iADMIN && checkrights("S")) || (iMEMBER && dbcount("(shout_id)", DB_SHOUTBOX, "shout_id='".$_GET['shout_id']."' AND shout_name='".$userdata['user_id']."'"))) {
      $result = dbquery("DELETE FROM ".DB_SHOUTBOX." WHERE shout_id='".$_GET['shout_id']."'".(iADMIN ? "" : " AND shout_name='".$userdata['user_id']."'"));
   }
   redirect($link);
}

function sbwrap($text) {
   global $locale;
   
   $i = 0; $tags = 0; $chars = 0; $res = "";
   
   $str_len = strlen($text);
   
   for ($i = 0; $i < $str_len; $i++) {
      $chr = mb_substr($text, $i, 1, $locale['charset']);
      if ($chr == "<") {
         if (mb_substr($text, ($i + 1), 6, $locale['charset']) == "a href" || mb_substr($text, ($i + 1), 3, $locale['charset']) == "img") {
            $chr = " ".$chr;
            $chars = 0;
         }
         $tags++;
      } elseif ($chr == "&") {
         if (mb_substr($text, ($i + 1), 5, $locale['charset']) == "quot;") {
            $chars = $chars - 5;
         } elseif (mb_substr($text, ($i + 1), 4, $locale['charset']) == "amp;" || mb_substr($text, ($i + 1), 4, $locale['charset']) == "#39;" || mb_substr($text, ($i + 1), 4, $locale['charset']) == "#92;") {
            $chars = $chars - 4;
         } elseif (mb_substr($text, ($i + 1), 3, $locale['charset']) == "lt;" || mb_substr($text, ($i + 1), 3, $locale['charset']) == "gt;") {
            $chars = $chars - 3;
         }
      } elseif ($chr == ">") {
         $tags--;
      } elseif ($chr == " ") {
         $chars = 0;
      } elseif (!$tags) {
         $chars++;
      }
      
      if (!$tags && $chars == 18) {
         $chr .= "<br />";
         $chars = 0;
      }
      $res .= $chr;
   }
   
   return $res;
}

opentable($locale['global_150']);
include_once INFUSIONS."shoutbox_panel/shoutbox_panel_functions.php";
   
   include_once INCLUDES."bbcode_include.php";
   if ((iMEMBER || $settings['guestposts'] == "1") && isset($_POST['post_shout'])) {
      $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 = ""; }
         include_once INCLUDES."securimage/securimage.php";
         $securimage = new Securimage();
         if (!isset($_POST['sb_captcha_code']) || $securimage->check($_POST['sb_captcha_code']) == false) { redirect($link); }
      }
      $shout_message = str_replace("\n", " ", $_POST['shout_message']);
      $shout_message = preg_replace("/^(.{255}).*$/", "$1", $shout_message);
      $shout_message = trim(stripinput(censorwords($shout_message)));
      if (iMEMBER && (isset($_GET['s_action']) && $_GET['s_action'] == "edit") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
         $comment_updated = false;
         if ((iADMIN && checkrights("S")) || (iMEMBER && dbcount("(shout_id)", DB_SHOUTBOX, "shout_id='".$_GET['shout_id']."' AND shout_name='".$userdata['user_id']."'"))) {
            if ($shout_message) {
               $result = dbquery("UPDATE ".DB_SHOUTBOX." SET shout_message='$shout_message' WHERE shout_id='".$_GET['shout_id']."'".(iADMIN ? "" : " AND shout_name='".$userdata['user_id']."'"));
            }
         }
         redirect($link);
      } elseif ($shout_name && $shout_message) {
         require_once INCLUDES."flood_include.php";
         if (!flood_control("shout_datestamp", DB_SHOUTBOX, "shout_ip='".USER_IP."'")) {
            $result = dbquery("INSERT INTO ".DB_SHOUTBOX." (shout_name, shout_message, shout_datestamp, shout_ip, shout_hidden) VALUES ('$shout_name', '$shout_message', '".time()."', '".USER_IP."', '0')");
         }
      }
      redirect($link);
   }
   if (iMEMBER && (isset($_GET['s_action']) && $_GET['s_action'] == "edit") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
      $esresult = dbquery(
         "SELECT ts.shout_id, ts.shout_name, ts.shout_message, tu.user_id, tu.user_name
         FROM ".DB_SHOUTBOX." ts
         LEFT JOIN ".DB_USERS." tu ON ts.shout_name=tu.user_id
         WHERE ts.shout_id='".$_GET['shout_id']."'"
      );
      if (dbrows($esresult)) {
         $esdata = dbarray($esresult);
         if ((iADMIN && checkrights("S")) || (iMEMBER && $esdata['shout_name'] == $userdata['user_id'] && isset($esdata['user_name']))) {
            if ((isset($_GET['s_action']) && $_GET['s_action'] == "edit") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
               $edit_url = $sep."s_action=edit&amp;shout_id=".$esdata['shout_id'];
            } else {
               $edit_url = "";
            }
            $shout_link = $link.$edit_url;
            $shout_message = $esdata['shout_message'];
         }
      } else {
         $shout_link = $link;
         $shout_message = "";
      }
   } else {
      $shout_link = $link;
      $shout_message = "";
   }
   

$numrows = dbcount("(shout_id)", DB_SHOUTBOX, "shout_hidden='0'");
$result = dbquery(
   "SELECT ts.shout_id, ts.shout_name, ts.shout_message, ts.shout_datestamp, tu.user_id, tu.user_name, tu.user_avatar, tu.user_lastvisit, tu.user_status
   FROM ".DB_SHOUTBOX." ts
   LEFT JOIN ".DB_USERS." tu ON ts.shout_name=tu.user_id
   WHERE shout_hidden='0'
   ORDER BY ts.shout_datestamp DESC LIMIT 0,".$settings['numofshouts']
);
if (dbrows($result)) {
   $i = 0;
   echo" <div class='tbl' style='height:200px; overflow:auto;'>";
   
   while ($data = dbarray($result)) {
      echo "<div class='shoutboxname' width='90%'>";
      if ($data['user_name']) {
      if ($data['user_avatar'] && file_exists(IMAGES."avatars/".$data['user_avatar'])) {
         echo "<img src='".IMAGES."avatars/".$data['user_avatar']."' alt='".$locale['sb_av1']."' width='20px' height='20px' border='0' style='vertical-align:middle;
         opacity:0.6;filter:alpha(opacity=60)'
            onmouseover='this.style.opacity=1;this.filters.alpha.opacity=100'
            onmouseout='this.style.opacity=0.6;this.filters.alpha.opacity=60'''/>\n";
       } else {
   
      echo "<img src='".IMAGES."avatars/noav.gif' alt='".$locale['sb_noav1']."' width='20px' height='20px' border='0' style='vertical-align:middle;/>";
   }
         echo "<span class='side'>".profile_link($data['shout_name'], $data['user_name'], $data['user_status'])."</span>\n";
      } else {
         echo $data['shout_name']."\n";
      }

         if ($data['user_lastvisit']<(time()-60)) {
            echo " <img src='".IMAGES."offline.gif' alt='".$data['user_name']." ".$locale['sb_off1']."' title='".$data['user_name']." ".$locale['sb_off1']."'  style='vertical-align:middle; border:0px;'/> \n";
         } else {
            echo " <img src='".IMAGES."online.gif' alt='".$data['user_name']." ".$locale['sb_on1']."' title='".$data['user_name']." ".$locale['sb_on1']."'  style='vertical-align:middle; border:0px;' /> \n";   
         }   
   
      echo "<span class='shoutboxdate' width='90%'> - ".showdate("shortdate", $data['shout_datestamp'])."</span></div>";
      echo "<div class='shoutbox'width='90%'>".sbwrap(parseubb(parsesmileys($data['shout_message']), "b|i|u|url|color"))."</div>\n";
      if ((iADMIN && checkrights("S")) || (iMEMBER && $data['shout_name'] == $userdata['user_id'] && isset($data['user_name']))) {
         echo "[<a href='".$link.$sep."s_action=edit&amp;shout_id=".$data['shout_id']."#edit_shout"."' class='side'>".$locale['global_076']."</a>]\n";
         echo "[<a href='".$link.$sep."s_action=delete&amp;shout_id=".$data['shout_id']."' class='side'>".$locale['global_157']."</a>]<br />\n";
      }
      $i++;
      if ($i != $numrows) { echo "<hr><br />\n"; }
   }
   echo "</div>\n";
   
} else {
   echo "<div>".$locale['global_156']."</div>\n";
}
   echo "<a id='edit_shout' name='edit_shout'></a>\n";
   echo "<form name='shout_form' method='post' action='".$shout_link."'>\n";
   if (iGUEST && $settings['guestposts'] == "1") {
      echo $locale['global_151']."<br />\n";
      echo "<input type='text' name='shout_name' value='' class='textbox' maxlength='30' style='width:140px' /><br />\n";
      echo $locale['global_152']."<br />\n";
   }
   
            $delay_spam = 86400; // 24 Hours
 
        if (iMEMBER && ((time()-$userdata['user_joined'])<$delay_spam)) {
echo"<br /><div class='admin-message' style='text-align: center;margin:auto'><strong>".$locale['sb_spam001']."</strong></div><br />";
       }elseif(iMEMBER || $settings['guestposts'] == "1"){
      if ($numrows > $settings['numofshouts']) {
      echo "<div style='text-align:center'>\n<span class='side'>[</span><a href='".INFUSIONS."shoutbox_panel/shoutbox_archive.php' class='side'>".$locale['global_155']."</a><span class='side'>]</span>\n</div>\n";
      
   }
   echo "<div align='center'><hr width='95%'>";
      echo"<a title='".$locale['sb_002']."' href='javascript:void(0)' onClick=\"document.getElementById('shout').style.display = (document.getElementById('shout').style.display == 'none' ? 'block' : 'none');\"><img style='vertical-align:middle' src='".BASEDIR."infusions/shoutbox_panel/images/shout.png' title='".$locale['sb_002']."' alt='".$locale['sb_002']."' border='0' /> <strong>".$locale['sb_003']."</strong></a>";
   echo"<div style='display: none;' id='shout'>";

   echo"<div class='admin-message' style='text-align: center; margin:auto; width:366px; '><strong>".$locale['sb_nosu1']."</strong></div>";
   echo"<fieldset><legend>Shout:</legend>";
   echo"<center><textarea name='shout_message' maxlength='200' rows='2' cols='20' class='textbox' style='width:368px' align='center'  >".$shout_message."</textarea><br />
   <span class='counterb'>".$locale['sb_count1']."</span> <span class='counter' ></span> <span class='counterb'>".$locale['sb_count2']."</span></center>\n";
echo"</fieldset><br />";
   echo display_bbcodes("150px;", "shout_message", "shout_form", "smiley|b|u|url|color")."\n";
   if (iGUEST) {
      echo $locale['global_158']."<br />\n";
      echo "<img id='sb_captcha' src='".INCLUDES."securimage/securimage_show.php' alt='' /><br />\n";
    echo "<a href='".INCLUDES."securimage/securimage_play.php'><img src='".INCLUDES."securimage/images/audio_icon.gif' alt='' class='tbl-border' style='margin-bottom:1px' /></a>\n";
    echo "<a href='#' onclick=\"document.getElementById('sb_captcha').src = '".INCLUDES."securimage/securimage_show.php?sid=' + Math.random(); return false\"><img src='".INCLUDES."securimage/images/refresh.gif' alt='' class='tbl-border' /></a><br />\n";
      echo $locale['global_159']."<br />\n<input type='text' name='sb_captcha_code' class='textbox' style='width:100px' /><br />\n";
   }
   echo "<input style='vertical-align:middle;' type='submit' name='post_shout' value='".$locale['global_153']."' class='button' />\n";
   echo "</form></div></div>\n<br />\n";
} else {
   echo "<div style='text-align:center'>".$locale['global_154']."</div></center><br />\n";
}

echo"</div>";
   
closetable();
?>



shoutbox_archive.php
CodeDownload  
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2010 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: shoutbox_archive.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "../../maincore.php";
require_once THEMES."templates/header.php";

$result = dbquery("SELECT panel_access FROM ".DB_PANELS." WHERE panel_filename='shoutbox_panel' AND panel_status='1'");
if (dbrows($result)) {
   $data = dbarray($result);
   if (!checkgroup($data['panel_access'])) {
      redirect(BASEDIR."index.php");
   }
} else {
   redirect(BASEDIR."index.php");
}

if (iMEMBER && (isset($_GET['action']) && $_GET['action'] == "delete") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
   if ((iADMIN && checkrights("S")) || (iMEMBER && dbcount("(shout_id)", DB_SHOUTBOX, "shout_id='".$_GET['shout_id']."' AND shout_name='".$userdata['user_id']."' AND shout_hidden='0'"))) {
      $result = dbquery("DELETE FROM ".DB_SHOUTBOX." WHERE shout_id='".$_GET['shout_id']."'".(iADMIN ? "" : " AND shout_name='".$userdata['user_id']."'"));
   }
   redirect(FUSION_SELF);
}

function sbawrap($text) {
   global $locale, $userdata;
   
   $i = 0; $tags = 0; $chars = 0; $res = "";
   
   $str_len = strlen($text);
   
   for ($i = 0; $i < $str_len; $i++) {
      $chr = mb_substr($text, $i, 1, $locale['charset']);
      if ($chr == "<") {
         if (mb_substr($text, ($i + 1), 6, $locale['charset']) == "a href" || mb_substr($text, ($i + 1), 3, $locale['charset']) == "img") {
            $chr = " ".$chr;
            $chars = 0;
         }
         $tags++;
      } elseif ($chr == "&") {
         if (mb_substr($text, ($i + 1), 5, $locale['charset']) == "quot;") {
            $chars = $chars - 5;
         } elseif (mb_substr($text, ($i + 1), 4, $locale['charset']) == "amp;" || mb_substr($text, ($i + 1), 4, $locale['charset']) == "#39;" || mb_substr($text, ($i + 1), 4, $locale['charset']) == "#92;") {
            $chars = $chars - 4;
         } elseif (mb_substr($text, ($i + 1), 3, $locale['charset']) == "lt;" || mb_substr($text, ($i + 1), 3, $locale['charset']) == "gt;") {
            $chars = $chars - 3;
         }
      } elseif ($chr == ">") {
         $tags--;
      } elseif ($chr == " ") {
         $chars = 0;
      } elseif (!$tags) {
         $chars++;
      }
      
      if (!$tags && $chars == 40) {
         $chr .= " ";
         $chars = 0;
      }
      $res .= $chr;
   }
   
   return $res;
}

add_to_title($locale['global_200'].$locale['global_155']);

opentable($locale['global_155']);

include_once INFUSIONS."shoutbox_panel/shoutbox_panel_functions.php";

if (iMEMBER || $settings['guestposts'] == "1") {
   include_once INCLUDES."bbcode_include.php";
   if (isset($_POST['post_archive_shout'])) {
      $flood = false;
      if (iMEMBER) {
         $archive_shout_name = $userdata['user_id'];
      } elseif ($settings['guestposts'] == "1") {
         $archive_shout_name = trim(stripinput($_POST['archive_shout_name']));
         $archive_shout_name = preg_replace("(^[0-9]*)", "", $archive_shout_name);
         if (isnum($archive_shout_name)) { $archive_shout_name = ""; }
         include_once INCLUDES."securimage/securimage.php";
         $securimage = new Securimage();
         if (!isset($_POST['captcha_code']) || $securimage->check($_POST['captcha_code']) == false) { redirect($link); }
      }
      $archive_shout_message = str_replace("\n", " ", $_POST['archive_shout_message']);
      $archive_shout_message = preg_replace("/^(.{255}).*$/", "$1", $archive_shout_message);
      $archive_shout_message = trim(stripinput(censorwords($archive_shout_message)));
      if (iMEMBER && (isset($_GET['action']) && $_GET['action'] == "edit") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
         $comment_updated = false;
         if ((iADMIN && checkrights("S")) || (iMEMBER && dbcount("(shout_id)", DB_SHOUTBOX, "shout_id='".$_GET['shout_id']."' AND shout_name='".$userdata['user_id']."' AND shout_hidden='0'"))) {
            if ($archive_shout_message) {
               $result = dbquery("UPDATE ".DB_SHOUTBOX." SET shout_message='$archive_shout_message' WHERE shout_id='".$_GET['shout_id']."'".(iADMIN ? "" : " AND shout_name='".$userdata['user_id']."'"));
            }
         }
         redirect(FUSION_SELF);
      } elseif ($archive_shout_name && $archive_shout_message) {
         require_once INCLUDES."flood_include.php";
         if (!flood_control("shout_datestamp", DB_SHOUTBOX, "shout_ip='".USER_IP."'")) {
            $result = dbquery("INSERT INTO ".DB_SHOUTBOX." (shout_name, shout_message, shout_datestamp, shout_ip) VALUES ('$archive_shout_name', '$archive_shout_message', '".time()."', '".USER_IP."')");
         }
         redirect(FUSION_SELF);
      }
   }
   if (iMEMBER && (isset($_GET['action']) && $_GET['action'] == "edit") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
         $esresult = dbquery(
         "SELECT ts.shout_id, ts.shout_name, ts.shout_message, tu.user_id, tu.user_name, tu.user_avatar, tu.user_lastvisit
         FROM ".DB_SHOUTBOX." ts
         LEFT JOIN ".DB_USERS." tu ON ts.shout_name=tu.user_id
         WHERE ts.shout_id='".$_GET['shout_id']."' AND shout_hidden='0'"
      );
      if (dbrows($esresult)) {
         $esdata = dbarray($esresult);
         if ((iADMIN && checkrights("S")) || (iMEMBER && $esdata['shout_name'] == $userdata['user_id'] && isset($esdata['user_name']))) {
            if ((isset($_GET['action']) && $_GET['action'] == "edit") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) {
               $edit_url = "?action=edit&amp;shout_id=".$esdata['shout_id'];
            } else {
               $edit_url = "";
            }
            $archive_shout_link = FUSION_SELF.$edit_url;
            $archive_shout_message = $esdata['shout_message'];
         }
      } else {
         $archive_shout_link = FUSION_SELF;
         $archive_shout_message = "";
      }
   } else {
      $archive_shout_link = FUSION_SELF;
      $archive_shout_message = "";
   }
   echo "<form name='archive_form' method='post' action='".$archive_shout_link."'>\n";
   echo "<div style='text-align:center'>\n";
        $delay_spam = 86400; // 24 Hours
 
       if (iMEMBER && ((time()-$userdata['user_joined'])<$delay_spam)) {
   
   if (iGUEST) {
      echo $locale['global_151']."<br />\n";
      echo "<input type='text' name='archive_shout_name' value='' class='textbox' maxlength='30' style='width:200px;' /><br />\n";
      echo $locale['global_152']."<br />\n";
   
   echo"<br /><div class='admin-message' style='text-align: center;margin:auto'><strong>".$locale['sb_spam001']."</strong></div><br />";
   }else{
   echo"<div class='admin-message' style='text-align: center;margin:auto;width:366px'><strong>".$locale['sb_nosu1']."</strong></div><br />";
   echo"<center><fieldset><legend>".$locale['sb_001']."</legend>";
   echo"<center><textarea name='archive_shout_message' maxlength='200' rows='4' cols='50' class='textbox'  align='center'  >".$archive_shout_message."</textarea><br />
   <span class='counterb'>".$locale['sb_count1']."</span> <span class='counter' ></span> <span class='counterb'>".$locale['sb_count2']."</span></center>\n";
echo"</fieldset><br />";
   echo "<div style='text-align:center'>".display_bbcodes("100%", "archive_shout_message", "archive_form", "smiley|b|i|u|url|color")."</div>\n";
   if (iGUEST) {
      echo $locale['global_158']."<br />\n";
      echo "<img id='captcha' src='".INCLUDES."securimage/securimage_show.php' alt='' /><br />\n";
    echo "<a href='".INCLUDES."securimage/securimage_play.php'><img src='".INCLUDES."securimage/images/audio_icon.gif' alt='' class='tbl-border' style='margin-bottom:1px' /></a>\n";
    echo "<a href='#' onclick=\"document.getElementById('captcha').src = '".INCLUDES."securimage/securimage_show.php?sid=' + Math.random(); return false\"><img src='".INCLUDES."securimage/images/refresh.gif' alt='' class='tbl-border' /></a><br />\n";
      echo $locale['global_159']."<br />\n<input type='text' name='captcha_code' class='textbox' style='width:100px' /><br />\n";
   }
   echo "<br /><input type='submit' name='post_archive_shout' value='".$locale['global_153']."' class='button' />\n";
   echo "</div>\n</form>\n<br />\n";
   }
} else {
   echo "<div style='text-align:center'>".$locale['global_154']."</div>\n";
}
$rows = dbcount("(shout_id)", DB_SHOUTBOX);
if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) { $_GET['rowstart'] = 0; }
if ($rows != 0) {
$result = dbquery(
      "SELECT s.shout_id, s.shout_name, s.shout_message, s.shout_datestamp, u.user_id, u.user_name, u.user_status, u.user_avatar, u.user_lastvisit
      FROM ".DB_SHOUTBOX." s
      LEFT JOIN ".DB_USERS." u ON s.shout_name=u.user_id
      WHERE s.shout_hidden='0'
      ORDER BY s.shout_datestamp DESC LIMIT ".$_GET['rowstart'].",20"
   );
   while ($data = dbarray($result)) {
      echo "<div class='tbl2'>\n";
      if ((iADMIN && checkrights("S")) || (iMEMBER && $data['shout_name'] == $userdata['user_id'] && isset($data['user_name']))) {
         echo "<div style='float:right'>\n<a href='".FUSION_SELF."?action=edit&amp;shout_id=".$data['shout_id']."'>".$locale['global_076']."</a> |\n";
         echo "<a href='".FUSION_SELF."?action=delete&amp;shout_id=".$data['shout_id']."'>".$locale['global_157']."</a>\n</div>\n";
      }
      if ($data['user_name']) {
      if ($data['user_avatar'] && file_exists(IMAGES."avatars/".$data['user_avatar'])) {
         echo "<img src='".IMAGES."avatars/".$data['user_avatar']."' alt='".$locale['sb_av1']."' width='20px' height='20px' border='0' style='vertical-align:middle;'/>\n";
       } else {
   
      echo "<img src='".IMAGES."avatars/noav.gif' alt='".$locale['sb_noav1']."' width='20px' height='20px' border='0' style='vertical-align:middle;/>";
   }
         echo "<span class='side '>".profile_link($data['shout_name'], $data['user_name'], $data['user_status'])."</span>\n";
      } else {
         echo $data['shout_name']."\n";
      }
      
         if ($data['user_lastvisit']<(time()-60)) {
            echo " <img src='".IMAGES."offline.gif' alt='".$data['user_name']." ".$locale['sb_off1']."' title='".$data['user_name']." ".$locale['sb_off1']."'  style='vertical-align:middle; border:0px;'/> \n";
         } else {
            echo " <img src='".IMAGES."online.gif' alt='".$data['user_name']." ".$locale['sb_on1']."' title='".$data['user_name']." ".$locale['sb_on1']."'  style='vertical-align:middle; border:0px;' /> \n";   
         }

      echo "<span class='small'>".showdate("longdate", $data['shout_datestamp'])."</span>";
      echo "</div>\n<div class='tbl1'>\n".sbawrap(parseubb(parsesmileys($data['shout_message']), "b|i|u|url|color"))."</div>\n";
   }
} else {
   echo "<div style='text-align:center'><br />\n".$locale['global_156']."<br /><br />\n</div>\n";
}
closetable();

echo "<div align='center' style='margin-top:5px;'>\n".makepagenav($_GET['rowstart'], 20, $rows, 3, FUSION_SELF."?")."\n</div>\n";

require_once THEMES."templates/footer.php";
?>



shoutbox_panel_functions.php
CodeDownload  
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2010 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: shoutbox_panel_functions.php
| Author: Fangree Productions
| Developers: Fangree_Craig
|Site: http://www.fangree.co.uk
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }
add_to_head("<script src='".BASEDIR."infusions/shoutbox_panel/textcounter.js' type='text/javascript'></script>");
add_to_head("<style type='text/css'> .counter { font-size:9px; color:#ff0000; } .counterb { font-size:9px; } </style>");
add_to_head("<style type='text/css'>fieldset { border: 1px solid #ccc; text-align:left; width: 380px; padding: 5px 4px;
   -moz-border-radius:5px; -webkit-border-radius:5px; -moz-box-shadow:0 1px 0 rgba(255, 255, 255, 0.20); -webkit-box-shadow:0 1px 0 rgba(255, 255, 255, 0.20) }
   legend {color: #ccc;  font-size: 12px; font-weight:700; padding: 2px 4px; margin-right: 0.7em;}</style>");
?>



textcounter.js
CodeDownload  
$(document).ready(function(){
 /**Author: Sachin
 /**   http://swiki.fromdev.com/2010/02/jquery-maximum-limit-texttextarea-with.html#5
  * Character Counter for inputs and text areas showing characters left.
  */
 $('.textbox').each(function(){
     //maximum limit of characters allowed.
     var maxlimit = 200;
     // get current number of characters
     var length = $(this).val().length;
     if(length >= maxlimit) {
   $(this).val($(this).val().substring(0, maxlimit));
   length = maxlimit;
  }
     // update count on page load
     $(this).parent().find('.counter').html( (maxlimit - length) + ' ');
     // bind on key up event
     $(this).keyup(function(){
  // get new length of characters
  var new_length = $(this).val().length;
  if(new_length >= maxlimit) {
    $(this).val($(this).val().substring(0, maxlimit));
    //update the new length
    new_length = maxlimit;
   }
  // update count
  $(this).parent().find('.counter').html( (maxlimit - new_length) + ' ');
     });
 });

});



locale/English/global.php
Paste this in the global.php look for //shoutbox and replace all thew shoutbox locales with this...

CodeDownload  
// Shoutbox
$locale['global_150'] = "Shoutbox";
$locale['global_151'] = "Name:";
$locale['global_152'] = "Message:";
$locale['global_153'] = "Shout";
$locale['global_154'] = "You must login to post a message.";
$locale['global_155'] = "Shoutbox Archive";
$locale['global_156'] = "No messages have been posted.";
$locale['global_157'] = "Delete";
$locale['global_158'] = "Validation Code:";
$locale['global_159'] = "Enter Validation Code:";
$locale['sb_spam001'] = "<span style='color:#ff0000'><b>Spam Protection!</b></span><br>New registered members must wait 24 hours after registration before posting in the shoutbox.";
$locale['sb_nosu1'] = "<span style='color:#ff0000' class='side-small'><b>!</b></span> <span  class='side-small'>No Support Questions, No Spam, No Flaming, & No Swearing</span> <span style='color:#ff0000' class='side-small'><b>!</b></span>";
$locale['sb_av1'] ="Avatar";
$locale['sb_noav1'] ="No Avatar";
$locale['sb_off1'] ="is offline";
$locale['sb_on1'] ="is online";
$locale['sb_count1'] ="(Max. characters: 200) You have";
$locale['sb_count2'] ="characters left.";
$locale['sb_001'] ="Shout:";
$locale['sb_002'] ="Click To Post A Shout";
$locale['sb_003'] ="Post Shout";



Done.

Center Shoutbox now implemented.
Remember to enable the shoutbox as a Center Panel now rather than a side.

Enjoy.
Thread Information
Author
Replies
1 post
Views
2,191 times
Last Post
Last updated on 9 years ago
You can view all discussion threads in this forum.
You cannot set up a bounty in this discussion thread.
You can start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
You cannot up or down-vote on the post in this discussion thread.
Users who participated in discussion: Craig