| Server IP : 208.122.213.31 / Your IP : 216.73.216.45 Web Server : Apache System : Linux msd6191.mjhst.com 4.18.0-553.137.1.el8_10.x86_64 #1 SMP Wed Jun 24 11:40:24 UTC 2026 x86_64 User : WHMCS_MIA_382 ( 1001) PHP Version : 7.4.33 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/httpd/html/baberankings.com.bak/members/modules/forums/admin/ |
Upload File : |
<?
/* K-Rate
(C) Rinalds Uzkalns, 2003-2004. All Rights Reserved
http://turn-k.net
Version: 1.00 (22.09.04)
*/
?>
<? admin_header('Manage Moderators'); ?>
<?
//add moderators
if ($en['act'] == 'add') {
if ($en['for'] == 0) {$sel = "f_id=$en[forum]";}
elseif ($en['for'] == 1) {$sel = "f_group=$en[group]";}
elseif ($en['for'] == 2) {$sel = "f_id=f_id";}
//search for user
$res = sql_query("SELECT * FROM $membtable WHERE m_user='$en[user]'");
if (sql_num_rows($res) == 0) {
echo '<font color=red><B>Member <u>'.$en['user'].'</u> not found!</b></font><Br>';
} else {
$line = sql_fetch_assoc($res);
$res = sql_query("SELECT * FROM $forumtable WHERE $sel");
while ($l = sql_fetch_assoc($res)) {
$rez = sql_query("SELECT * FROM $fmodstable WHERE mod_forum=$l[f_id] AND mod_id=$line[m_id]");
if (sql_num_rows($rez) == 0) {
sql_query("INSERT INTO $fmodstable (mod_forum, mod_member) VALUES ($l[f_id], $line[m_id])");
$adcnt++;
}
}
echo '<b>User <u>'.$en['user'].'</u> has been set as moderator for '.(int)$adcnt.' forums<br><br></b>';
}
}
//delete moderators
if ($en['act'] == 'save' && is_array($_POST['del'])) {
foreach ($_POST['del'] as $key => $value)
if ($value == 'ON') {
sql_query("DELETE FROM $fmodstable WHERE mod_member=$key".($en['all'] != 'ON' ? " AND mod_forum=$en[forum]" : ''));
$adcnt += sql_affected_rows();
}
echo '<b><u>'.(int)$adcnt.'</u> moderators has been removed</b><br><br>';
}
$fline = sql_fetch_assoc(sql_query("SELECT * FROM $forumtable LEFT JOIN $fgrouptable ON g_id=f_group WHERE f_id=$en[forum]"));
?>
<table>
<tr><Td><b>Group:</b></td><td><? echo $fline['g_name']; ?></td></tr>
<tr><Td><b>Forum:</b></td><td><? echo $fline['f_name']; ?></td></tr>
</table>
<form action=index.php method=post>
<input type=hidden name=req value=forum_moderators>
<input type=hidden name=act value=save>
<input type=hidden name=forum value=<? echo $en['forum']; ?>>
<?
$res = sql_query("SELECT * FROM $fmodstable LEFT JOIN $membtable ON mod_member=m_id WHERE mod_forum=$en[forum]");
echo '<b>'.sql_num_rows($res).'</b> moderators found for this forum<br><br>';
echo '<table>';
while ($line = sql_fetch_assoc($res))
echo "<tr><td><input type=checkbox value=ON name=del[{$line[mod_id]}] id=del[{$line[mod_id]}]></td><td><label for=del[{$line[mod_id]}]>$line[m_user]</label></td></tr>";
echo '</table><br>';
if (sql_num_rows($res) > 0)
echo "<br><input type=checkbox name=all value=ON id=all> <label for=all>Delete From All Forums</label> <input type=submit name=sm value='Delete Selected'></form><hr>";
?>
<form action=index.php method=post>
<input type=hidden name=req value=forum_moderators>
<input type=hidden name=act value=add>
<input type=hidden name=forum value=<? echo $en['forum']; ?>>
<input type=hidden name=group value=<? echo $fline['f_group']; ?>>
<b><u>Add New Moderator</u></b><Br>
<Table>
<tr><Td>Enter username:</td><td> <input type=text name=user size=20></td></tr>
<tr><Td>Apply moderator rights for:</td><td> <select name=for><option value=0>Current Forum Only (<? echo $fline['f_name']; ?>)</option>
<option value=1>All Forums In Current Group (<? echo $fline['g_name']; ?>)</option>
<option value=2>All Forums</option>
</select></td></tr>
</table><br>
<input type=submit name=sm value='Add Moderator'>
</form>