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
User Posts

Go to Profile

[size=18px]I forgot about comments from News, I updated the first post with all that is necessary[/size] :)
You're right darknova, into "delete subtitles" code is a mistake and I corrected that issue. You must replace this code:



$del = SQL_Query_exec("SELECT * FROM subs WHERE $query");

 while ($arr3 = mysql_fetch_assoc($del))

 {

   $delsub = $_GET["delsub"];

   if (is_valid_id($delsub))

   {

 show_error_msg("Delete Subtitle","<br /><font size=2>Are you sure you want to delete this subtitle?</font>

 <div style=margin-top:5px align=center><font color=#0080FF>".htmlspecialchars($arr3["title"])."</font></div>

 <div style='margin-top:10px' align=center><a href=?delete=$arr3[id]>Yes</a> &nbsp;|&nbsp; <a href=subtitles.php>No</a></div>", 1);

   }

 }

With this one:




$delsub = $_GET["delsub"];

$del = SQL_Query_exec("SELECT * FROM subs WHERE id ='$delsub' AND $query");

 while ($arr3 = mysql_fetch_assoc($del))

 {

   if (is_valid_id($delsub))

   {

 show_error_msg("Delete Subtitle","<br /><font size=2>Are you sure you want to delete this subtitle?</font>

 <div style=margin-top:5px align=center><font size=2 color=#0080FF>".htmlspecialchars($arr3["title"])."</font></div>

 <div style='margin-top:10px' align=center><a href=?delete=$delsub>Yes</a> &nbsp;|&nbsp; <a href=subtitles.php>No</a></div>", 1);

   }

 }




[size=18px]I updated the attached archive from the first post.[/size]
Here is an update that completes the codes for "Forum Banned" (with ban length + reason for ban) and "Account Enabled" (with reason for disable) .
The actions are registered into modcomment, log and the user will receive a PM when will be banned or unbanned.



Run in your database:

ALTER TABLE `users` ADD `forumbanneduntil` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `forumbanned`;
Into account-details.php replace this code:

//forum banned
if (get_user_class() >= 5)  {
print("<form method='post' action='admin-modtasks.php'>n");
print("<input type='hidden' name='action' value='forumbanned' />n");
print("<input type='hidden' name='userid' value='$id' />n");
print("<input type='hidden' name='username' value='".$user["username"]."' />n");
print("<tr><td>".T_("FORUM_BANNED").": </td><td align='left'><input name='forumbanned' value='yes' type='radio' " . ($forumbanned ? " checked='checked'" : "") . " /> Yes &nbsp; <input name='forumbanned' value='no' type='radio' " . (!$forumbanned ? " checked='checked'" : "") . " /> Non");
print("<font style='margin-left:7px'><input type='submit' value='Submit' /></font>n");
print("</td></tr>n");
print("</form>n");
}

//disable/enable account
if (get_user_class() >= 5) {
print("<form method='post' action='admin-modtasks.php'>n");
print("<input type='hidden' name='action' value='enabled' />n");
print("<input type='hidden' name='userid' value='$id' />n");
print("<input type='hidden' name='username' value='".$user["username"]."' />n");
print("<tr><td>Account Enabled: </td><td align='left'><input name='enabled' value='yes' type='radio' " . ($enabled ? " checked='checked'" : "") . " /> <font color='limegreen'>Yes</font> &nbsp; <input name='enabled' value='no' type='radio' " . (!$enabled ? " checked='checked' " : "") . " /> <font color='red'>No</font>n");
print("<font style='margin-left:9px'><input type='submit' value='Submit' /></font>n");
print("</td></tr>n");
print("</form>n");
}
with this one:

$forumbanneduntil = $user["forumbanneduntil"];
if ($forumbanneduntil != "0000-00-00 00:00:00"){
$banforumuntil = "Remains: <font color=red><b>".mkprettytime(strtotime($forumbanneduntil) - gmtime())."</b></font> to go...";
} else {
$banforumuntil = "";
}

print("<tr><td height='5'></td></tr>n"); //===| 5px space here!

//forum banned
if (get_user_class() >= 5)  {
print("<form method='post' action='admin-modtasks.php'>n");
print("<input type='hidden' name='action' value='forumbanned' />n");
print("<input type='hidden' name='userid' value='$id' />n");
print("<input type='hidden' name='username' value='".$user["username"]."' />n");
print("<tr><td>".T_("FORUM_BANNED").": </td><td class='table_col2' align='left'><input name='forumbanned' value='yes' type='radio' " . ($forumbanned ? " checked='checked'" : "") . " /> Yes &nbsp;<input name='forumbanned' value='no' type='radio' " . (!$forumbanned ? " checked='checked'" : "") . " /> Non");
print("<font style='margin-left:15px; margin-right:20px'>Banned for: <input type='text' size='4' name='forumbannedlength' /> days</font>$banforumuntiln");
print("<div style='margin-top:5px'>Reason: <input type='text' size='70' name='forbanreason'>n");
print("<font style='margin-left:10px; margin-right:20px'><input type='submit' value='Submit' /></font></div>n");
print("</td></tr>n");
print("</form>n");
}

print("<tr><td height='5'></td></tr>n"); //===| 5px space here!

//disable/enable account
if (get_user_class() >= 5) {
print("<form method='post' action='admin-modtasks.php'>n");
print("<input type='hidden' name='action' value='enabled' />n");
print("<input type='hidden' name='userid' value='$id' />n");
print("<input type='hidden' name='username' value='".$user["username"]."' />n");
print("<tr><td>Account Enabled: </td><td class='table_col2' align='left'><input name='enabled' value='yes' type='radio' " . ($enabled ? " checked='checked'" : "") . " /> <font color='limegreen'>Yes</font> &nbsp;<input name='enabled' value='no' type='radio' " . (!$enabled ? " checked='checked' " : "") . " /> <font color='red'>No</font><font style='margin-left:20px' color='#0080FF'><i>Do not disable the account without a founded reason!</i></font>n");
print("<div style='margin-top:5px'>Reason: <input type='text' size='70' name='disablereason'>n");
print("<font style='margin-left:10px'><input type='submit' value='Submit' /></div>n");
print("</td></tr>n");
print("</form>n");
}
print("<tr><td height='5'></td></tr>n"); //===| 5px space here!
Into admin-modtasks.php replace this code:

//===| Start Forum Banned |===//
if ($action == 'forumbanned') {
$curusername = ($CURUSER['username']);
$curuserid = ($CURUSER['id']);
$username = sqlesc($_POST["username"]);
$userid = $_POST["userid"];
$forumbanned = sqlesc($_POST["forumbanned"]);

$modcomment = $row['modcomment'];
If ($_POST["forumbanned"] != 'yes') {
$modcomment2 = gmdate("d-M-Y") . " - $curusername has removed ban on Forum for this user n";
} else {
$modcomment2 = gmdate("d-M-Y") . " - $curusername has banned on Forum this user n";
}
$modcomment = $modcomment2 . "" . $modcomment;
$modcom = sqlesc($modcomment);

SQL_Query_exec("UPDATE users SET forumbanned=$forumbanned, modcomment = CONCAT($modcom,modcomment) WHERE id = $userid");
If ($_POST["forumbanned"] != 'yes') {
write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> has removed ban on Forum for user <a href=account-details.php?id=$userid><b>$username</b></a>");
} else {
write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> has banned on Forum user <a href=account-details.php?id=$userid><b>$username</b></a>");
}
header("Location: account-details.php?id=$userid");
die;
}
//====| End Forum Banned |====//

//===| Start Disable/Enable Account |===//
if ($action == 'enabled') {
$curusername = ($CURUSER['username']);
$curuserid = ($CURUSER['id']);
$username = sqlesc($_POST["username"]);
$userid = $_POST["userid"];
$enabled = sqlesc($_POST["enabled"]);

$modcomment = $row['modcomment'];
If ($_POST["enabled"] == 'yes') {
$modcomment2 = gmdate("d-M-Y") . " - $curusername has enabled this account n";
} else {
$modcomment2 = gmdate("d-M-Y") . " - $curusername has disabled this account n";
}
$modcomment = $modcomment2 . "" . $modcomment;
$modcom = sqlesc($modcomment);

SQL_Query_exec("UPDATE users SET enabled=$enabled, modcomment = CONCAT($modcom,modcomment) WHERE id = $userid");
If ($_POST["enabled"] == 'yes') {
write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> has enabled user <a href=account-details.php?id=$userid><b>$username</b></a> account");
} else {
write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> has disabled user <a href=account-details.php?id=$userid><b>$username</b></a> account");
}
header("Location: account-details.php?id=$userid");
die;
}
//====| End Disable/Enable Account |====//

with this one:

//===| Start Forum Banned |===//
if ($action == 'forumbanned') {
$curusername = ($CURUSER['username']);
$curuserid = ($CURUSER['id']);
$username = sqlesc($_POST["username"]);
$userid = $_POST["userid"];
$forumbanned = sqlesc($_POST["forumbanned"]);
$forumbannedlength = sqlesc($_POST["forumbannedlength"]);
$forumbanneduntil = get_date_time(gmtime() + $forumbannedlength * 86400);
$days = $forumbannedlength . " day" . ($forumbannedlength > 1 ? "s" : "");
$fbreason = $_POST["forbanreason"];

if ($_POST["forumbanned"] == 'yes' && $_POST["forumbannedlength"] == '') {
show_error_msg(T_("ERROR"), "You must specify the number of days! &nbsp [<a href=account-details.php?id=$userid><b>Go Back</b></a>]", 1);
}

if ($_POST["forumbanned"] == 'yes' && $_POST["forbanreason"] == '') {
show_error_msg(T_("ERROR"), "You must provide a Reason for this action! &nbsp [<a href=account-details.php?id=$userid><b>Go Back</b></a>]", 1);
}

$modcomment = $row['modcomment'];
If ($_POST["forumbanned"] != 'yes') {
$modcomment2 = gmdate("d-M-Y") . " - $curusername has removed ban on Forum n";
} else {
$modcomment2 = gmdate("d-M-Y") . " - $curusername has added ban on Forum for $daysn- Reason: $fbreason n";
}
$modcomment = $modcomment2 . "" . $modcomment;
$modcom = sqlesc($modcomment);

If ($_POST["forumbanned"] != 'yes') {
SQL_Query_exec("UPDATE users SET forumbanned=$forumbanned, forumbanneduntil = '0000-00-00 00:00:00', modcomment = CONCAT($modcom,modcomment) WHERE id = $userid");
$msg = sqlesc("Your ban on Forum has been removed by ".$curusername."");
$added = sqlesc(get_date_time());
SQL_Query_exec("INSERT INTO messages (sender, receiver, msg, added) VALUES(0, $userid, $msg, $added)");
write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> has removed ban on Forum for user <a href=account-details.php?id=$userid><b>$username</b></a>");
} else {
SQL_Query_exec("UPDATE users SET forumbanned=$forumbanned, forumbanneduntil = '$forumbanneduntil', modcomment = CONCAT($modcom,modcomment) WHERE id = $userid");
$msg = sqlesc("You have received a ".$days." ban on Forum from ".$curusername."nnReason: ".$fbreason."");
$added = sqlesc(get_date_time());
SQL_Query_exec("INSERT INTO messages (sender, receiver, msg, added) VALUES(0, $userid, $msg, $added)");
write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> has banned on Forum user <a href=account-details.php?id=$userid><b>$username</b></a> for $days<br />Reason: $fbreason");
}
header("Location: account-details.php?id=$userid");
die;
}
//====| End Forum Banned |====//

//===| Start Disable/Enable Account |===//
if ($action == 'enabled') {
$curusername = ($CURUSER['username']);
$curuserid = ($CURUSER['id']);
$username = sqlesc($_POST["username"]);
$userid = $_POST["userid"];
$enabled = sqlesc($_POST["enabled"]);
$disablereason = $_POST["disablereason"];

if ($_POST["enabled"] != 'yes' && $_POST["disablereason"] == '') {
show_error_msg(T_("ERROR"), "You must provide a Reason for this action! &nbsp [<a href=account-details.php?id=$userid><b>Go Back</b></a>]", 1);
}

$modcomment = $row['modcomment'];
If ($_POST["enabled"] == 'yes') {
$modcomment2 = gmdate("d-M-Y") . " - $curusername has enabled this account n";
} else {
$modcomment2 = gmdate("d-M-Y") . " - $curusername has disabled this accountn- Reason: $disablereason n";
}
$modcomment = $modcomment2 . "" . $modcomment;
$modcom = sqlesc($modcomment);

SQL_Query_exec("UPDATE users SET enabled=$enabled, modcomment = CONCAT($modcom,modcomment) WHERE id = $userid");
If ($_POST["enabled"] == 'yes') {
write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> has enabled user <a href=account-details.php?id=$userid><b>$username</b></a> account");
} else {
write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> has disabled user <a href=account-details.php?id=$userid><b>$username</b></a> account<br />Reason: $disablereason");
}
header("Location: account-details.php?id=$userid");
die;
}
//====| End Disable/Enable Account |====//
And in the bottom of backend/cleanup.php copy this code:


# Remove ban on forum
$res32 = SQL_Query_exec("SELECT id FROM users WHERE forumbanned='yes' AND forumbanneduntil < NOW() AND forumbanneduntil <> '0000-00-00 00:00:00'");
if (mysql_num_rows($res32) > 0)
{
$dt = sqlesc(get_date_time());
$msg = sqlesc("Your ban on forum has been removed.n");
while ($arr = mysql_fetch_assoc($res32))
{
SQL_Query_exec("UPDATE users SET forumbanned = 'no', forumbanneduntil = '0000-00-00 00:00:00' WHERE id = $arr[id]");
SQL_Query_exec("INSERT INTO messages (sender, receiver, added, msg, poster) VALUES(0, $arr[id], $dt, $msg, 0)");
}
}
Thank you, both codes works properly  :)

Maybe you should update the first post, to be complete.
I installed this mod from the first post and works perfectly. Thanks ArcticWolf
I think it would be necessary also a code in login_block.php so that each user can see how many points has receive in the current month.

Something like that:

$query = "SELECT * FROM motm WHERE id='$CURUSER[id]' && month = ".date("m")." && year = ".date("y")."";
$result = SQL_Query_exec($query);
$motm = mysql_fetch_array($result);
$points = $motm['points'];
echo "Activity Bonus: <b>$points</b>";

And maybe into account-details.php also, for the staff eyes.
Thanks ArcticWolf, It works now in this form:



$sbmessage = "New Torrent: [url=".%24site_config%5B"]."/torrents-details.php?id=".$id."]".$torrent."[/url] just been uploaded!";

SQL_Query_exec("INSERT INTO shoutbox (msgid, user, message, date, userid, room) VALUES (NULL, 'System', ".sqlesc($sbmessage).", '".get_date_time()."', '100', '0')");

[/code]

I had to create a user called System with ID: 100 because if the user ID is not a valid one isn't showing nothing on shoutbox, even if the message is recorded into database.
I managed to do this shoutbox to work properly but another problem has arisen. I fail to make announcement for new torrents uploaded.

The old code from torrents-upload.php not wants to write anything into shoutbox table, I have changed it in many ways but no result...

Maybe someone has a solution?
Upload Manager — 2013-02-12 02:48:44 in v2.08 Mods Completed
[size=18px]I don't ever liked to see default values into a mod like this, so I decided to do something like that:[/size]

In english.php replace the old code for this mod with this one:



# Upload Manager

$LANG["INFO_UP_BONUS"] = "<p style='margin-top:10px; margin-bottom:20px' align='center'>

Choose the class at you want to modify the upload or preserves <b>To all members</b><br />

Write a value for the option which you have chosen and click on <b>Submit</b> button.<br />

Marks <b>System</b> if you want that it be the sender of messages.

</p>";



$LANG["UP_MANAGER"] = "Upload Manager";

$LANG["UP_UPDATED"] = "Operation performed successfully.";

$LANG["UP_ADD"] = "<b>ADD</b> to current upload:";

$LANG["UP_DED"] = "<b>DEDUCT</b> from current upload:";

$LANG["UP_MUL"] = "<b>MULTIPLY</b> current upload by:";

$LANG["UP_DIV"] = "<b>DIVIDE</b> current upload by:";

$LANG["UP_REP"] = "<b>REPLACE</b> current upload with:";

$LANG["UP_ADDED"] ="%s added %s GB Upoad to all members from class: %s";

$LANG["UP_DEDUCTED"] ="%s deducted %s GB Upoad to all members from class: %s";

$LANG["UP_MULTIPLIED"] ="%s multiplied by %s Upoad to all members from class: %s";

$LANG["UP_DIVIDED"] ="%s divided by %s Upoad to all members from class: %s";

$LANG["UP_REPLACED"] ="%s replaced with %s Upoad to all members from class: %s";

$LANG["TO_ALL_MEMBERS"] = "To all Members";

$LANG["ALL1"] = "All";



$LANG["SUBJECT_ADD"] = "We have added GB Upload to your account";

$LANG["MSG_ADD"] = "Hey, we have added %s upload to your account!

Please do not think this is a time to not seed. The same rules as always apply and we hate leechers...

So, if you're not a leecher, download something nice and enjoy!nClass Concerned: %s.";



$LANG["SUBJECT_DED"] = "We have deducte GB Upload to your account";

$LANG["MSG_DED"] = "Hey, we have deducte %s upload to your account!

Please do not think this is a time to not seed. The same rules as always apply and we hate leechers...

So, if you're not a leecher, download something nice and enjoy!nClass Concerned: %s.";



$LANG["SUBJECT_MUL"] = "We have MULTIPLIED your upload";

$LANG["MSG_MUL"] = "Hey, we have MULTIPLIED your upload by %s!

Please do not think this is a time to not seed. The same rules as always apply and we hate leechers...

So, if you're not a leecher, download something nice and enjoy!nClass Concerned: %s";



$LANG["SUBJECT_DIV"] = "We have DIVIDED your upload";

$LANG["MSG_DIV"] = "Hey, we have DIVIDED your upload by %s!

Please do not think this is a time to not seed. The same rules as always apply and we hate leechers...

So, if you're not a leecher, download something nice and enjoy!nClass Concerned: %s";



$LANG["SUBJECT_REP"] = "We have REPLACED your upload";

$LANG["MSG_REP"] = "Hey, we have REPLACED your upload with %s!

Please do not think this is a time to not seed. The same rules as always apply and we hate leechers...

So, if you're not a leecher, download something nice and enjoy!nClass Concerned: %s";



Extract files from attached archive and upload them in your root.

For the options ADD, DEDUCT and REPLACE you must write something like that: 10 GB or 10240 MB (can include decimals).

For MULTIPLY and DIVIDE enter only a number, also can include decimals.

[size=18px]I've tested it and I had no problem, working properly.[/size]

[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=6575"]Upload_Manager.zip[/url]

Upload Manager — 2013-02-11 17:20:54 in v2.08 Mods Completed
This is the code:



#-----------------------------------------------

# DEDUCT

#-----------------------------------------------

if($_POST['gig2'])

{

if ( !is_numeric($_POST['class']))

{

$res = SQL_Query_exec("SELECT id,uploaded FROM users");

$arr1[0] = T_("ALL1");

}

else

{

$res = SQL_Query_exec("SELECT id,uploaded FROM users WHERE class=".$_POST['class']." AND status = 'confirmed'");

$res1 = SQL_Query_exec("SELECT level FROM groups WHERE group_id=".$_POST['class']."");

$arr1 = mysql_fetch_row($res1);

}



$sender = ( $_POST["fromsystem"] == "yes" ) ? "0" : $CURUSER["id"];

$subject = T_("SUBJECT_DED");

$msg = sprintf( T_("MSG_DED"), $_POST['gig2'], $arr1[0]);



while($arr = mysql_fetch_row($res))

{

$up_value = strtobytes($_POST['gig2']);

if (($arr[1]-$up_value) >= 0)

SQL_Query_exec("UPDATE users SET uploaded = uploaded - ".$up_value." WHERE id=".$arr[0]." AND status = 'confirmed'");

else

SQL_Query_exec("UPDATE users SET uploaded = 0 WHERE id=".$arr[0]." AND status = 'confirmed'");



SQL_Query_exec("INSERT INTO messages (sender, receiver, added, subject, msg, poster) VALUES ($sender, $arr[0], '".get_date_time()."', ".sqlesc($subject).", ".sqlesc($msg).", $sender)");

}



write_log( sprintf(T_("UP_DEDUCTED"), class_user($CURUSER["username"]), $_POST['gig2'], htmlspecialchars($arr1[0])) );

autolink("upload-bonus.php", T_("UP_UPDATED"));

}



without that line.
Upload Manager — 2013-02-11 15:57:09 in v2.08 Mods Completed
This line is in addition and generates this problem:



SQL_Query_exec("UPDATE users SET uploaded = uploaded - ".strtobytes($_POST['gig2'])." WHERE status = 'confirmed'");



I removed it and now everything works perfectly  :D
Upload Manager — 2013-02-11 12:55:58 in v2.08 Mods Completed
Thanks ArcticWolf but exactly this script it is with that problem.

If you deduct an amount greater than upload (check 'To all members', check 'System') the result will be 16 PB for users that have a smaller upload.

You can check to see, I've already do this for several times... Maybe you can find  a solution?
Upload Manager — 2013-02-11 07:19:59 in v2.08 Mods Completed
I found a big problem in "Deduct from upload", if the value of deduction is greater than the current upload of user, the result will be 16 PB upload...

A very good way to make all leechers happy  
Upload Manager — 2013-02-10 16:15:50 in v2.08 Mods Completed
Azuris you made a great job for this mod    Thanks mate  :)
Why do you want to upload files so big? is not realistic,  are huge for subtitles and this script was not built to upload such files ...

However, I forgot to change some old code from tbdev in downloadsubs.php, this is the new one:



<?

require_once("backend/functions.php");

dbconn();



if (!$CURUSER)

{

Header("");

die;

}



$subs_dir = "".str_replace("","/",getcwd())."".$site_config['subs_dir']."";

$filename = substr($HTTP_SERVER_VARS["PATH_INFO"], strrpos($HTTP_SERVER_VARS["PATH_INFO"], "/") + 1);



if (!$filename)

die("File name missingn");



$filename = sqlesc($filename);

$res = SQL_Query_exec("SELECT * FROM subs WHERE filename=$filename");

$arr = mysql_fetch_assoc($res);

if (!$arr)

die("Not foundn");



SQL_Query_exec("UPDATE subs SET hits=hits+1 WHERE id=$arr[id]");

$file = "$subs_dir/$arr[filename]";

if (!is_file($file))

die("File not foundn");



$f = fopen($file, "rb");

if (!$f)

die("Cannot open filen");



header("Content-Length: " . filesize($file));

header("Content-Type: application/octet-stream");

do

{

$s = fread($f, 4096);

print($s);

}

while (!feof($f));



exit;

?>



[size=18px]I updated the attached archive in the first post[/size]
[size=18px]I modified an old mod from tbdev to work for TT 2.08. I've tested it and on my tracker works perfectly.[/size]

Run in yor database:



CREATE TABLE `subs` (

`id` int(10) unsigned NOT NULL auto_increment,

`title` varchar(255) NOT NULL default '',

`filename` varchar(255) NOT NULL default '',

`cd` int(10) unsigned NOT NULL default '0',

`frame` varchar(255) NOT NULL default '',

`comment` text NOT NULL,

`added` datetime default NULL,

`size` int(10) unsigned NOT NULL default '0',

`uppedby` int(10) unsigned NOT NULL default '0',

`url` varchar(255) NOT NULL default '',

`hits` int(10) unsigned NOT NULL default '0',

PRIMARY KEY (`id`)

) ENGINE=MyISAM DEFAULT CHARSET=latin1;

Add in backend/config.php the next line:




$site_config['subs_dir'] = '/uploads/subs';



This is the default directory for subtitles, If you change this location subtitles.php will not work anymore...

Create into uploads directory a new folder called subs and set file permission to 777 in your FTP client.

Download the attached archive subtitles and upload the included files in your root.





[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=6608"]subtitles.zip[/url]
After you have edited or deleted a comment from a torrent or from News you are redirected back.

These actions are are registered into Log.

Replace entire code at comments.php with this one:



<?php

require_once("backend/functions.php");

require_once("backend/bbcode.php");

dbconn();



$id = (int)$_GET["id"];

$type = $_GET["type"];

$edit = (int)$_GET["edit"];

$delete = (int)$_GET["delete"];



if ($edit == 1 || $delete == 1 || $_GET["takecomment"] == 'yes') loggedinonly();



if (!isset($id) || !$id || ($type != "torrent" && $type != "news"))

   show_error_msg("ERROR", T_("ERROR"), 1);



if ($edit=='1'){

   $row = mysql_fetch_assoc(SQL_Query_exec("SELECT user FROM comments WHERE id=$id"));



   if (($type == "torrent" && $CURUSER["edit_torrents"] == "no" || $type == "news" && $CURUSER["edit_news"] == "no") && $CURUSER['id'] != $row['user'])  

       show_error_msg("ERROR","You cant do this!",1);



       $save = (int)$_GET["save"];



       if($save){

           $text = sqlesc($_POST['text']);

         

           if ($type == "torrent") {

               $res = SQL_Query_exec("SELECT torrent FROM comments WHERE id=$id");

               $row = mysql_fetch_assoc($res);

               $idback = $row["torrent"];

               $query="UPDATE comments SET text=$text WHERE id=$id";

               $result=SQL_Query_exec($query);

               write_log("<a href=account-details.php?id=".$CURUSER['id']."><b>".$CURUSER['username']."</a></b> has edited comment ID: <b>$id</b> from torrent: [<a href=torrents-details.php?id=$idback><b>$idback</b></a>]");

               autolink("torrents-details.php?id=$idback", "Comment was edited successfully.");

           }

         

           if ($type == "news") {

               $res = SQL_Query_exec("SELECT news FROM comments WHERE id=$id");

               $row = mysql_fetch_assoc($res);

               $idback = $row["news"];

               $query="UPDATE comments SET text=$text WHERE id=$id";

               $result=SQL_Query_exec($query);

               write_log("<a href=account-details.php?id=".$CURUSER['id']."><b>".$CURUSER['username']."</a></b> has edited comment ID: <b>$id</b> from News ID: [<a href=comments.php?type=news&id=$idback><b>$idback</b></a>]");

               autolink("comments.php?type=news&id=$idback", "Comment was edited successfully.");

           }

       }



       stdhead("Edit Comment");



       $res = SQL_Query_exec("SELECT * FROM comments WHERE id=$id");

       $arr = mysql_fetch_array($res);



       begin_frame("Edit Comment");

       print("<center><b>Edit comment </b><p>n");

       print("<form method="post" name="comment" action="comments.php?type=$type&amp;edit=1&save=1&amp;id=$id">n");

       print textbbcode("comment","text", htmlspecialchars($arr["text"]));

       print("<p><input type="submit"  value="Submit Changes" /></p></form></center>n");

       end_frame();

       stdfoot();

       die();

}



if ($delete=='1'){

   if ($CURUSER["delete_news"] == "no" && $type == "news" || $CURUSER["delete_torrents"] == "no" && $type == "torrent")

       show_error_msg("ERROR","You cant do this!",1);



   if ($type == "torrent") {

       $res = SQL_Query_exec("SELECT torrent FROM comments WHERE id=$id");

       $row = mysql_fetch_assoc($res);

       if ($row["torrent"] > 0) {

           SQL_Query_exec("UPDATE torrents SET comments = comments - 1 WHERE id = $row[torrent]");

       }

       $idback = $row["torrent"];

       SQL_Query_exec("DELETE FROM comments WHERE id = $id");

       write_log("<a href=account-details.php?id=".$CURUSER['id']."><b>".$CURUSER['username']."</a></b> has deleted comment ID: <b>$id</b> from torrent: [<a href=torrents-details.php?id=$idback><b>$idback</b></a>]");

       autolink("torrents-details.php?id=$idback", "Comment was deleted successfully.");

   }

 

   if ($type == "news") {

       $res = SQL_Query_exec("SELECT news FROM comments WHERE id=$id");

       $row = mysql_fetch_assoc($res);

       $idback = $row["news"];

       SQL_Query_exec("DELETE FROM comments WHERE id = $id");

       write_log("<a href=account-details.php?id=".$CURUSER['id']."><b>".$CURUSER['username']."</a></b> has deleted comment ID: <b>$id</b> from News ID: [<a href=comments.php?type=news&id=$idback><b>$idback</b></a>]");

       autolink("comments.php?type=news&id=$idback", "Comment was deleted successfully.");

   }

}



stdhead(T_("COMMENTS"));



//take comment add

if ($_GET["takecomment"] == 'yes'){

   $body = $_POST['body'];

 

   if (!$body)

       show_error_msg(T_("ERROR"), T_("YOU_DID_NOT_ENTER_ANYTHING"), 1);



   if ($type =="torrent"){

       SQL_Query_exec("UPDATE torrents SET comments = comments + 1 WHERE id = $id");

   }



   SQL_Query_exec("INSERT INTO comments (user, ".$type.", added, text) VALUES (".$CURUSER["id"].", ".$id.", '" .get_date_time(). "', " . sqlesc($body).")");

 

   if (mysql_affected_rows() == 1)

           show_error_msg(T_("COMPLETED"), "Your Comment was added successfully.", 0);

       else

           show_error_msg(T_("ERROR"), T_("UNABLE_TO_ADD_COMMENT"), 0);

}//end insert comment



//NEWS

if ($type =="news"){

   $res = SQL_Query_exec("SELECT * FROM news WHERE id = $id");

   $row = mysql_fetch_array($res);



   if (!$row){

       show_error_msg(T_("ERROR"), "News id invalid", 0);

       stdfoot();

   }



   begin_frame(T_("NEWS"));

   echo htmlspecialchars($row['title']) . "<br /><br />".format_comment($row['body'])."<br />";

   end_frame();

}



//TORRENT

if ($type =="torrent"){

   $res = SQL_Query_exec("SELECT id, name FROM torrents WHERE id = $id");

   $row = mysql_fetch_array($res);



   if (!$row){

       show_error_msg(T_("ERROR"), "News id invalid", 0);

       stdfoot();

   }

   echo "<center><b>Comments for:</b> <a href='torrents-details.php?id=".$row['id']."'>".htmlspecialchars($row['name'])."</a></center><br />";

}



if($CURUSER["commentbanned"]=="yes")

   show_error_msg("Access Denied","You was banned to use comments!",0);

else {

   begin_frame(T_("COMMENTS"));



   $subres = SQL_Query_exec("SELECT COUNT(*) FROM comments WHERE $type = $id");

   $subrow = mysql_fetch_array($subres);

   $commcount = $subrow[0];



   if ($commcount) {

       list($pagertop, $pagerbottom, $limit) = pager(25, $commcount, "comments.php?id=$id&amp;type=$type&amp;");

       $commquery = "SELECT comments.id, text, user, comments.added, avatar, signature, username, title, class, uploaded, downloaded, privacy, donated FROM comments LEFT JOIN users ON comments.user = users.id WHERE $type = $id ORDER BY comments.added DESC $limit";

       $commres = SQL_Query_exec($commquery);

   }else{

       unset($commres);

   }



   if ($commcount) {

       print($pagertop);

       commenttable($commres, $type);

       print($pagerbottom);

   }else {

       print("<br /><b>" .T_("NOCOMMENTS"). "</b><br />n");

   }



   echo "<center>";

   echo "<form name="comment" method="post" action="comments.php?type=$type&amp;id=$id&amp;takecomment=yes">";

   echo textbbcode("comment","body")."<br />";

   echo "<input type="submit"  value="Add Comment" />";

   echo "</form></center>";



   end_frame();

}

stdfoot();

?>

[size=18px]If you want that promotion and demotion to be recorded in the [/size][size=18px]log[/size][size=18px] and [/size][size=18px]modcomment[/size][size=18px]:[/size]



//===| Start Auto Promote/Demote Users |===//

//===| config

$gigs = 50*1073741824; # 50 GB / uploaded amount for promote as power user

$minratio = 0.95; # ratio for demotion to user

$delay = sqlesc(get_date_time(gmtime() - 86400*30)); # Joined > 1 month



//===| auto promote to power user

$res = SQL_Query_exec("SELECT id, username, modcomment FROM users WHERE class = 1 AND warned = 'no' AND added < $delay AND uploaded >= $gigs AND uploaded >= downloaded");

$time = get_date_time();

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

$username = $arr[username];

$modcomment = $arr[modcomment];

$modcomment2 = gmdate("d-M-Y") . " - Has been promoted by System to Power User class n";

$modcomment = $modcomment2 . "" . $modcomment;

$modcom = sqlesc($modcomment);



SQL_Query_exec("UPDATE users SET class = 2, modcomment = CONCAT($modcom,modcomment) WHERE id = $arr[id]");

SQL_Query_exec("INSERT INTO messages (sender, receiver, added, msg, subject) VALUES(0, $arr[id], '$time', 'Congratulations, you were automatically promoted to Power User class. Please note that if your ratio drops below ".$minratio." at any time,  you will be demoted back to User', 'You have been promoted as Power User')");

write_log("<a href=account-details.php?id=$arr[id]><b>$username</b></a> has been promoted by System to <b>Power User</b> class");

}

//===| auto demote to user

$res = SQL_Query_exec("SELECT id, username, modcomment FROM users WHERE class = 2 AND uploaded / downloaded < $minratio");

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

$username = $arr[username];

$modcomment = $arr[modcomment];

$modcomment2 = gmdate("d-M-Y") . " - Has been demoted by System to User class n";

$modcomment = $modcomment2 . "" . $modcomment;

$modcom = sqlesc($modcomment);



SQL_Query_exec("UPDATE users SET class = 1, modcomment = CONCAT($modcom,modcomment) WHERE id = $arr[id]");

SQL_Query_exec("INSERT INTO messages (sender, receiver, added, msg, subject) VALUES(0, $arr[id], '$time', 'You were automatically demoted as User. That happened because your ratio dropped below ".$minratio."', 'You have been demoted as User')");

write_log("<a href=account-details.php?id=$arr[id]><b>$username</b></a> has been demoted by System to <b>User</b> class");

}

//===| End Auto Promote/Demote Users |===//

I forgot to mention something, into the original function "Delete User" is a bug.

Because of his the account is deleted directly, even if you write a reason or not.

I have corrected it.
Always annoyed me that does not register changes made by staff in a user profile.

So I changed this thing for the more important options and so far it seems that it works properly.

In account-details.php find this code:



begin_frame(T_("STAFF_ONLY_INFO"));




And delete everything starting with this code and ending with the first:





end_frame();




So you must delete the entire frame from the beginning at the end. Instead of this frame copy the following code:





begin_frame(T_("STAFF_ONLY_INFO"));

 

   $avatar = htmlspecialchars($user["avatar"]);

   $signature = htmlspecialchars($user["signature"]);

   $uploaded = $user["uploaded"];

   $downloaded = $user["downloaded"];

   $enabled = $user["enabled"] == 'yes';

   $warned = $user["warned"] == 'yes';

   $forumbanned = $user["forumbanned"] == 'yes';

   $username = htmlspecialchars($user[username]);

   $modcomment = htmlspecialchars($user["modcomment"]);

   $info = htmlspecialchars($user["info"]);

 

   $teams = "<option value='0'>--- ".T_("NONE_SELECTED")." ---&nbsp;</option>\n";

   $sashok = SQL_Query_exec("SELECT id,name FROM teams ORDER BY name");

   while ($sasha = mysql_fetch_array($sashok))

   $teams .= "<option value='$sasha[id]'" . ($user["team"] == $sasha['id'] ? " selected='selected'" : "") . ">$sasha[name]</option>\n";

 

   print("<table width='99%' align='center' border='0' cellspacing='0' cellpadding='5'>\n");



//===| Start Recorded Changes |===//



   //change username

   if (get_user_class() >= 6) {

       print("<form method='post' action='admin-modtasks.php'>\n");

       print("<input type='hidden' name='action' value='name' />\n");

       print("<input type='hidden' name='userid' value='$id' />\n");

       print("<input type='hidden' name='username' value='".$user["username"]."' />\n");

       print("<tr><td width='15%'>".T_("USERNAME").": </td><td width='84%' align='left'><input type='text' size='24' name='name' value=\"" . $username . "\">\n");

       print("<font style='margin-left:7px'><input type='submit' value='Change Name' /></font>\n");

       print("</td></tr>\n");

       print("</form>\n");

   }

 

   //change email

   if (get_user_class() >= 6) {

       print("<form method='post' action='admin-modtasks.php'>\n");

       print("<input type='hidden' name='action' value='email' />\n");

       print("<input type='hidden' name='userid' value='$id' />\n");

       print("<input type='hidden' name='username' value='".$user["username"]."' />\n");

       print("<input type='hidden' name='oldemail' value=\"$user[email]\" />\n");

       print("<tr><td>".T_("EMAIL")."</td><td align='left'><input type='text' size='24' name='email' value=\"$user[email]\" />\n");

       print("<font style='margin-left:7px'><input type='submit' value='Change Email' /></font>\n");

       print("</td></tr>\n");

       print("</form>\n");

   }

 

   //change upload

   if (get_user_class() >= 6) {

       print("<form method='post' action='admin-modtasks.php'>\n");

       print("<input type='hidden' name='action' value='uploaded' />\n");

       print("<input type='hidden' name='userid' value='$id' />\n");

       print("<input type='hidden' name='username' value='".$user["username"]."' />\n");

       print("<input type='hidden' name='oldupload' value='".$user["uploaded"]."' />\n");

       print("<tr><td>".T_("UPLOADED")."</td><td align='left'><input type='text' size='24' name='uploaded' value=\"".mksize($user["uploaded"], 9)."\" /></font>\n");

       print("<font style='margin-left:7px'><input type='submit' value='Change Upload' />\n");

       print("</td></tr>\n");

       print("</form>\n");

   }

 

   //change download

   if (get_user_class() >= 6) {

       print("<form method='post' action='admin-modtasks.php'>\n");

       print("<input type='hidden' name='action' value='downloaded' />\n");

       print("<input type='hidden' name='userid' value='$id' />\n");

       print("<input type='hidden' name='username' value='".$user["username"]."' />\n");

       print("<input type='hidden' name='olddownload' value='".$user["downloaded"]."' />\n");

       print("<tr><td>".T_("DOWNLOADED")."</td><td align='left'><input type='text' size='24' name='downloaded' value=\"".mksize($user["downloaded"], 9)."\" /></font>\n");

       print("<font style='margin-left:7px'><input type='submit' value='Change Download' />\n");

       print("</td></tr>\n");

       print("</form>\n");

   }

 

   //change team

   if (get_user_class() >= 5) {

       print("<form method='post' action='admin-modtasks.php'>\n");

       print("<input type='hidden' name='action' value='teams' />\n");

       print("<input type='hidden' name='userid' value='$id' />\n");

       print("<input type='hidden' name='username' value='".$user["username"]."' />\n");

       print("<tr><td>".T_("TEAM").": </td><td align='left'><select name='teams'>\n$teams\n</select>");

       print("<font style='margin-left:12px'><input type='submit' value='Change Team' /></font>\n");

       print("</td></tr>\n");

       print("</form>\n");

   }

 

   //change user class

   if (get_user_class() >= 5) {

       print("<form method='post' action='admin-modtasks.php'>\n");

       print("<input type='hidden' name='action' value='class' />\n");

       print("<input type='hidden' name='userid' value='$id' />\n");

       print("<input type='hidden' name='username' value='".$user["username"]."' />\n");

       if ($CURUSER["class"] > $user["class"]){

           print("<tr><td width='15%'>".T_("USER")." ".T_("CLASS").": </td><td width='84%' align='left'><select name='class'>\n");

           $maxclass = $CURUSER["class"];

           for ($i = 1; $i < $maxclass; ++$i)

           print("<option value='$i' " . ($user["class"] == $i ? " selected='selected'" : "") . ">$prefix" . get_user_class_name($i) . " &nbsp; &nbsp; &nbsp;\n");

           print("</select>\n");

       }

       print("<font style='margin-left:7px'><input type='submit' value='Change Class' /></font>\n");

       print("</td></tr>\n");

       print("</form>\n");

   }



   //change invites

   if (get_user_class() >= 5) {

       print("<form method='post' action='admin-modtasks.php'>\n");

       print("<input type='hidden' name='action' value='invites' />\n");

       print("<input type='hidden' name='userid' value='$id' />\n");

       print("<input type='hidden' name='username' value='".$user["username"]."' />\n");

       print("<input type='hidden' name='oldinvites' value='".$user["invites"]."' />\n");

       print("<tr><td>".T_("INVITES").": </td><td align='left'><input type='text' size='4' name='invites' value='".$user["invites"]."' />\n");

       print("<font style='margin-left:7px'><input type='submit' value='Change Invites&nbsp;' /></font>\n");

       print("</td></tr>\n");

       print("</form>\n");

   }

 

   //forum banned

   if (get_user_class() >= 5) {

       print("<form method='post' action='admin-modtasks.php'>\n");

       print("<input type='hidden' name='action' value='forumbanned' />\n");

       print("<input type='hidden' name='userid' value='$id' />\n");

       print("<input type='hidden' name='username' value='".$user["username"]."' />\n");

       print("<tr><td>".T_("FORUM_BANNED").": </td><td align='left'><input name='forumbanned' value='yes' type='radio' " . ($forumbanned ? " checked='checked'" : "") . " /> Yes &nbsp; <input name='forumbanned' value='no' type='radio' " . (!$forumbanned ? " checked='checked'" : "") . " /> No\n");

       print("<font style='margin-left:7px'><input type='submit' value='Submit' /></font>\n");

       print("</td></tr>\n");

       print("</form>\n");

   }

 

   //disable/enable account

   if (get_user_class() >= 5) {

       print("<form method='post' action='admin-modtasks.php'>\n");

       print("<input type='hidden' name='action' value='enabled' />\n");

       print("<input type='hidden' name='userid' value='$id' />\n");

       print("<input type='hidden' name='username' value='".$user["username"]."' />\n");

       print("<tr><td>Account Enabled: </td><td align='left'><input name='enabled' value='yes' type='radio' " . ($enabled ? " checked='checked'" : "") . " /> <font color='limegreen'>Yes</font> &nbsp; <input name='enabled' value='no' type='radio' " . (!$enabled ? " checked='checked' " : "") . " /> <font color='red'>No</font>\n");

       print("<font style='margin-left:9px'><input type='submit' value='Submit' /></font>\n");

       print("</td></tr>\n");

       print("</form>\n");

   }

 

   //change password

   if (get_user_class() >= 5) {

       print("<form method='post' action='admin-modtasks.php'>\n");

       print("<input type='hidden' name='action' value='password' />\n");

       print("<input type='hidden' name='userid' value='$id' />\n");

       print("<input type='hidden' name='username' value='".$user["username"]."' />\n");

       print("<tr><td>New Password: </td><td align='left'><input type='password' size='24' name='password' value=\"\" />\n");

       print("<font style='margin-left:9px'><input type='submit' value='".T_("CHANGE_PASS")."' /></font>\n");

       print("</td></tr>\n");

       print("</form>\n");

   }



//====| End Recorded Changes |====//



   print("<tr><td height='7'></td></tr>\n");



   print("</table>\n");

   print("<table class='f-border comment' width='99%' align='center' cellspacing='0' cellpadding='5'>");



   print("<form method='post' action='admin-modtasks.php'>\n");

   print("<input type='hidden' name='action' value='edituser' />\n");

   print("<input type='hidden' name='userid' value='$id' />\n");

   print("<input type='hidden' name='username' value='".$user["username"]."' />\n");

 

   print("<tr><td height='7'></td></tr>\n");

 

   if (get_user_class() == 7) {

       print("<tr><td>".T_("DONATED_US").": </td><td align='left'><input type='text' size='4' name='donated' value='$user[donated]' /></td></tr>\n");

   } else {

       print("<tr><td>".T_("DONATED_US").": </td><td align='left'><input type='text' size='4' name='donated' value='$user[donated]' readonly='readonly' /></td></tr>\n");

   }

 

   if (get_user_class() == 7) {

       print("<tr><td>".T_("IP_ADDRESS").": </td><td align='left'><input type='text' size='14' name='ip' value=\"$user[ip]\" /></td></tr>\n");

   } else {

       print("<tr><td>".T_("IP_ADDRESS").": </td><td align='left'><input type='text' size='14' name='ip' value=\"$user[ip]\" readonly='readonly' /></td></tr>\n");

   }



   print("<tr><td style='padding-top:10px' width='15%'>".T_("TITLE").": </td><td style='padding-top:10px' width='84%' align='left'><textarea cols='70' rows='2' name='title'>".htmlspecialchars($user["title"])."</textarea></td></tr>\n");

   print("<tr><td>".T_("SIGNATURE").": </td><td align='left'><textarea cols='70' rows='10' name='signature'>".htmlspecialchars($user["signature"])."</textarea></td></tr>\n");

   print("<tr><td>".T_("AVATAR_URL").":</td><td align='left'><textarea cols='70' rows='2' name='avatar'>".htmlspecialchars($user["avatar"])."</textarea></td></tr>\n");

 

   if (get_user_class() == 7) {

       print("<tr><td>".T_("MOD_COMMENT").": </td><td align='left'><textarea cols='70' rows='15' name='modcomment'>".$modcomment."</textarea></td></tr>\n");

   } else {

       print("<tr><td>".T_("MOD_COMMENT").": </td><td align='left'><textarea cols='70' rows='15' name='modcomment' readonly='readonly'>".$modcomment."</textarea></tr>\n");

   }

 

   print("<tr><td>Special Notes: </td><td align='left'><textarea cols='70' rows='10' name='info'>$info</textarea><div style='margin-top:5px; margin-bottom:5px'><font size='2' color='red'>First time enter your username [<b>".$CURUSER["username"]."</b>] and then write your note!</font></div></td></tr>\n");

 

   if ($user[passkey] == '') {

       print("<tr><td>".T_("PASSKEY").": </td><td align='left'><font color='#FF0000'>This user has no passkey.</font></td></tr>\n");

   } else {

       print("<tr><td valign='top' style='padding-top:10px'>".T_("PASSKEY").": </td><td align='left'><div style='margin-top:5px; margin-bottom:5px'><b>$user[passkey]</b></div><input name='resetpasskey' value='yes' type='checkbox' /> ".T_("RESET_PASSKEY").". <font color='#FF0000'>".T_("RESET_PASSKEY_MSG").".</font></td></tr>\n");

   }

 

   print("<tr><td height='10px'></td></tr>");    // 10px space here

   print("<tr><td style='padding-bottom:10px' colspan='2' align='center'><input type='submit' value='Submit' /></td></tr>\n");

   print("</form>\n");

   print("</table>\n");



end_frame();






In admin-modtasks.php you must change the entire code with this one:





<?php

require_once("backend/functions.php");

dbconn(false);

loggedinonly();



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

   show_error_msg(T_("ACCESS_DENIED"),T_("YOU_DONT_HAVE_EDIT_USER_PERM"),1);



$action = $_POST["action"];



if (!$action)

   show_error_msg(T_("ERROR"), T_("TASK_NOT_FOUND"), 1);



//===| Start Edit User |===//

if ($action == 'edituser'){

   $curusername = ($CURUSER['username']);

   $curuserid = ($CURUSER['id']);

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

   $userid = $_POST["userid"];

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

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

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

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

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

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

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



   if (!is_valid_id($userid))

       show_error_msg(T_("EDITING_FAILED"), T_("INVALID_USERID"),1);



   SQL_Query_exec("UPDATE users SET title=$title, signature=$signature, avatar=$avatar, ip=$ip, donated=$donated, modcomment=$modcomment, info= $info, support=$support, supportfor=$supportfor WHERE id=$userid");

   write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> has edited user <a href=account-details.php?id=$userid><b>$username</b></a> details");



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

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

       write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> has reseted passkey for user <a href=account-details.php?id=$userid><b>$username</b></a>");

   }



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

 die;

}

//====| End Edit User |====//



//===| Start Forum Banned |===//

   if ($action == 'forumbanned') {

   $curusername = ($CURUSER['username']);

   $curuserid = ($CURUSER['id']);

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

   $userid = $_POST["userid"];

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

 

   $modcomment = $row['modcomment'];

   If ($_POST["forumbanned"] != 'yes') {

       $modcomment2 = gmdate("d-M-Y") . " - $curusername has removed ban on Forum for this user \n";

   } else {

       $modcomment2 = gmdate("d-M-Y") . " - $curusername has banned on Forum this user \n";

   }

   $modcomment = $modcomment2 . "" . $modcomment;

   $modcom = sqlesc($modcomment);

 

       SQL_Query_exec("UPDATE users SET forumbanned=$forumbanned, modcomment = CONCAT($modcom,modcomment) WHERE id = $userid");

       If ($_POST["forumbanned"] != 'yes') {

           write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> has removed ban on Forum for user <a href=account-details.php?id=$userid><b>$username</b></a>");

       } else {

           write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> has banned on Forum user <a href=account-details.php?id=$userid><b>$username</b></a>");

       }

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

   die;

   }

//====| End Forum Banned |====//



//===| Start Disable/Enable Account |===//

   if ($action == 'enabled') {

   $curusername = ($CURUSER['username']);

   $curuserid = ($CURUSER['id']);

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

   $userid = $_POST["userid"];

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

 

   $modcomment = $row['modcomment'];

   If ($_POST["enabled"] == 'yes') {

       $modcomment2 = gmdate("d-M-Y") . " - $curusername has enabled this account \n";

   } else {

       $modcomment2 = gmdate("d-M-Y") . " - $curusername has disabled this account \n";

   }

   $modcomment = $modcomment2 . "" . $modcomment;

   $modcom = sqlesc($modcomment);

 

       SQL_Query_exec("UPDATE users SET enabled=$enabled, modcomment = CONCAT($modcom,modcomment) WHERE id = $userid");

       If ($_POST["enabled"] == 'yes') {

           write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> has enabled user <a href=account-details.php?id=$userid><b>$username</b></a> account");

       } else {

           write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> has disabled user <a href=account-details.php?id=$userid><b>$username</b></a> account");

       }

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

   die;

   }

//====| End Disable/Enable Account |====//



//===| Start Change Invites |===//

   if ($action == 'invites') {

   $curusername = ($CURUSER['username']);

   $curuserid = ($CURUSER['id']);

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

   $userid = $_POST["userid"];

   $invites = $_POST["invites"];

   $oldinvites = $_POST["oldinvites"];

 

   $modcomment = $row['modcomment'];

   $modcomment2 = gmdate("d-M-Y") . " - $curusername has changed Invites from $oldinvites to: $invites \n";

   $modcomment = $modcomment2 . "" . $modcomment;

   $modcom = sqlesc($modcomment);

 

       SQL_Query_exec("UPDATE users SET invites=$invites, modcomment = CONCAT($modcom,modcomment) WHERE id = $userid");

       write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> has changed Invites for user <a href=account-details.php?id=$userid><b>$username</b></a> from <b>$oldinvites</b> to: <b>$invites</b>");

 

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

   die;

   }

//====| End Change Invites |====//



//===| Start Change Team |===//

   if ($action == 'teams') {

   $curusername = ($CURUSER['username']);

   $curuserid = ($CURUSER['id']);

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

   $userid = $_POST["userid"];

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

 

   $query = "SELECT * FROM teams WHERE id='$teams'";

   $result = SQL_Query_exec($query);

   $row = mysql_fetch_array($result);

       if ($teams == 0) {

           $teamname = ("None selected");

       } else {

           $teamname = $row['name'];

       }

 

   $modcomment = $row['modcomment'];

   $modcomment2 = gmdate("d-M-Y") . " - $curusername has changed Team to: $teamname \n";

   $modcomment = $modcomment2 . "" . $modcomment;

   $modcom = sqlesc($modcomment);

 

       SQL_Query_exec("UPDATE users SET team=$teams, modcomment = CONCAT($modcom,modcomment) WHERE id = $userid");

       write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> has changed Team for user <a href=account-details.php?id=$userid><b>$username</b></a> to: <b>$teamname</b>");

 

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

   die;

   }

//====| End Change Team |====//



//===| Start Change User class |===//

   if ($action == 'class') {

   $curusername = ($CURUSER['username']);

   $curuserid = ($CURUSER['id']);

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

   $userid = $_POST["userid"];

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

   $classname = get_user_class_name($class);

 

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

   $arr = mysql_fetch_row($res);

   $uc = $arr[0];

 

   // skip if class is same as current

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

       if ($userid == $CURUSER["id"]) {

           show_error_msg(T_("EDITING_FAILED"), T_("YOU_CANT_DEMOTE_YOURSELF"),1);

       } elseif ($uc >= get_user_class()) {

           show_error_msg(T_("EDITING_FAILED"), T_("YOU_CANT_DEMOTE_SOMEONE_SAME_LVL"),1);

       } else {

           @SQL_Query_exec("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());

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

       }

   }

 

   $modcomment = $row['modcomment'];

   $modcomment2 = gmdate("d-M-Y") . " - $curusername has changed user class to: $classname \n";

   $modcomment = $modcomment2 . "" . $modcomment;

   $modcom = sqlesc($modcomment);

 

       SQL_Query_exec("UPDATE users SET modcomment = CONCAT($modcom,modcomment) WHERE id = $userid");

       write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> has changed class for user <a href=account-details.php?id=$userid><b>$username</b></a> to <b>$classname</b>");

 

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

   die;

   }

//====| End Change User class |====//



//===| Start Change Password |===//

   if ($action == 'password') {

   $curusername = ($CURUSER['username']);

   $curuserid = ($CURUSER['id']);

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

   $userid = $_POST["userid"];

   $password = $_POST["password"];

 

   if ($password == '') {

       show_error_msg(T_("ERROR"), "You must enter something for Password!", 1);

   } else {

       $modcomment = $row['modcomment'];

       $modcomment2 = gmdate("d-M-Y") . " - $curusername has changed password \n";

       $modcomment = $modcomment2 . "" . $modcomment;

       $modcom = sqlesc($modcomment);

     

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

       $passres = mysql_fetch_assoc($passreq);

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

           $password = passhash($password);

         

           SQL_Query_exec("UPDATE users SET password='$password', modcomment = CONCAT($modcom,modcomment) WHERE id=$userid");

           write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> has changed password for user: <a href=account-details.php?id=$userid><b>$username</b></a>");

       }

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

       die;

       }

   }

//====| End Change Password |====//



//===| Start Change User name |===//

   if ($action == 'name') {

   $curusername = ($CURUSER['username']);

   $curuserid = ($CURUSER['id']);

   $userid = $_POST["userid"];

   $newname = sqlesc($_POST["name"]);

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

 

   if ($_POST["name"] == '') {

           show_error_msg(T_("ERROR"), "You must enter something for User Name!", 1);

   } else {

       $modcomment = $row['modcomment'];

       $modcomment2 = gmdate("d-M-Y") . " - $curusername has changed user name from $oldname to: $newname \n";

       $modcomment = $modcomment2 . "" . $modcomment;

       $modcom = sqlesc($modcomment);

 

           SQL_Query_exec("UPDATE users SET username=$newname, modcomment = CONCAT($modcom,modcomment) WHERE id = $userid");

           write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> has changed name for user <b>$oldname</b> into: <a href=account-details.php?id=$userid><b>$newname</b></a>");

 

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

       die;

       }

   }

//====| End Change User name |====//



//===| Start Change Email |===//

   if ($action == 'email') {

   $curusername = ($CURUSER['username']);

   $curuserid = ($CURUSER['id']);

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

   $userid = $_POST["userid"];

   $email = $_POST["email"];

   $oldemail = $_POST["oldemail"];

 

   if ($_POST["email"] == '') {

           show_error_msg(T_("ERROR"), "You must enter something for Email!", 1);

   } else {

       if (!validemail($email))

           show_error_msg(T_("EDITING_FAILED"), T_("EMAIL_ADDRESS_NOT_VALID"), 1);

     

       $modcomment = $row['modcomment'];

       $modcomment2 = gmdate("d-M-Y") . " - $curusername has changed email from $oldemail to: $email \n";

       $modcomment = $modcomment2 . "" . $modcomment;

       $modcom = sqlesc($modcomment);

     

           SQL_Query_exec("UPDATE users SET email='$email', modcomment = CONCAT($modcom,modcomment) WHERE id = $userid");

           write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> has changed email for user <a href=account-details.php?id=$userid><b>$username</b></a> from <b>$oldemail</b> to: <b>$email</b>");

     

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

       die;

       }

   }

//====| End Change Email |====//



//===| Start Change Upload |===//

   if ($action == 'uploaded') {

   $curusername = ($CURUSER['username']);

   $curuserid = ($CURUSER['id']);

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

   $userid = $_POST["userid"];

   $uploaded = strtobytes($_POST["uploaded"]);

   $upload = mksize($uploaded);

   $olduploaded = $_POST["oldupload"];

   $oldupload = mksize($olduploaded);

 

   $modcomment = $row['modcomment'];

   $modcomment2 = gmdate("d-M-Y") . " - $curusername has changed upload from $oldupload to: $upload \n";

   $modcomment = $modcomment2 . "" . $modcomment;

   $modcom = sqlesc($modcomment);

 

       SQL_Query_exec("UPDATE users SET uploaded='$uploaded', modcomment = CONCAT($modcom,modcomment) WHERE id = $userid");

       write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> has changed upload for user <a href=account-details.php?id=$userid><b>$username</b></a> from <b>$oldupload</b> to: <b>$upload</b>");

 

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

   die;

   }

//====| End Change Upload |====//



//===| Start Change Download |===//

   if ($action == 'downloaded') {

   $curusername = ($CURUSER['username']);

   $curuserid = ($CURUSER['id']);

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

   $userid = $_POST["userid"];

   $downloaded = strtobytes($_POST["downloaded"]);

   $download = mksize($downloaded);

   $olddownloaded = $_POST["olddownload"];

   $olddownload = mksize($olddownloaded);

 

   $modcomment = $row['modcomment'];

   $modcomment2 = gmdate("d-M-Y") . " - $curusername has changed download from $olddownload to: $download \n";

   $modcomment = $modcomment2 . "" . $modcomment;

   $modcom = sqlesc($modcomment);

 

       SQL_Query_exec("UPDATE users SET downloaded='$downloaded', modcomment = CONCAT($modcom,modcomment) WHERE id = $userid");

       write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> has changed download for user <a href=account-details.php?id=$userid><b>$username</b></a> from <b>$olddownload</b> to: <b>$download</b>");

 

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

   die;

   }

//====| End Change Download |====//



//===| Start Warnings |===//

if ($action == 'addwarning') {

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

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

   $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(T_("EDITING_FAILED"), T_("INVALID_USERID"),1);



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

       show_error_msg(T_("ERROR"), T_("MISSING_FORM_DATA").".", 1);

   }



   $timenow = get_date_time();



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



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



   $ret = SQL_Query_exec("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());

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



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

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

   die;

}

//====| End Warnings |====//



//===| Start Delete User |===//

if ($action == "deleteaccount") {

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

       show_error_msg(T_("ERROR"), T_("TASK_ADMIN"),1);



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

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

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



   if (!is_valid_id($userid))

       show_error_msg(T_("FAILED"), T_("INVALID_USERID"),1);

     

   if ($CURUSER["id"] == $userid)

       show_error_msg("Error", "You cannot delete yourself.", 1);

 

   If ($_POST["delreason"] == '') {

       show_error_msg(T_("ERROR"), T_("MISSING_FORM_DATA"), 1);

   }

   deleteaccount($userid);

   write_log("<b>".$CURUSER['username']."</b> has deleted account: <b>$username</b>. Reason: $delreason");



   show_error_msg(T_("COMPLETED"), T_("USER_DELETE"), 1);

   die;

}

//====| End Delete User |====//

?>

The problem is that this member has no confirmed invitees, so what do you want to see?
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: 1
  • Members: 0
  • Guests online: 1
  • Comments: 3
  • Messages: 1,728