Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Mods & Themes (http://www.bvlist.com/forumdisplay.php?f=109)
-   -   [MOD] Shoutbox Posts Edit (http://www.bvlist.com/showthread.php?t=11131)

Chez 30th April 2017 14:43

[MOD] Shoutbox Posts Edit
 
Hello again guys! I don't know if this mod it's already posted here but maybe this will be useful to somebody. Just a short description: this will let you edit every user post in shoutbox or you can let every user edit their own post.

IN SHOUTBOX.PHP /// AFTER THIS:

PHP Code:

if (($showshoutbox == 'no' OR $showshoutbox == 'staffonly') AND (get_user_class() < UC_MODERATOR))
stderr("Error","Permission denied.");
unset(
$insert);
$insert=false

ADD THIS:

PHP Code:

// EDIT SHOUT ?
if (isset($_GET['edit']) && get_user_class() >= UC_MODERATOR && is_valid_id($_GET['edit']))
{
$sql=mysql_query("SELECT id,text FROM shoutbox WHERE id=".sqlesc($_GET['edit']));
$res=mysql_fetch_array($sql); 

THEN AFTER THIS:

PHP Code:

if ($rowowner["class"] == "10")
$usercolor"<font color=#8b0000>" .htmlspecialchars($rowowner["username"]). "</font>";
elseif (
$rowowner["class"] == "9")
$usercolor"<font color=#FF0000>" .htmlspecialchars($rowowner["username"]). "</font>";
elseif (
$rowowner["class"] == "8")
//if ($rowowner["class"] == "8")
$usercolor"<font color=#3300FF>" .htmlspecialchars($rowowner["username"]). "</font>";
elseif (
$rowowner["class"] == "7")
$usercolor"<font color=#ce00cc>" .htmlspecialchars($rowowner["username"]). "</font>";
elseif (
$rowowner["class"] == "6")
$usercolor"<font color=#03baef>" .htmlspecialchars($rowowner["username"]). "</font>";
elseif (
$rowowner["class"] == "5")
$usercolor"<font color=#93e7ff>" .htmlspecialchars($rowowner["username"]). "</font>";
elseif (
$rowowner["class"] == "4")
$usercolor"<font color=#08cf32>" .htmlspecialchars($rowowner["username"]). "</font>";
elseif (
$rowowner["class"] == "3")
$usercolor"<font color=#560aa4>" .htmlspecialchars($rowowner["username"]). "</font>";
elseif (
$rowowner["class"] == "2")
$usercolor"<font color=#ceff0a>" .htmlspecialchars($rowowner["username"]). "</font>";
elseif (
$rowowner["class"] == "1")
$usercolor"<font color=#ff780a>" .htmlspecialchars($rowowner["username"]). "</font>";
elseif (
$rowowner["class"] == "0")
$usercolor"<font color=#999999>" .htmlspecialchars($rowowner["username"]). "</font>";
if (
$arr["userid"] == '0'

ADD THIS IF YOU WANT TO LET EVERY USER TO EDIT HIS OWN POST:

PHP Code:

$edit="<span class='date'><a href=shoutbox.php?edit=".$arr[id]."><img src=pic/pencil.png height='14' widht='14' border=0></a></span>\n"

OR THIS TO ALLOW ONLY MODS OR HIGHER CLASS

PHP Code:

if (get_user_class() >= UC_MODERATOR) {
$edit="<span class='date'><a href=shoutbox.php?edit=".$arr[id]."><img src=pic/pencil.png height='14' widht='14' border=0></a></span>\n";




NOW LOOK FOR THIS:

PHP Code:

if($i%== 0)
$bg 'bgcolor=#ffffff';
else
$bg 'bgcolor=#f1f1f';
print(
"<tr><td><font color=gray><span class='date'>".strftime("%d.%m | %H:%M",$arr["date"]).":.</font>
$del$pm$reply 


AND AFTER $del$pm$reply ADD $edit

That's all!


All times are GMT +2. The time now is 13:28.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.