Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
[MOD] Additional shoutbox for staff only
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2 Only Mods Complete

Unknown User
2008-01-08 12:01:30
Edit: can a mod do me favor and change title to "Additional Staff Only Shoutbox"? as it makes another shoutbox which is staff only and leaves the original one alone

Simple hack to have a staff only shoutbox (trust me it's more simple than it looks).

Note: this is to make moderator or higher able to see/use it on a standard install with no extra user classes added.

Another note: This goes without saying but always backup the files before you edit them.

First open up a text editor and paste the following in it.

CREATE TABLE `staff_shoutbox` (
 `msgid` int(10) unsigned NOT NULL auto_increment,
 `user` varchar(50) NOT NULL default '0',
 `message` text,
 `date` datetime NOT NULL default '0000-00-00 00:00:00',
 `userid` int(8) unsigned NOT NULL default '0',
 PRIMARY KEY  (`msgid`),
 KEY `msgid` (`msgid`)
) TYPE=MyISAM AUTO_INCREMENT=1;
Save the file as staff_shoutbox.sql

Now go into phpmyadmin (or whatever you use), select your torrenttrader database and import the file.

====================================================================

Now open config.php and find (assuming you already have shoutbox enabled):

$site_config['SHOUTBOX'] = true; //enable/disable shoutbox
or if shoutbox is disabled find:


$site_config['SHOUTBOX'] = false; //enable/disable shoutbox
And just below it add:



 

$site_config['STAFFSHOUTBOX'] = true; //enable/disable staff shoutbox



This is so the staff shoutbox can be easily enabled or disabled in config.php separate to the user shoutbox.


====================================================================


Now make a copy of shoutbox.php and call it staff_shoutbox.php, then open it and find (right near the top):


if ($site_config['SHOUTBOX']){
replace with:


if ($site_config['STAFFSHOUTBOX'] && $CURUSER["class"] > 4) {
Note: To make Uploaders able to see shoutboxbox change the 4 to 3, or to make the shoutbox only useable for supermoderator or higher make it a 5 etc...


Now go find everyhere it has:


shoutbox.php
And replace with:


staff_shoutbox.php
Now find:


$query = "SELECT * FROM shoutbox WHERE msgid=".$_GET['del'];
Replace with:


$query = "SELECT * FROM staff_shoutbox WHERE msgid=".$_GET['del'];
Find:


$query = "DELETE FROM shoutbox WHERE msgid=".$_GET['del'];
Replace with:


$query = "DELETE FROM staff_shoutbox WHERE msgid=".$_GET['del'];
Find:


$query = "SELECT COUNT(*) FROM shoutbox WHERE message='".$shbmsg."' AND user='".$CURUSER['username']."' AND UNIX_TIMESTAMP()-UNIX_TIMESTAMP(date) < 30";
Replace with:


$query = "SELECT COUNT(*) FROM staff_shoutbox WHERE message='".$shbmsg."' AND user='".$CURUSER['username']."' AND UNIX_TIMESTAMP()-UNIX_TIMESTAMP(date) < 30";
Find:


$query = "INSERT INTO shoutbox (msgid, user, message, date, userid) VALUES (NULL, '".$CURUSER['username']."', '".unesc($shbmsg)."', '".get_date_time()."', '".$CURUSER['id']."')";
Replace with:


$query = "INSERT INTO staff_shoutbox (msgid, user, message, date, userid) VALUES (NULL, '".$CURUSER['username']."', '".unesc($shbmsg)."', '".get_date_time()."', '".$CURUSER['id']."')";
Find:


 
<title><?php echo $site_config['SITENAME']?>Shoutbox</title> 



Replace with:


<title><?php echo $site_config['SITENAME']?>Staff Shoutbox</title>
Find:


$query = 'SELECT COUNT(*) FROM shoutbox';
Replace with:


$query = 'SELECT COUNT(*) FROM staff_shoutbox';
Find:



 
$query = 'SELECT * FROM shoutbox ORDER BY msgid DESC LIMIT '.$lowerlimit.','.$upperlimit; } else { $query = 'SELECT * FROM shoutbox ORDER BY msgid DESC LIMIT 20'; 


Replace With:


$query = 'SELECT * FROM staff_shoutbox ORDER BY msgid DESC LIMIT '.$lowerlimit.','.$upperlimit;

}else{

$query = 'SELECT * FROM staff_shoutbox ORDER BY msgid DESC LIMIT 20';

========================================================================


Now open index.php in root directory and find:



if ($site_config['SHOUTBOX']){

begin_frame("Shoutbox");

echo '<IFRAME name="shout_frame" src="'.$site_config["SITEURL"].'/shoutbox.php" frameborder="0" marginheight="0" marginwidth="0" width="99%" height="210" width=350 scrolling="no" align="middle"></IFRAME>';

echo "(Shoutbox will auto-refresh every 5 minutes)<BR>";

end_frame();

}

Now above it (if you want staff shoutbox above shoutbox on site) or below it (if you want it below) add:



if ($site_config['STAFFSHOUTBOX'] && $CURUSER["class"] > 4){

begin_frame("Staff Shoutbox");

echo '<IFRAME name="shout_frame" src="'.$site_config["SITEURL"].'/staff_shoutbox.php" frameborder="0" marginheight="0" marginwidth="0" width="99%" height="210" width=350 scrolling="no" align="middle"></IFRAME>';

echo "(Shoutbox will auto-refresh every 5 minutes)<br>";

end_frame();

}

If you wish to allow uploaders to see/use staff shoutbox change the 4 on the first line to 3 (exactly the same as i mentioned before, this number should be the same as the number mentioned earlier near top of staff_shoutbox.php).

Enjoy  :(
Unknown User
2008-01-08 13:08:46
would this work for the v1xx thanks
Unknown User
2008-01-08 13:14:54
"cursed, post: 37229":
would this work for the v1xx thanks

I'm not completely sure i have only tried it 2.03, i'll try get a look at the 1x scripts tonight and let you know mate.

If it doesn't work i'll try make one for 1x when i get a chance.
Unknown User
2008-01-08 13:34:07
thanks .nice job with it anyway
Unknown User
2008-01-09 07:58:43
"cursed, post: 37231":
thanks .nice job with it anyway


Ok mate i made 1x port and posted it in 1x forum, see [url="http://www.torrenttrader.pw/index.php?showtopic=7608"]http://www.torrenttrader.pw/index.php?showtopic=7608[/url]
Unknown User
2008-08-09 09:18:40
Hello

I have a small problem when the message is sent to shout it sees only the name but not the message.

What do I changed in v2.03 please?
Unknown User
2008-08-10 08:49:39
I found my problem to modify the code:

Quote:
Find:


$query = "SELECT COUNT(*) FROM shoutbox WHERE message='".$shbmsg."' AND user='".$CURUSER['username']."' AND UNIX_TIMESTAMP()-UNIX_TIMESTAMP(date) < 30";
Replace with:




$query = "SELECT COUNT(*) FROM staff_shoutbox WHERE message='".$shbmsg."' AND user='".$CURUSER['username']."' AND UNIX_TIMESTAMP()-UNIX_TIMESTAMP(date) < 30";





Find:





$query = "INSERT INTO shoutbox (msgid, user, message, date, userid) VALUES (NULL, '".$CURUSER['username']."', '".unesc($shbmsg)."', '".get_date_time()."', '".$CURUSER['id']."')";





Replace with:







$query = "INSERT INTO staff_shoutbox (msgid, user, message, date, userid) VALUES (NULL, '".$CURUSER['username']."', '".unesc($shbmsg)."', '".get_date_time()."', '".$CURUSER['id']."')";




Replace with:



Find:







it works now  :blink:

$query = "SELECT COUNT(*) FROM shoutbox WHERE message='".$shbmsg."' AND user='".$CURUSER['username']."' AND UNIX_TIMESTAMP()-UNIX_TIMESTAMP(date) < 30";





Replace with:





$query = "SELECT COUNT(*) FROM staff_shoutbox WHERE message='".$_POST['message']."' AND user='".$CURUSER['username']."' AND UNIX_TIMESTAMP()-UNIX_TIMESTAMP(date) < 30";





Find:





$query = "INSERT INTO shoutbox (msgid, user, message, date, userid) VALUES (NULL, '".$CURUSER['username']."', '".unesc($shbmsg)."', '".get_date_time()."', '".$CURUSER['id']."')";





Replace with:





$query = "INSERT INTO staff_shoutbox (msgid, user, message, date, userid) VALUES (NULL, '".$CURUSER['username']."', '".unesc($_POST['message'])."', '".get_date_time()."', '".$CURUSER['id']."')";
Unknown User
2008-08-10 14:53:33
Quote:
if ($site_config['STAFFSHOUTBOX'] && $CURUSER["class"] > 4){
really you should use: $CURUSER["control_panel"] == "yes" not $CURUSER["class"]
Unknown User
2008-08-10 15:08:34
"TorrentialStorm, post: 45403":
really you should use: $CURUSER["control_panel"] == "yes" not $CURUSER["class"]


Thank you  :blink:
Unknown User
2008-09-29 21:43:38
can i have a printscreen of what it is like please thank you :)
Unknown User
2008-10-09 16:42:06
image?
Unknown User
2008-10-09 20:30:00
not need any image

it's a clone of the shoutbox but only staff can see it

if you're on staff you see 2 box otherwise you just see one
Unknown User
2008-11-12 20:52:50
hello all

I need help to move ths additionnal shoutbox  in admin_cp can you help me ?
Unknown User
2008-11-14 16:08:42
delete the change in index.php and add it in admincp.php before first:

begin_frame
Unknown User
2008-11-17 16:55:53
"OGGY, post: 45379":
I found my problem to modify the code:


Replace with:

Find:

$query = "SELECT COUNT(*) FROM shoutbox WHERE message='".$shbmsg."' AND user='".$CURUSER['username']."' AND UNIX_TIMESTAMP()-UNIX_TIMESTAMP(date) < 30";
Replace with:




$query = "SELECT COUNT(*) FROM staff_shoutbox WHERE message='".$_POST['message']."' AND user='".$CURUSER['username']."' AND UNIX_TIMESTAMP()-UNIX_TIMESTAMP(date) < 30";





Find:





$query = "INSERT INTO shoutbox (msgid, user, message, date, userid) VALUES (NULL, '".$CURUSER['username']."', '".unesc($shbmsg)."', '".get_date_time()."', '".$CURUSER['id']."')";





Replace with:





$query = "INSERT INTO staff_shoutbox (msgid, user, message, date, userid) VALUES (NULL, '".$CURUSER['username']."', '".unesc($_POST['message'])."', '".get_date_time()."', '".$CURUSER['id']."')";



it works now   :D

I make this change but i receive this message now:

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/mister23/domains/xpresstorrent.com/public_html/staff_shoutbox.php on line 39
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 9
  • Members: 0
  • Guests online: 9
  • Comments: 3
  • Messages: 1,728