this mod clashing with admin task. otherwise it is very good mod. problem is suppose i am going to change the rank of user id=58 selected power user thn click on submit after page refresh i got user id = 105/99/208( any other id which is not my selected) is now power user this is my account detail.php you can test it by uploading it in your site .
<?
//
// TorrentTrader v2.x
// This file was last updated: 26/December/2007
//
//
http://www.torrenttrader.org
//
//
require_once("backend/functions.php");
dbconn(false);
loggedinonly();
if($CURUSER["view_users"]=="no")
show_error_msg("Error","You do not have permission to view users",1);
stdhead("User CP");
$id = (int)$_GET["id"];
if (!is_valid_id($id))
show_error_msg("Can't show details", "Bad ID.",1);
$r = @mysql_query("SELECT * FROM users WHERE id=$id") or die(mysql_error());
$user = mysql_fetch_array($r) or show_error_msg("Can't show details", "No user with ID $id.",1);
//add invites check here
if (($user["enabled"] == "no" || ($user["status"] == "pending")) && $CURUSER["class"] < 4)
show_error_msg("Error", "Unable to access these details at this time, this user is not currently active<BR><BR>This user may have had their account disabled.",1);
//get all vars first
//$country
$res = mysql_query("SELECT name FROM countries WHERE id=$user[country] LIMIT 1") or die(mysql_error());
if (mysql_num_rows($res) == 1){
$arr = mysql_fetch_assoc($res);
$country = "$arr[name]";
}
//$Download speed
$res = mysql_query("SELECT name FROM speed WHERE id=$user[download] LIMIT 1") or die(mysql_error());
if (mysql_num_rows($res) == 1){
$arr = mysql_fetch_assoc($res);
$downloadspeed = "$arr[name]";
}
//$Upload Speed
$res = mysql_query("SELECT name FROM speed WHERE id=$user[upload] LIMIT 1") or die(mysql_error());
if (mysql_num_rows($res) == 1){
$arr = mysql_fetch_assoc($res);
$uploadspeed = "$arr[name]";
}
//$ratio
if ($user["downloaded"] > 0) {
$ratio = $user["uploaded"] / $user["downloaded"];
}else{
$ratio = "---";
}
//$numtorrents
$res = mysql_query("SELECT COUNT(*) FROM torrents WHERE owner=$id AND (torrents.team = 0 OR torrents.team = ".$CURUSER['team']. " OR ".$CURUSER['class']." = 8)") or die(mysql_error());
$arr = mysql_fetch_row($res);
$numtorrents = $arr[0];
//$numcomments
$res = mysql_query("SELECT COUNT(*) FROM comments WHERE user=$id") or die(mysql_error());
$arr = mysql_fetch_row($res);
$numcomments = $arr[0];
$avatar = htmlspecialchars($user["avatar"]);
if (!$avatar) {
$avatar = "".$site_config["SITEURL"]."/images/default_avatar.gif";
}
//Layout
///rang klass uploader/////
$rangclass1 = "<option value=0>---Uploader Rank---</option>\n";
$res28 = mysql_query("SELECT * FROM rangclass ORDER BY name") or sqlerr();
while ($rank = mysql_fetch_array($res28))
$rangclass1 .= "<option value=$rank[id]" . htmlspecialchars($user['rangclass'] == $rank['id'] ? " selected" : "") . ">$rank[name]</option>\n";
$res22 = mysql_query("SELECT name,rangpic FROM rangclass WHERE id=$user[rangclass] LIMIT 1") or sqlerr();
if (mysql_num_rows($res22) == 1)
{
$arr22 = mysql_fetch_assoc($res22);
$rangclass = "<img src=/torrent/images/$arr22[rangpic] alt=\"$arr22[name]\" title=\"$arr22[name]\" style='margin-left: 5pt' align=top></td>";
}
//////end rang klass//////
stdhead("User Details for " . $user["username"]);
begin_frame("User Details for " . $user["username"] . "");
if ($user["privacy"] != "strong" || ($CURUSER["control_panel"] == "yes")) {
?>
<table align="center" border="0" cellpadding="6" cellspacing="1" width="100%">
<tr>
<td width="50%" class="alt1"><B>Profile</B></td>
<td width="50%" class="alt1"><B>Additional Info</B></td>
</tr>
<tr valign="top">
<td align="left" class="alt2">
User Name: <?=htmlspecialchars($user["username"])?><BR>
User Class: <?=get_user_class_name($user["class"])?><BR>
Uploader Rank:<?=$rangclass?><BR>
Title: <I><?=htmlspecialchars($user["title"])?></I><BR>
Joined: <?=htmlspecialchars(utc_to_tz($user["added"]))?><BR>
Last Visit: <?=htmlspecialchars(utc_to_tz($user["last_access"]))?><BR>
Last Seen(Location): <?=htmlspecialchars($user["page"]);?><BR>
</td>
<td align="left">
Age: <?=htmlspecialchars($user["age"])?><BR>
Client: <?=htmlspecialchars($user["client"])?><BR>
Country: <?=$country?><BR>
Donated: $<?=htmlspecialchars($user["donated"])?><BR>
Warnings: <?=htmlspecialchars($user["warned"])?><BR>
<?if ($user["privacy"] == "strong"){ echo "Privacy: <b>Strong</b><BR>"; }?>
</td>
</tr>
<tr>
<td width="50%"><B>Statistics</B></td>
<td width="50%"><B>Other</B></td>
</tr>
<tr valign="top">
<td align="left">
Uploaded: <?=mksize($user["uploaded"])?><BR>
Downloaded: <?=mksize($user["downloaded"])?><BR>
Ratio: <?=$ratio?><BR>
Seedbonus: <?=($user["seedbonus"])?><BR>
Avg Daily DL: <?=mksize($user["downloaded"] / (DateDiff($user["added"], time()) / 86400))?><BR>
Avg Daily UL: <?=mksize($user["uploaded"] / (DateDiff($user["added"], time()) / 86400))?><BR>
Internet Speed: <img src="images/speed_up.png" alt="Download Speed" width="10" height="15" />
<? print("$uploadspeed") ?>
<img src="images/speed_down.png" alt="Upload Speed" width="10" height="15" />
<? print("$downloadspeed") ?><BR>
Torrents Posted: <?=$numtorrents?><BR>
Comments Posted: <?=$numcomments?><BR>
Reputation points : <?=htmlspecialchars($user["reputation"])?><br>
<?php
$total = $user["reputation"];
$nbrpics = $total / 10;
$nbrpics = (int) $nbrpics;
echo "<p>";
while ($nbrpics > 0) {
echo '<img src="images/reppoint.gif"> ';
$nbrpics = $nbrpics - 1;
}
echo "</p>";
if($CURUSER["id"] != $user["id"]) {
?>
<FORM method="post" action="takereppoints.php?id=<?=$user["id"]?>&comefrom=account">
<TABLE>
<tr>
<td>Select how many points to give :</td>
</tr>
<tr>
<td><INPUT type="submit" name="givepoints" value="Thanks with one point"></td>
<td></td>
</tr>
</TABLE>
</FORM>
<?php
}
?>
</td>
<td align="left">
<img src=<?=$avatar?>><BR>
<a href=mailbox.php?compose&id=<?=$user["id"]?>>Send PM</a><BR>
<!-- <a href=#>View Forum Posts</a><BR>
<a href=#>View Comments</a><BR> -->
<a href=report.php?user=<?=$user["id"]?>>Report Member</a><BR>
<a href=friends.php?user=<?=$user["id"]?>>Add to my Friends</a><BR>
<?php
if ($CURUSER["control_panel"] == "yes"){
echo "<a href='takeflush.php?id=$id'>Flush Peer</a>";
}
?>
</td>
</tr>
<?
//team
$res = mysql_query("SELECT name,image FROM teams WHERE id=$user[team] LIMIT 1") or die(mysql_error());
if (mysql_num_rows($res) == 1) {
$arr = mysql_fetch_assoc($res);
echo "<tr><td colspan=2 align=left><B>Team Member Of:</B><BR>";
echo"<img src='".htmlspecialchars($arr["image"])."'><BR>".sqlesc($arr["name"])."<BR><BR><a href=teams-view.php>[View Teams]</a></td></tr>";
}
?>
</table>
<?
}else{
echo "<B>This member has elected to keep their details private</B><br><br><a href=#>Report Member</a><BR>";
}
end_frame();
if ($user["privacy"] != "strong" || ($CURUSER["control_panel"] == "yes")) {
begin_frame("Local Activity");
begin_block("".CURRENTLY_SEEDING."");
$res = mysql_query("SELECT torrent,uploaded,downloaded FROM peers WHERE userid= '$id' AND seeder='yes'");
$cpt=mysql_num_rows($res);
$rpp = 20;//Nombre de r