" . "TypeNameTime AliveSizeSe.Le.Upl.\n" . "Downl.Ratio\n"; while ($arr = mysql_fetch_assoc($res)) { /* if ($arr["downloaded"] > 0) { $ratio = number_format($arr["uploaded"] / $arr["downloaded"], 3); $ratio = "$ratio"; } else if ($arr["uploaded"] > 0) $ratio = "Inf."; else $ratio = "---"; */ $catimage = htmlspecialchars($arr["cat_stylesheet"]); $catname = htmlspecialchars($arr["catname"]); //$ttl = floor((gmtime() - $arr["added"]) / 3600); $ttl = $arr['time_alive']; if ($ttl == 1) $ttl .= "
hour"; else $ttl .= "
hours"; $size = str_replace(" ", "
", mksize($arr["size"])); $uploaded = str_replace(" ", "
", mksize($arr["uploaded"])); $downloaded = str_replace(" ", "
", mksize($arr["downloaded"])); $seeders = number_format($arr["seeders"]); $leechers = number_format($arr["leechers"]); $ret .= "\"$catname\"\n" . "" . htmlspecialchars($arr["torrentname"]) . "$ttl$size$seeders$leechers$uploaded\n" . "$downloaded".$arr['ratio']."\n"; } $ret .= "\n"; return $ret; } $id = (int) $_GET["id"]; if (!is_valid_id($id)) bark("Bad ID"); $r = @do_mysql_query("SELECT *, users.id as uid, users.anonymous, CEILING(users.comments / CEILING( ( UNIX_TIMESTAMP() - UNIX_TIMESTAMP(added) ) / 86400 ) ) as comments_per_day, CEILING(users.posts / CEILING( (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(added)) / 86400 )) as posts_per_day, CEILING(users.downloaded / CEILING( (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(added)) / 86400 )) as download_per_day, CEILING(users.uploaded / CEILING( (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(added)) / 86400 )) as upload_per_day, IF( users.downloaded > 0, ROUND(users.uploaded / users.downloaded, 3), '---') as ratio, IF( users.added = '0000-00-00 00:00:00', 'N/A', users.added) as joindate, IF( users.last_access = '0000-00-00 00:00:00', 'Never', users.last_access) as user_last_seen, IF( users.last_check = '0000-00-00 00:00:00', 'Never', users.last_check) as user_last_check, IF( ISNULL(countries.flagpic) <> 0, ' ', CONCAT('\"',') ) as country, IF( users.enabled = 'yes', 1, 0 ) as user_is_enabled, IF( users.avatar = '', ' ', CONCAT('') ) as avatar_url, IF( users.donor = 'yes', '\"Donor\"', '' ) as donor_img, IF( users.warned = 'yes', '\"Warned\"', '' ) as warned_img, UNIX_TIMESTAMP(added) as utadded, UNIX_TIMESTAMP(last_access) as utlast_access, UNIX_TIMESTAMP(last_check) as utlast_check FROM users LEFT JOIN countries ON countries.id = users.country WHERE users.id=".$id) or sqlerr(); $user = mysql_fetch_array($r) or bark("No user with ID"); if ($user["status"] == "pending") bark("Still pending."); if ($user["ip"] && (get_user_class() >= UC_MODERATOR || $user["uid"] == $CURUSER["id"])) { $ip = $user["ip"]; $addr = $ip; //Like i care about there reverse DNS, commented out. /* $dom = @gethostbyaddr($user["ip"]); if ($dom == $user["ip"] || @gethostbyname($dom) != $user["ip"]) $addr = $ip; else { $dom = strtoupper($dom); $domparts = explode(".", $dom); $domain = $domparts[count($domparts) - 2]; $addr = $ip.' ('.$dom.')'; } */ if( $GLOBALS['settings']['mod_snatched'] ) { $r = mysql_query("SELECT snatched.torrent_name as name, snatched.torrentid as id, snatched.torrent_category as category, snatched.uploaded, snatched.downloaded, IF( snatched.downloaded > 0, ROUND(snatched.uploaded / snatched.downloaded, 3), '---') as snatched_ratio, snatched.completedat, snatched.last_action, torrents.seeders, torrents.leechers, categories.name as categories_name, categories.image as categories_image FROM snatched LEFT JOIN torrents ON torrents.id = snatched.torrentid LEFT JOIN categories ON categories.id = snatched.torrent_category WHERE snatched.finished='yes' AND userid=".$id." ORDER BY torrent_name") or sqlerr(); if (mysql_num_rows($r) > 0) { $completed = "\n" . "\n"; while ($a = mysql_fetch_assoc($r)) { $ratio = "".$a['snatched_ratio'].""; $uploaded =mksize($a["uploaded"]); $downloaded = mksize($a["downloaded"]); $cat = "\"".$a['name']."\""; $completed .= "" . "\n"; } $completed .= "
"._('Type').""._('Name').""._('Seeders').""._('Leechers').""._('Uploaded').""._('Downloaded').""._('Ratio').""._('When Completed').""._('Last Action')."
$cat" . htmlspecialchars($a["name"]) . "$a[seeders]$a[leechers]$uploaded$downloaded$ratio$a[completedat]$a[last_action]
"; } } } $timezone = $user['joindate']; if( $timezone != 'N/A' ) $elapsed = ' ('.get_elapsed_time($user["utadded"]) . ' ago)'; $joindate = $timezone.$elapsed; $lastseen = ($user['user_last_seen'] != 'Never') ? $user['user_last_seen']." (" . get_elapsed_time($user["utlast_access"]) . " ago)" : $user['user_last_seen']; $last_check = $user['user_last_check']; if( $last_check != 'Never') $last_check .= " (" . get_elapsed_time($user['utlast_check']) . " ago)"; //if ($user['donated'] > 0) // $don = ""; $country = ''.$user['country'].' '; stdhead("Details for " . $user["username"]); echo '

'; echo ''.$country.'

'.$user['username']. $user['donor_img'].$user['warned_img'] . '

'; if (!$user['user_is_enabled']) echo '

This account has been disabled

'; elseif ($CURUSER["id"] <> $user["uid"]) { $r = do_mysql_query('SELECT id FROM friends WHERE userid='.$CURUSER['id'].' AND friendid='.$id) or sqlerr(__FILE__, __LINE__); $friend = mysql_num_rows($r); $r = do_mysql_query('SELECT id FROM blocks WHERE userid='.$CURUSER['id'].' AND blockid='.$id) or sqlerr(__FILE__, __LINE__); $block = mysql_num_rows($r); if ($friend > 0) echo '

(remove from friends)

'; elseif($block > 0) echo '

(remove from blocks)

'; else { echo '

(add to friends)'; echo ' - (add to blocks)

'; } } if ($_GET["delete"]) { if (get_user_class() >= UC_MODERATOR && $user['invites'] > 0 || $user["uid"] == $CURUSER["id"]) { $deleted = (int) $_GET["delete"]; if (!is_valid_id($deleted)) bark("Bad ID $deleted."); do_mysql_query("DELETE FROM users WHERE id = $deleted AND status = 'pending' AND invited_by = " . $user["uid"] . ""); $invites = $user["invites"] +1; do_mysql_query("UPDATE users SET invites='$invites' WHERE id = " . $user["uid"] . ""); } } $invitees = do_mysql_query("SELECT id, username, email, uploaded, downloaded, added, status, IF( users.downloaded > 0, ROUND(users.uploaded / users.downloaded, 3), '---') as ratio FROM users WHERE invited_by=" . $user["uid"] . " ORDER BY status DESC") or sqlerr(__FILE__, __LINE__); $numbinvitees = mysql_num_rows($invitees); begin_main_frame(); ?> = UC_MODERATOR) echo ''; if ($addr) echo ''; //////// admins and curuser only /////// if (get_user_class() >= UC_MODERATOR || $user["id"] == $CURUSER["id"]) { echo ''; echo ''; } if (get_user_class() >= UC_MODERATOR && $user['invited_by'] > 0 || $user['uid'] == $CURUSER['id'] && $user['invited_by'] > 0) { $invited_by = do_mysql_query("SELECT username FROM users WHERE id=".$user['invited_by']); $invited_by2 = mysql_fetch_array($invited_by); echo ''; } if (get_user_class() >= UC_MODERATOR || $user["uid"] == $CURUSER["id"]) { if (!$_GET["invites"]) { tr('Invites
',' [Given]'.$numbinvitees.'[Available]' . $user["invites"], 1); } elseif ($numbinvitees == 0) { tr('Invites
', '[Given]'.$numbinvitees.'[Available]' . $user["invites"], 1); } else { $s = '
Join date
Last seen
Last checked
Email'.$user['email'].'
Address'.$addr.'
Passkey'.$user['passkey'].'
Max. Torrents'.$user['maxtorrents'].'
Invited by'.$invited_by2['username'].'
'; while ($subrow = mysql_fetch_assoc($invitees)) { /* if ($subrow["downloaded"] > 0) { $ratio = number_format($subrow["uploaded"] / $subrow["downloaded"], 3); $ratio = ''.$ratio.''; } else if ($subrow["uploaded"] > 0) $ratio = "Inf."; else $ratio = "---"; */ if ($subrow["status"] == 'confirmed') { $s .= ""; } else { $delete = $subrow["id"]; $s .= ""; } } $s .= "
EmailAddedUserRatioUploadedDownloaded
" . $subrow["email"] . "" . $subrow["added"] . "" . $subrow["username"] . "" . $subrow['ratio'] . "" . mksize($subrow["uploaded"]) . "" . mksize($subrow["downloaded"]) . "
" . $subrow["email"] . "" . $subrow["added"] . "[Delete]
"; tr("Invitees
[Hide list]", $s, 1); } } if ($user["uid"] == $CURUSER["id"] || get_user_class() >= UC_MODERATOR) { ?> Uploaded (/Day) Downloaded (/Day) 0) { $sr = $user['ratio']; if ($sr >= 4) $s = "w00t"; else if ($sr >= 2) $s = "grin"; else if ($sr >= 1) $s = "smile1"; else if ($sr >= 0.5) $s = "noexpression"; else if ($sr >= 0.25) $s = "sad"; else $s = "cry"; //$sr = floor($sr * 1000) / 1000; $sr = '
' . number_format($sr, 3) . '
'; echo 'Share ratio'.$sr.''; } //if ($user['donated'] > 0 && (get_user_class() >= UC_MODERATOR || $CURUSER["id"] == $user["uid"])) // print("Donated$$user[donated]\n"); echo 'Avatar'.$user['avatar_url'].''; print("Class" . get_user_class_name($user["class"]) . "\n"); print("Gender".$user['gender']."\n"); print("Age".$user['age']."\n"); if ($user["website"]) print("Website$user[website]\n"); print("Torrent comments"); if ($user['comments'] && (($user["class"] >= UC_POWER_USER && $user["uid"] == $CURUSER["id"]) || get_user_class() >= UC_MODERATOR)) echo ''.$user['comments'].' ('.(int) $user['comments_per_day'].'/Day)'; else echo ''.$user['comments'].' ('.(int) $user['comments_per_day'].'/Day)'; print("Forum posts"); if ($user['posts'] && (($user["class"] >= UC_POWER_USER && $user["uid"] == $CURUSER["id"]) || get_user_class() >= UC_MODERATOR)) echo ''.$user['posts'].' ('.(int) $user['posts_per_day'].'/Day)'; else echo ''.$user['posts'].' ('.(int) $user['posts_per_day'].'/Day)'; if($user["anonymous"] == "no") $viewprof = true; elseif($CURUSER["id"] == $user['id'] OR get_user_class() >= UC_MODERATOR) $viewprof = true; else $viewprof = false; if( $viewprof ) { $uploaded = do_mysql_query("SELECT t.id, t.name, t.seeders, t.leechers, c.name as cat_name, c.image as cat_image FROM torrents t LEFT JOIN categories c ON t.category = c.id WHERE t.owner=$id ORDER BY t.name") or sqlerr(); $numbuploaded = mysql_num_rows($uploaded); if (get_user_class() >= UC_MODERATOR || $user["uid"] == $CURUSER["id"]) { if (!$_GET["uploaded"]) { tr("Uploaded torrents
"," [Show]  - $numbuploaded", 1); } elseif ($numbuploaded == 0) tr("Uploaded torrents
"," [Show]  - $numbuploaded", 1); else { $torrents = "\n"; $torrents.="\n"; while ($a = mysql_fetch_array($uploaded)) { $cat = ''.$a['cat_name'].''; $torrents .= "" . "\n"; } $torrents .= "
TypeNameSeedersLeechers
$cat" . htmlspecialchars($a["name"]) . "$a[seeders]$a[leechers]
\n"; tr("Uploaded torrents
[Hide list]", $torrents, 1); } $res = do_mysql_query("SELECT torrent, added, uploaded, downloaded, torrents.name as torrentname, categories.stylesheet AS cat_stylesheet, categories.name as catname, size, image, category, seeders, leechers, CEILING( (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(added)) / 3600) as time_alive FROM peers LEFT JOIN torrents ON peers.torrent = torrents.id LEFT JOIN categories ON torrents.category = categories.id WHERE userid=$id AND seeder='yes'") or sqlerr(); if (mysql_num_rows($res) > 0) $seeding = maketable($res); $numbseeding = mysql_num_rows($res); if (!$_GET["seeding"]) { tr("Currently seeding
"," [Show]  - $numbseeding", 1); } elseif ($numbseeding == 0) tr("Currently seeding
"," [Show]  - $numbseeding", 1); else { tr("Currently seeding
[Hide list]", $seeding, 1); } $res = do_mysql_query("SELECT torrent, added, uploaded, downloaded, torrents.name as torrentname, categories.stylesheet AS cat_stylesheet, categories.name as catname, size, image, category, seeders, leechers, CEILING( (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(added)) / 3600) as time_alive FROM peers LEFT JOIN torrents ON peers.torrent = torrents.id LEFT JOIN categories ON torrents.category = categories.id WHERE userid=$id AND seeder='no'") or sqlerr(); if (mysql_num_rows($res) > 0) $leeching = maketable($res); $numbleeching = mysql_num_rows($res); if (!$_GET["leeching"]) { tr("Currently leeching
"," [Show]  - $numbleeching", 1); } elseif ($numbleeching == 0) tr("Currently leeching
"," [Show]  - $numbleeching", 1); else { tr("Currently seeding
[Hide list]", $leeching, 1); } } tr("Completed: ",$completed,1); } if ($user["info_parsed"]) print("" . $user["info_parsed"] . "\n"); if ($CURUSER["id"] != $user["uid"]) if (get_user_class() >= UC_MODERATOR) $showpmbutton = 1; elseif ($user["acceptpms"] == "yes") { $r = do_mysql_query("SELECT id FROM blocks WHERE userid=".$user['uid']." AND blockid=".$CURUSER['id']) or die(mysql_error()); //sqlerr(__FILE__,__LINE__); $showpmbutton = (mysql_num_rows($r) == 1 ? 0 : 1); } elseif ($user["acceptpms"] == "friends") { $r = do_mysql_query("SELECT id FROM friends WHERE userid=".$user['uid']." AND friendid=".$CURUSER['id']) or sqlerr(__FILE__,__LINE__); $showpmbutton = (mysql_num_rows($r) == 1 ? 1 : 0); } if ($showpmbutton) print("
"); print("\n"); if (get_user_class() >= UC_MODERATOR && $user["class"] < get_user_class()) { begin_frame("Edit User", true); print("
\n"); print("\n"); print("\n"); print("\n"); print("\n"); print("\n"); $avatar = htmlspecialchars($user["avatar"]); print("\n"); print("\n"); // we do not want mods to be able to change user classes or amount donated... if ($CURUSER["class"] < UC_ADMINISTRATOR) print("\n"); else { print("\n"); } if (get_user_class() == UC_MODERATOR && $user["class"] > UC_VIP) printf("\n"); } print("\n"); print("\n"); print("\n"); print("\n"); print("\n"); $modcomment = htmlspecialchars($user["modcomment"]); $supportfor = htmlspecialchars($user["supportfor"]); print("\n"); print("\n"); print("\n"); $warned = ($user["warned"] == "yes"); print(""); if ($warned) { $warneduntil = $user['warneduntil']; if ($warneduntil == '0000-00-00 00:00:00') print("\n"); else { print("\n"); } } else { print("\n"); print(""); } print("\n"); print(""); print("\n"); print("
Title
Avatar URL
Passkey Reset passkey Delete old passkeys
DonorYes No
Class
Max. Torrents
Uploaded
Downloaded
Invites
Donated
SupportYes No
Support for:
Comment
Warned " . ( $warned ? "YesNo" : "No" ) ."(arbitrary duration)
Until $warneduntil"); print(" (" . mkprettytime(strtotime($warneduntil) - gmtime()) . " to go)
Warn for        PM comment:
EnabledYes No
\n"); print("
\n"); end_frame(); } end_main_frame(); stdfoot(); ?>