I have transformed the 'Hide Shoutbox' mod because nobody wants to use it in 'Shoutbox Banned' that's is very useful.
Additionally I created a new function in 'Staff CP' called 'Punished Users' where you can see all members banned on the Shoutbox and/or Forum.
In account.php search the line that contain the following code:
In account-details.php search the line that contain the following code:
Upload the attached image in: images/admin folder, in your root.
Additionally I created a new function in 'Staff CP' called 'Punished Users' where you can see all members banned on the Shoutbox and/or Forum.
In account.php search the line that contain the following code:
<input type='checkbox' name='hideshoutbox' value='yes' ".($CURUSER['hideshoutbox'] == 'yes' ? 'checked="checked"' : '')."
Delete entire line.In account-details.php search the line that contain the following code:
<input name='forumbanned' value='yes' type='radio' " . ($forumbanned ? " checked='checked'" : "") . " />Yes <input name='forumbanned' value='no' type='radio' " . (!$forumbanned ? " checked='checked'" : "") . " />No</td>
Add after this, a new line:
print("<tr><td>Shoutbox Banned:</td><td align='left'><input type='checkbox' name='hideshoutbox' value='yes' ".($user['hideshoutbox'] == 'yes' ? 'checked="checked"' : '')." /></td></tr>\n");
In admin-modtasks.php search:
$forumbanned = sqlesc($_POST["forumbanned"]);
Add after:
$hideshoutbox = sqlesc($_POST["hideshoutbox"]);
In the most long line that begin with:
SQL_Query_exec("UPDATE users SET email='$email', title=$title, downloaded='$downloaded', uploaded='$uploaded', ...
Add:
hideshoutbox=$hideshoutbox
In index.php search:
printf(T_("SHOUTBOX_REFRESH"), 5)."<br />";
end_frame();
}
Replace with:
printf(T_("SHOUTBOX_REFRESH"), 5)."<br />";
end_frame();
} else {
begin_frame(T_("SHOUTBOX"));
print("<div class='f-border comment' align='center'>
<div style='margin-top:10px; margin-bottom:10px'><b><font size='2'><font color='red'>Access Denied.</font> You are banned on ShoutBox!</font><b></div>
</div>");
end_frame();
}
In admincp.php, for Staff CP, add the following command line:
<td align="center"><a href="admincp.php?action=punished"><img src="images/admin/punished.png" border="0" width="32" height="32"><BR>Punished Users</a><BR></td>
On the most bottom place, before ?> copy the following code:
#======================================================================#
# Punished members - Added by BigMax (12-11-2012)
#======================================================================#
if ($action == "punished")
{
stdhead("Punished members");
navmenu();
$punished = number_format(get_row_count("users", "WHERE hideshoutbox='yes' || forumbanned='yes'"));
$shoutbox_banned = number_format(get_row_count("users", "WHERE hideshoutbox='yes'"));
$forum_banned = number_format(get_row_count("users", "WHERE forumbanned='yes'"));
begin_frame("Punished members: $punished", true);
print("<div style='margin-top:15px' align=center><font size=2>List of members that are banned on <b>ShoutBox</b> and/or <b>Forum</b>, order by join date.</font></div>");
print("<div style='margin-top:10px; margin-bottom:10px' align=center>Bans on ShoutBox: <b>$shoutbox_banned</b> Bans on Forum: <b>$forum_banned</b></div>");
$count = get_row_count("users", "WHERE hideshoutbox='yes' || forumbanned='yes'");
if ($count == 0)
print("<div style='margin-bottom:15px' align=center><font size=2><b>No punished members!</b></font></div>");
else { list($pagertop, $pagerbottom, $limit) = pager(25, $count, "admincp.php?action=punished&"); }
$res = SQL_Query_exec("SELECT * FROM users WHERE hideshoutbox='yes' || forumbanned='yes' AND status='confirmed' ORDER BY users.added $limit");
$num = mysql_num_rows($res);
print("<div align=center>$pagertop</div>");
print("<table class=table_table border=1 cellspacing=0 cellpadding=4 align=center>\n");
print("<tr>
<td class=table_head><b>User name</b></td>
<td class=table_head><b>User class</b></td>
<td class=table_head align=center><b>Registered</b></td>
<td class=table_head align=center><b>Last access</b></td>
<td class=table_head align=center><b>Downloaded</b></td>
<td class=table_head align=center><b>Uploaded<b></td>
<td class=table_head align=center><b>Ratio</b></td>
<td class=table_head align=center><b>ShoutBox<br /><small>Banned</small></b></td>
<td class=table_head align=center><b>Forum<br /><small>Banned</small></b></td>
</tr>\n");
for ($i = 1; $i <= $num; $i++){
$arr = mysql_fetch_assoc($res);
if ($arr['added'] == '0000-00-00 00:00:00')
$arr['added'] = '---';
if ($arr['last_access'] == '0000-00-00 00:00:00')
$arr['last_access'] = '---';
if ($arr['hideshoutbox'] == 'yes'){
$arr['hideshoutbox'] = '<font color=red><b>Yes</b></font>';
} else {
$arr['hideshoutbox'] = '<font color=limegreen><b>No</b></font>';
}
if ($arr['forumbanned'] == 'yes'){
$arr['forumbanned'] = '<font color=red><b>Yes</b></font>';
} else {
$arr['forumbanned'] = '<font color=limegreen><b>No</b></font>';
}
if($arr["downloaded"] != 0){
$ratio = number_format($arr["uploaded"] / $arr["downloaded"], 3);
} else {
$ratio="---";
}
$ratio = "<font color=" . get_ratio_color($ratio) . ">$ratio</font>";
$class=get_user_class_name($arr["class"]);
$added = substr($arr['added'],0,10);
$last_access = substr($arr['last_access'],0,10);
$downloaded = mksize($arr["downloaded"]);
$uploaded = mksize($arr["uploaded"]);
print("<tr>
<td class=table_col1 align=left><a href=account-details.php?id=$arr[id]><b>$arr[username]</b></a></td>
<td class=table_col2 align=left>$class</td>
<td class=table_col1 align=center>$added</td>
<td class=table_col2 class=table_col1 align=center>$last_access</td>
<td class=table_col1 align=center><font color=orangered>$downloaded</font></td>
<td class=table_col2 align=center><font color=limegreen>$uploaded</font></td>
<td class=table_col1 align=center>$ratio</td>
<td class=table_col2 align=center>$arr[hideshoutbox]</td>
<td class=table_col1 align=center>$arr[forumbanned]</td>
</tr>\n");
}
print("</table>\n");
print("<div align=center>$pagerbottom</div>");
end_frame();
stdfoot();
}
#======================================================================#
# End Punished members
#======================================================================#
Upload the attached image in: images/admin folder, in your root.
