This mod will add a warning (!) image to warned users. It was requested [url="
http://www.torrenttrader.org/index.php?showtopic=7843"]here[/url]. This code is based on a vanilla 2.02 install with the [url="
http://www.torrenttrader.org/index.php?showtopic=7249"]VIP/DONOR[/url] mod. Sorry for those of you who are just installing 2.03 but this will probably not work 100% since the VIP/DONOR mod will not work completely with 2.03.
You will need to apply the VIP/DONOR mod before this one or it will not work!. Tested in a development environment, not production.
There are no SQL modifications required for this mod. So first, let's start with the comments...
In functions.php, find:
if ($row["donated"] > 0) { $donated = "<img src=images/star.gif border=0>"; } else { $donated = ""; }
Under, add:
if ($row["warned"] != "no") { $warned = "<img src=images/warned.gif border=0>";}
Next, find (twice):
<b>$postername $donated</b>
Replace with:
<b>$postername $donated $warned</b>
That's it for comments. Next, we do the blocks.
In onlineusers_block.php, find:
$usersonlinequery = mysql_query("SELECT id, username, class, donated FROM users WHERE privacy !='strong' AND UNIX_TIMESTAMP(" . get_dt_num() . ") - UNIX_TIMESTAMP(users.last_access) < 900") or die(mysql_error());
Replace with:
$usersonlinequery = mysql_query("SELECT id, username, class, donated, warned FROM users WHERE privacy !='strong' AND UNIX_TIMESTAMP(" . get_dt_num() . ") - UNIX_TIMESTAMP(users.last_access) < 900") or die(mysql_error());
find:
if ($user["donated"] > 0) { $star = " <img src=images/star.gif border=0>"; } else {
$star = ""; }
Under, add:
if ($user["warned"] != "no") { $warned = " <img src=images/warned.gif border=0>"; }
Find:
</font></a>$star, "
Replace with:
</font></a>$star$warned, "
login_block.php:
find:
if ($CURUSER["donated"] > 0) { $star = " l<img src=images/star.gif border=0>"; }
else { $star = ""; }
begin_block("".$CURUSER[username]."$star");
Replace with:
if ($CURUSER["donated"] > 0) { $star = " l<img src=images/star.gif border=0>";}
if ($CURUSER["warned"] != "no") { $warned = " l<img src=images/warned.gif border=0>";}
begin_block("".$CURUSER[username]."$star $warned");
On to the shoutbox...
find:
$a = mysql_query("SELECT class, donated FROM `users` WHERE id = $row[userid] ");
Replace with:
$a = mysql_query("SELECT class, donated,warned FROM `users` WHERE id = $row[userid] ");
find:
if ($a["1"] > 0) { $star = " <img src=images/star.gif border=0>"; }
else { $star = ""; }
echo '</td><td style="font-size: 12px; padding-left: 5px"><a
href="'.$site_config['SITEURL'].'/account-details.php?id='.$row['userid'].'"
target="_parent"><b>'.$user.' '.$star.':</b></a> '.nl2br(format_comment($row['message']));
Replace with:
if ($a["1"] > 0) { $star = " <img src=images/star.gif border=0>"; }
if ($a["2"] != "no") { $warned = " <img src=images/warned.gif border=0>"; }
echo '</td><td style="font-size: 12px; padding-left: 5px"><a
href="'.$site_config['SITEURL'].'/account-details.php?id='.$row['userid'].'"
target="_parent"><b>'.$user.' '.$star.' '.$warned.':</b></a> '.nl2br(format_comment($row['message']));
That should be it. I realized while writing this that quite a few things changed in 2.03 and the VIP/DONOR mod might not work 100% anymore... when I get some time I'll try to update it and maybe integrate it with this one. As usual, let me know of problems and I'll see what I can do.