Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
[MOD] Staff bookmarks
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2 Only Mods Complete

Unknown User
2008-01-21 11:01:03
Taken from [url="http://www.torrenttrader.org/index.php?showtopic=6015"]here[/url], requested [url="http://www.torrenttrader.org/index.php?showtopic=7661"]here[/url].

ALTER TABLE users ADD(addbookmark enum ('yes','no') NOT NULL default 'no');
ALTER TABLE `users` ADD `bookmcomment` TEXT NOT NULL;

in account-details.php

find:

<?php
require "backend/functions.php";

dbconn(true);

loggedinonly();

stdhead("Staff bookmark");

$id = 0 + $_GET["id"];

if (isset($_GET["delete"]) && ($_GET["delete"] != "yes")) {

show_error_msg("Delete user $id from staff bookmarks?", "Click <a href=adminbookmark.php?delete=yes&id=$id>here</a> to confirm",1);

}

if ($_GET["delete"] == "yes") {

mysql_query("UPDATE users SET addbookmark = 'no', bookmcomment = '' WHERE id = $id") or die (mysql_error());

show_error_msg("User removed", "User has been removed from staff bookmarks. <a href=adminbookmark.php>Go back</a>.",1);

}

$addbookmark = number_format(get_row_count("users", "WHERE addbookmark='yes'"));

begin_frame("<font color=2fdceb>($addbookmark) total bookmarked users</font>", true);

begin_table();

?>

<table cellpadding="4" cellspacing="1" border="0" style="width:800px" class="tableinborder" ><tr><td

class="tabletitle">ID</td><td class="tabletitle" align="left">Username</td><td class="tabletitle"

align="left">Comment</td><td class="tabletitle" align="left">Uploaded</td><td class="tabletitle"

align="left">Downloaded</td><td class="tabletitle" align="left">Ratio</td><td class="tabletitle"

align="center">Delete</td></tr>

<?

$res=mysql_query("SELECT id,username,bookmcomment,uploaded,downloaded FROM users WHERE addbookmark='yes' ORDER BY id") or

print(mysql_error());

while ($arr = @mysql_fetch_assoc($res)) {

if($arr["downloaded"] != 0){

$ratio = number_format($arr["uploaded"] / $arr["downloaded"], 3);

} else {

$ratio="---";

}

$ratio = "<font color=" . get_ratio_color($ratio) . ">$ratio</font>";

$uploaded = mksize($arr["uploaded"]);

$downloaded = mksize($arr["downloaded"]);

$uploaded = str_replace(" ", "<br>", mksize($arr["uploaded"]));

$downloaded = str_replace(" ", "<br>", mksize($arr["downloaded"]));

echo "<tr><td class=tablea >" . $arr[id] . "</td><td class=tablea align=\"left\"><b><a href=account-details.php?id=" .

$arr[id] . ">". $arr[username] . "</b></td><td class=tablea align=\"left\">" . $arr[bookmcomment] . "</a></td><td

class=tablea align=\"left\">" . $uploaded . "</td></a></td><td class=tablea align=\"left\">" .$downloaded. "</td><td

class=tablea align=\"left\">$ratio</td>

<td class=tablea align=\"center\"><a href=adminbookmark.php?delete=no&id=".$arr[id]."><img src=images/del.png border=0></a>

</td>

</tr>";

}

end_table();

end_frame();

stdfoot();

?>

In admincp.php, find:

<td align="center"><a href=admincp.php?action=style><img src="images/admin/themes.gif" border=0 width=32 

height=32><BR>Theme Management</a><BR></td>
below, add:
<td align="center"><a href=adminbookmark.php><img src="images/admin/staff_book.png" border=0 width=32

height=32><br>Bookmarked Users</a><BR></td>





rename the image staff_book.png and put it in the images/admin directory.

Enjoy!

PS: If anyone can confirm this works on 2.03, mods can move it to completed mods. I know it works on 2.00 and 2.01 just haven't tested it on a more recent release... though I don't see why it wouldn't work :)
staff_book.png
staff_book.png
Unknown User
2008-01-21 17:34:42
appears to work ezerbeth thank you so much for taking the time to post and convert this excellent mod  :)  the only thing I am noticing is there is no delete staff bookmark option in the adminbookmark.php that would be kinda handy right now you have to go to account details and uncheck bookmark and delete the comment kinda seems like unneeded steps thanks again for the great work  :P  and again to confirm is working on newest TT v 2.03
Unknown User
2008-01-21 21:18:11
Just updated the first post, get the new adminbookmark.php file  :)

And if a moderator feels like it, this can be moved to completed mods...
Unknown User
2008-01-22 02:12:44
wwo wo woow oooo exactly i wished as a sub categorie, gonna use this mod to list my trusted menbers, whom play the rules, so much thanks !!!





any way coul u help to alter class and add a sub categorie applied to all members






and could we get modo and s modos comments on torrents, with a pic , a small table placed on the torrent detail, sayiong " go this is good rip, good movie....APPROVED By ....yyy." ?





:)  :P
Unknown User
2008-01-22 02:26:57
thanks ezerbeth  :)  do you happen to have del.png for I can add this to admin images thanks for your great work on converting this mod to v2.03
Unknown User
2008-01-22 02:47:07
:
del.png
del.png
Unknown User
2008-01-22 06:08:48
thanks Ezerbeth working great!!!!you're the "man"!! :)
Unknown User
2008-02-10 18:01:03
hallo,

Fatal error: Call to undefined function get_ratio_color() in E:\xampp\htdocs\alt\adminbookmark.php on line 37

on line 37 is this one:

$ratio = "<font color=" . get_ratio_color($ratio) . ">$ratio</font>";

i have change to this:

//$ratio = "<font color=" . get_ratio_color($ratio) . ">$ratio</font>";

now, it
Unknown User
2008-02-10 19:09:41
thanks ezerbeth for do for TT v2 MY MOD, unfortunately,i have no time to do it and don't like very much TTv2

there is some optimizations we can do for this, maybe i will post theme if i found some times lol

:)
Unknown User
2008-02-10 22:35:51
Or just PM me so I can do it for you  :)

get_ratio_color, in functions.php:

function get_ratio_color($ratio)

 {

global $ratio;

if ($ratio < 0.1) return "#ff0000";

if ($ratio < 0.2) return "#ee0000";

if ($ratio < 0.3) return "#dd0000";

if ($ratio < 0.4) return "#cc0000";

if ($ratio < 0.5) return "#bb0000";  

if ($ratio < 0.6) return "#aa0000";

if ($ratio < 0.7) return "#990000";

if ($ratio < 0.8) return "#880000";

if ($ratio < 0.9) return "#770000";

if ($ratio < 1) return "#660000";

return "#000000";

 }
Unknown User
2008-11-18 01:06:48
works perfectly on v2.05 :D
Unknown User
2010-06-07 19:10:57
many thanks
Unknown User
2010-06-19 00:47:34
Thank you for the mod !

Just a small change in adminbookmark.php

find :

Quote:
loggedinonly();

add after :

Quote:
if (!$CURUSER || $CURUSER["control_panel"]!="yes"){show_error_msg("Error","Permission Denied!",1);

}
Unknown User
2011-11-03 02:28:06
it doesn't work in 2.07, i bookmarked a user, but i missed

signature='$signature', avatar='$avatar', ip='$ip',
only because i cannot find it in admin-modtask.php



this is my admin-modtask.php file




<?

//

//  TorrentTrader v2.x

// This file was last updated: 6/Sept/2007

//

// http://www.torrenttrader.org

//

//

require_once("backend/functions.php");

dbconn(false);

loggedinonly();





if($CURUSER["edit_users"]!="yes")

show_error_msg("Access Denied","You do not have permission to edit users",1);



$action = $_POST["action"];



if (!$action)

show_error_msg("Error","This task is not found",1);



if ($action == 'edituser'){

$userid = $_POST["userid"];

$title = $_POST["title"];

$logintrys = $_POST["logintrys"];

if (isset($_POST["uploaded"])) {

if (preg_match("/(tb|TB)/", $_POST["uploaded"], $matches) && preg_match("/[0-9]+/", $_POST["uploaded"], $matchesnum)) {

 $nummatch = $matchesnum[0] * 1024 * 1024 * 1024 * 1024;

 $uploaded = $nummatch;

}else if (preg_match("/(gb|GB)/", $_POST["uploaded"], $matches)  && preg_match("/[0-9]+/", $_POST["uploaded"], $matchesnum)) {

 $nummatch = $matchesnum[0] * 1024 * 1024 * 1024;

 $uploaded = $nummatch;

}else if (preg_match("/(mb|MB)/", $_POST["uploaded"], $matches)  && preg_match("/[0-9]+/", $_POST["uploaded"], $matchesnum)) {

 $nummatch = $matchesnum[0] * 1024 * 1024;

 $uploaded = $nummatch;

}else if (preg_match("/(kb|KB)/", $_POST["uploaded"], $matches)  && preg_match("/[0-9]+/", $_POST["uploaded"], $matchesnum)) {

 $nummatch = $matchesnum[0] * 1024;

 $uploaded = $nummatch;

}

}



if (isset($_POST["downloaded"])) {

if (preg_match("/(tb|TB)/", $_POST["downloaded"], $matchesd) && preg_match("/[0-9]+/", $_POST["downloaded"], $matchesnumd)) {

 $nummatchd = $matchesnumd[0] * 1024 * 1024 * 1024 * 1024;

 $downloaded = $nummatchd;

}else if (preg_match("/(gb|GB)/", $_POST["downloaded"], $matchesd) && preg_match("/[0-9]+/", $_POST["downloaded"], $matchesnumd)) {

 $nummatchd = $matchesnumd[0] * 1024 * 1024 * 1024;

 $downloaded = $nummatchd;

}else if (preg_match("/(mb|MB)/", $_POST["downloaded"], $matchesd) && preg_match("/[0-9]+/", $_POST["downloaded"], $matchesnumd)) {

 $nummatchd = $matchesnumd[0] * 1024 * 1024;

 $downloaded = $nummatchd;

}else if (preg_match("/(kb|KB)/", $_POST["downloaded"], $matchesd) && preg_match("/[0-9]+/", $_POST["downloaded"], $matchesnumd)) {

 $nummatchd = $matchesnumd[0] * 1024;

 $downloaded = $nummatchd;

}

}

$signature = $_POST["signature"];

$avatar = $_POST["avatar"];

$ip = $_POST["ip"];

$class = (int) $_POST["class"];

$donated = (float) $_POST["donated"];

$password = $_POST["password"];

$warned = $_POST["warned"];

  $pcoff = $_POST["pcoff"];

$forumbanned = $_POST["forumbanned"];

  $seedbox = $_POST["seedbox"];

  $downloadbanned = $_POST["downloadbanned"];

  $shoutboxbanned = $_POST["shoutboxbanned"];

$modcomment = $_POST["modcomment"];

$addbookmark = $_POST["addbookmark"];

$bookmcomment = $_POST["bookmcomment"];

$enabled = $_POST["enabled"];

$invites = $_POST["invites"];

$class = (int)$_POST["class"];



if (!is_valid_id($userid))

show_error_msg("Editing Failed", "Invalid UserID",1);



//change user class

$res = mysql_query("SELECT class FROM users WHERE id=$userid");

$arr = mysql_fetch_row($res) or show_error_msg("Error","Mysql error",1);

$uc = $arr[0];



// skip if class is same as current

if ($uc != $class && $class > 0) {

// You cant demote admins!

/* if ((get_user_class() == "7") && ($userid == $CURUSER["id"]))

show_error_msg("Editing Failed", "You can't demote admins for security reasons.",1);



// User may not demote someone with same or higher class than himself!

elseif ($uc >= get_user_class())

show_error_msg("Editing Failed", "You may not demote someone with same or higher class than yourself",1);



// All ok, update db

else {*/

 @mysql_query("UPDATE users SET class=$class WHERE id=$userid");

 // Notify user

 $prodemoted = ($class > $uc ? "promoted" : "demoted");

 $msg = sqlesc("You have been $prodemoted to '" . get_user_class_name($class) . "' by " . $CURUSER["username"] . ".");

 $added = sqlesc(get_date_time());

 @mysql_query("INSERT INTO messages (sender, receiver, msg, added) VALUES(0, $userid, $msg, $added)");

  // }

}

//continue updates





mysql_query("UPDATE users SET title=".sqlesc($title).",logintrys='$logintrys', downloaded='$downloaded', uploaded='$uploaded', signature=".sqlesc($signature).", avatar='$avatar', ip='$ip', donated='$donated', forumbanned='$forumbanned',seedbox='$seedbox',shoutboxbanned='$shoutboxbanned', warned='$warned',  modcomment='$modcomment',downloadbanned='$downloadbanned', enabled='$enabled', invites='$invites' WHERE id=$userid");



write_log($CURUSER['username']." has edited user: $userid details");

 

if ($_POST['resetpasskey']=='yes'){

mysql_query("UPDATE users SET passkey='' WHERE id=$userid");

//write_log($CURUSER['username']." Passkey has been reset for: $userid");

}



$chgpasswd = $_POST['chgpasswd']=='yes' ? true : false;

if ($chgpasswd) {

$passreq = mysql_query("SELECT password FROM users WHERE id=$userid");

$passres = mysql_fetch_assoc($passreq);

if($password != $passres['password']){

$password = md5($password);

mysql_query("UPDATE users SET password='$password' WHERE id=$userid");

write_log($CURUSER['username']." has changed password for user: $userid");

}

}

 

 header("Location: account-details.php?id=$userid");

 die;

}



if ($action == 'addwarning'){

$userid = (int)$_POST["userid"];

$reason = mysql_real_escape_string($_POST["reason"]);

$expiry = (int)$_POST["expiry"];

$type = mysql_real_escape_string($_POST["type"]);



if (!is_valid_id($userid))

show_error_msg("Editing Failed", "Invalid UserID",1);



if (!$reason || !$expiry || !$type){

show_error_msg("Error", "Missing form data.",1);

}



$timenow = get_date_time();



$expiretime = get_date_time(gmtime() + (86400 * $expiry));



$ret = mysql_query("INSERT INTO warnings (userid, reason, added, expiry, warnedby, type) VALUES ('$userid','$reason','$timenow','$expiretime','".$CURUSER['id']."','$type')");



$ret = mysql_query("UPDATE users SET warned='yes' WHERE id='$userid'");



$msg = sqlesc("You have been warned by " . $CURUSER["username"] . " - Reason: ".$reason." - Expiry: ".$expiretime."");

$added = sqlesc(get_date_time());

@mysql_query("INSERT INTO messages (sender, receiver, msg, added) VALUES(0, $userid, $msg, $added)");



write_log($CURUSER['username']." has added a warning for user: <a href=account-details.php?id=$userid>$userid</a>");

header("Location: account-details.php?id=$userid");

die;

}





if ($action == "deleteaccount"){

if($CURUSER["level"]!="Administrator")//only allow admins to delete users

show_error_msg("Error", "Only admins can do this",1);



$userid = (int)$_POST["userid"];

$username = sqlesc($_POST["username"]);

$delreason = sqlesc($_POST["delreason"]);



if (!is_valid_id($userid))

show_error_msg("Failed", "Invalid UserID",1);



if (!$delreason){

show_error_msg("Error", "Missing form data.",1);

}



deleteaccount($userid);



write_log($CURUSER['username']." has deleted account: $username");



show_error_msg("Completed", "User has been deleted from the database",1);

die;

}



/*



if ($action == "banuser")

{

 $userid = $_POST["userid"];

 $what = $_POST["what"];

 if (!is_valid_id($userid))

genbark("Not a vaild Userid");

 $comment = $_POST['comment'];

 if (!$comment)

genbark("Error:", "Please explain why you are banning this user!");

 $r = mysql_query("SELECT username,ip FROM users WHERE id=$userid") or sqlerr();

 $a = mysql_fetch_assoc($r);

 $username = $a["username"];

 $ip = $a["ip"];

 if ($what == "subnet")

 $ip = substr($ip, 0, strrpos($ip, ".")) . ".*";

 else

if ($what == 'ip')

 $extra = " OR ip='" . substr($ip, 0, strrpos($ip, ".")) . ".*'";

else

 genbark("Heh", "Select what to ban!");

 $r = mysql_query("SELECT * FROM bans WHERE ip='$ip'$extra") or sqlerr();

 if (mysql_num_rows($r) > 0)

genbark("Error", "IP/subnet is already banned");

 else {

$dt = get_date_time();

$comment = sqlesc($comment);

mysql_query("INSERT INTO bans (userid, first, last, added, addedby, comment) VALUES($userid, '$ip', '$ip', '$dt', $CURUSER[id], $comment)") or sqlerr();

mysql_query("UPDATE users SET secret='' WHERE id=$userid") or sqlerr();

$returnto = $_POST["returnto"];

header("Location: $returnto");

die;

 }

}



if ($action == "enableaccount")

{

 $userid = $_POST["id"];

 $res = mysql_query("SELECT * FROM users WHERE id='$userid'") or sqlerr();

 if (mysql_num_rows($res) != 1)

genbark("User $userid not found!");

 $secret = sqlesc(mksecret());

 mysql_query("UPDATE users SET secret=" . $secret . " WHERE id=$userid") or sqlerr();

 header("Location: account-details.php?id=$userid");

 die;

}

if ($action == "newpassword")

{

if ($CURUSER["control_panel"] == "no")

show_error_msg("No Permission", "Only administrators can do this.", 1);



$userid = (int)$_POST["userid"];



if (!is_valid_id($userid))

show_error_msg("Error", "Invalid user id.", 1);



$query = mysql_query("SELECT * FROM `users` WHERE `id` = '{$userid}'") or die (mysql_error());

$row = mysql_fetch_array($query);



$passwordnew = mksecret(15);

$passwordmd5 = md5($passwordnew);

$body = "Your account at ".$site_config['SITENAME']." has been allocated a new password.\n\nYou can now login with your username and this password {$passwordnew}.\n\n".$site_config['SITENAME']." Admin";



ini_set("sendmail_from", "");



if (!@mail($row["email"], "Your ".$site_config['SITENAME']." New Password", $body, "From: ".$site_config['SITENAME']." <".$site_config['SITEEMAIL'].">"))

 show_error_msg("Error", "Mail failed to send.", 1);

 

write_log($CURUSER["username"] . " generated a new password for {$row["username"]}");



mysql_query("UPDATE `users` SET `password` = '{$passwordmd5}' WHERE `id` = {$userid}");



show_error_msg("Complete", "new password sent to {$row["email"]}", 1);



}

*/

?>



no where do i see that one chunck.  Can someone help me?
Unknown User
2011-11-03 06:50:21
this is the line u need to put it in

mysql_query("UPDATE users SET title=".sqlesc($title).",logintrys='$logintrys', downloaded='$downloaded', uploaded='$uploaded', signature=".sqlesc($signature).", avatar='$avatar', ip='$ip', donated='$donated', forumbanned='$forumbanned',seedbox='$seedbox',shoutboxbanned='$shoutboxbanned', warned='$warned',  modcomment='$modcomment',downloadbanned='$downloadbanned', enabled='$enabled', invites='$invites' WHERE id=$userid");





so try this





<?

//

//  TorrentTrader v2.x

// This file was last updated: 6/Sept/2007

//

// http://www.torrenttrader.org

//

//

require_once("backend/functions.php");

dbconn(false);

loggedinonly();





if($CURUSER["edit_users"]!="yes")

show_error_msg("Access Denied","You do not have permission to edit users",1);



$action = $_POST["action"];



if (!$action)

show_error_msg("Error","This task is not found",1);



if ($action == 'edituser'){

$userid = $_POST["userid"];

$title = $_POST["title"];

$logintrys = $_POST["logintrys"];

if (isset($_POST["uploaded"])) {

if (preg_match("/(tb|TB)/", $_POST["uploaded"], $matches) && preg_match("/[0-9]+/", $_POST["uploaded"], $matchesnum)) {

 $nummatch = $matchesnum[0] * 1024 * 1024 * 1024 * 1024;

 $uploaded = $nummatch;

}else if (preg_match("/(gb|GB)/", $_POST["uploaded"], $matches)  && preg_match("/[0-9]+/", $_POST["uploaded"], $matchesnum)) {

 $nummatch = $matchesnum[0] * 1024 * 1024 * 1024;

 $uploaded = $nummatch;

}else if (preg_match("/(mb|MB)/", $_POST["uploaded"], $matches)  && preg_match("/[0-9]+/", $_POST["uploaded"], $matchesnum)) {

 $nummatch = $matchesnum[0] * 1024 * 1024;

 $uploaded = $nummatch;

}else if (preg_match("/(kb|KB)/", $_POST["uploaded"], $matches)  && preg_match("/[0-9]+/", $_POST["uploaded"], $matchesnum)) {

 $nummatch = $matchesnum[0] * 1024;

 $uploaded = $nummatch;

}

}



if (isset($_POST["downloaded"])) {

if (preg_match("/(tb|TB)/", $_POST["downloaded"], $matchesd) && preg_match("/[0-9]+/", $_POST["downloaded"], $matchesnumd)) {

 $nummatchd = $matchesnumd[0] * 1024 * 1024 * 1024 * 1024;

 $downloaded = $nummatchd;

}else if (preg_match("/(gb|GB)/", $_POST["downloaded"], $matchesd) && preg_match("/[0-9]+/", $_POST["downloaded"], $matchesnumd)) {

 $nummatchd = $matchesnumd[0] * 1024 * 1024 * 1024;

 $downloaded = $nummatchd;

}else if (preg_match("/(mb|MB)/", $_POST["downloaded"], $matchesd) && preg_match("/[0-9]+/", $_POST["downloaded"], $matchesnumd)) {

 $nummatchd = $matchesnumd[0] * 1024 * 1024;

 $downloaded = $nummatchd;

}else if (preg_match("/(kb|KB)/", $_POST["downloaded"], $matchesd) && preg_match("/[0-9]+/", $_POST["downloaded"], $matchesnumd)) {

 $nummatchd = $matchesnumd[0] * 1024;

 $downloaded = $nummatchd;

}

}

$signature = $_POST["signature"];

$avatar = $_POST["avatar"];

$ip = $_POST["ip"];

$class = (int) $_POST["class"];

$donated = (float) $_POST["donated"];

$password = $_POST["password"];

$warned = $_POST["warned"];

  $pcoff = $_POST["pcoff"];

$forumbanned = $_POST["forumbanned"];

  $seedbox = $_POST["seedbox"];

  $downloadbanned = $_POST["downloadbanned"];

  $shoutboxbanned = $_POST["shoutboxbanned"];

$modcomment = $_POST["modcomment"];

$addbookmark = $_POST["addbookmark"];

$bookmcomment = $_POST["bookmcomment"];

$enabled = $_POST["enabled"];

$invites = $_POST["invites"];

$class = (int)$_POST["class"];



if (!is_valid_id($userid))

show_error_msg("Editing Failed", "Invalid UserID",1);



//change user class

$res = mysql_query("SELECT class FROM users WHERE id=$userid");

$arr = mysql_fetch_row($res) or show_error_msg("Error","Mysql error",1);

$uc = $arr[0];



// skip if class is same as current

if ($uc != $class && $class > 0) {

// You cant demote admins!

/* if ((get_user_class() == "7") && ($userid == $CURUSER["id"]))

show_error_msg("Editing Failed", "You can't demote admins for security reasons.",1);



// User may not demote someone with same or higher class than himself!

elseif ($uc >= get_user_class())

show_error_msg("Editing Failed", "You may not demote someone with same or higher class than yourself",1);



// All ok, update db

else {*/

 @mysql_query("UPDATE users SET class=$class WHERE id=$userid");

 // Notify user

 $prodemoted = ($class > $uc ? "promoted" : "demoted");

 $msg = sqlesc("You have been $prodemoted to '" . get_user_class_name($class) . "' by " . $CURUSER["username"] . ".");

 $added = sqlesc(get_date_time());

 @mysql_query("INSERT INTO messages (sender, receiver, msg, added) VALUES(0, $userid, $msg, $added)");

  // }

}

//continue updates





mysql_query("UPDATE users SET title=".sqlesc($title).",logintrys='$logintrys', downloaded='$downloaded', uploaded='$uploaded', signature=".sqlesc($signature).", avatar='$avatar', ip='$ip', bookmcomment='$bookmcomment', addbookmark='$addbookmark', donated='$donated', forumbanned='$forumbanned',seedbox='$seedbox',shoutboxbanned='$shoutboxbanned', warned='$warned',  modcomment='$modcomment',downloadbanned='$downloadbanned', enabled='$enabled', invites='$invites' WHERE id=$userid");



write_log($CURUSER['username']." has edited user: $userid details");

 

if ($_POST['resetpasskey']=='yes'){

mysql_query("UPDATE users SET passkey='' WHERE id=$userid");

//write_log($CURUSER['username']." Passkey has been reset for: $userid");

}



$chgpasswd = $_POST['chgpasswd']=='yes' ? true : false;

if ($chgpasswd) {

$passreq = mysql_query("SELECT password FROM users WHERE id=$userid");

$passres = mysql_fetch_assoc($passreq);

if($password != $passres['password']){

$password = md5($password);

mysql_query("UPDATE users SET password='$password' WHERE id=$userid");

write_log($CURUSER['username']." has changed password for user: $userid");

}

}

 

 header("Location: account-details.php?id=$userid");

 die;

}



if ($action == 'addwarning'){

$userid = (int)$_POST["userid"];

$reason = mysql_real_escape_string($_POST["reason"]);

$expiry = (int)$_POST["expiry"];

$type = mysql_real_escape_string($_POST["type"]);



if (!is_valid_id($userid))

show_error_msg("Editing Failed", "Invalid UserID",1);



if (!$reason || !$expiry || !$type){

show_error_msg("Error", "Missing form data.",1);

}



$timenow = get_date_time();



$expiretime = get_date_time(gmtime() + (86400 * $expiry));



$ret = mysql_query("INSERT INTO warnings (userid, reason, added, expiry, warnedby, type) VALUES ('$userid','$reason','$timenow','$expiretime','".$CURUSER['id']."','$type')");



$ret = mysql_query("UPDATE users SET warned='yes' WHERE id='$userid'");



$msg = sqlesc("You have been warned by " . $CURUSER["username"] . " - Reason: ".$reason." - Expiry: ".$expiretime."");

$added = sqlesc(get_date_time());

@mysql_query("INSERT INTO messages (sender, receiver, msg, added) VALUES(0, $userid, $msg, $added)");



write_log($CURUSER['username']." has added a warning for user: <a href=account-details.php?id=$userid>$userid</a>");

header("Location: account-details.php?id=$userid");

die;

}





if ($action == "deleteaccount"){

if($CURUSER["level"]!="Administrator")//only allow admins to delete users

show_error_msg("Error", "Only admins can do this",1);



$userid = (int)$_POST["userid"];

$username = sqlesc($_POST["username"]);

$delreason = sqlesc($_POST["delreason"]);



if (!is_valid_id($userid))

show_error_msg("Failed", "Invalid UserID",1);



if (!$delreason){

show_error_msg("Error", "Missing form data.",1);

}



deleteaccount($userid);



write_log($CURUSER['username']." has deleted account: $username");



show_error_msg("Completed", "User has been deleted from the database",1);

die;

}



/*



if ($action == "banuser")

{

 $userid = $_POST["userid"];

 $what = $_POST["what"];

 if (!is_valid_id($userid))

genbark("Not a vaild Userid");

 $comment = $_POST['comment'];

 if (!$comment)

genbark("Error:", "Please explain why you are banning this user!");

 $r = mysql_query("SELECT username,ip FROM users WHERE id=$userid") or sqlerr();

 $a = mysql_fetch_assoc($r);

 $username = $a["username"];

 $ip = $a["ip"];

 if ($what == "subnet")

 $ip = substr($ip, 0, strrpos($ip, ".")) . ".*";

 else

if ($what == 'ip')

 $extra = " OR ip='" . substr($ip, 0, strrpos($ip, ".")) . ".*'";

else

 genbark("Heh", "Select what to ban!");

 $r = mysql_query("SELECT * FROM bans WHERE ip='$ip'$extra") or sqlerr();

 if (mysql_num_rows($r) > 0)

genbark("Error", "IP/subnet is already banned");

 else {

$dt = get_date_time();

$comment = sqlesc($comment);

mysql_query("INSERT INTO bans (userid, first, last, added, addedby, comment) VALUES($userid, '$ip', '$ip', '$dt', $CURUSER[id], $comment)") or sqlerr();

mysql_query("UPDATE users SET secret='' WHERE id=$userid") or sqlerr();

$returnto = $_POST["returnto"];

header("Location: $returnto");

die;

 }

}



if ($action == "enableaccount")

{

 $userid = $_POST["id"];

 $res = mysql_query("SELECT * FROM users WHERE id='$userid'") or sqlerr();

 if (mysql_num_rows($res) != 1)

genbark("User $userid not found!");

 $secret = sqlesc(mksecret());

 mysql_query("UPDATE users SET secret=" . $secret . " WHERE id=$userid") or sqlerr();

 header("Location: account-details.php?id=$userid");

 die;

}

if ($action == "newpassword")

{

if ($CURUSER["control_panel"] == "no")

show_error_msg("No Permission", "Only administrators can do this.", 1);



$userid = (int)$_POST["userid"];



if (!is_valid_id($userid))

show_error_msg("Error", "Invalid user id.", 1);



$query = mysql_query("SELECT * FROM `users` WHERE `id` = '{$userid}'") or die (mysql_error());

$row = mysql_fetch_array($query);



$passwordnew = mksecret(15);

$passwordmd5 = md5($passwordnew);

$body = "Your account at ".$site_config['SITENAME']." has been allocated a new password.\n\nYou can now login with your username and this password {$passwordnew}.\n\n".$site_config['SITENAME']." Admin";



ini_set("sendmail_from", "");



if (!@mail($row["email"], "Your ".$site_config['SITENAME']." New Password", $body, "From: ".$site_config['SITENAME']." <".$site_config['SITEEMAIL'].">"))

 show_error_msg("Error", "Mail failed to send.", 1);

 

write_log($CURUSER["username"] . " generated a new password for {$row["username"]}");



mysql_query("UPDATE `users` SET `password` = '{$passwordmd5}' WHERE `id` = {$userid}");



show_error_msg("Complete", "new password sent to {$row["email"]}", 1);



}

*/

?>
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 9
  • Members: 0
  • Guests online: 9
  • Comments: 3
  • Messages: 1,728