Salut, voci un petit code pour bani d'upload, mais avant tout vous devriez installer ce mode [url="http://www.torrenttrader.pw/topic/17550-recorded-actions-for-changes-into-account-details/"]http://www.torrenttrader.pw/topic/17550-recorded-actions-for-changes-into-account-details/[/url]
---------------------------------------------------------------------------------------------
Hi this is a young code that a create to ban d'upload, but for the firt time you must to install this code [url="http://www.torrenttrader.pw/topic/17550-recorded-actions-for-changes-into-account-details/"]http://www.torrenttrader.pw/topic/17550-recorded-actions-for-changes-into-account-details/[/url]
Desole pour mon vieux anglais
-----------------
Sorry for my bad english
1- SQL
ALTER TABLE users ADD `uploadbanned` CHAR(3) NOT NULL DEFAULT 'no' AFTER `forumbanned`;
ALTER TABLE `users` ADD `uploadbanneduntil` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `uploadbanned`
2- Chercher dans / Search in ======> account-details
$forumbanned = $user["forumbanned"] == 'yes';
et ajoute ca au dessous / and add that below
$uploadbanned = $user["uploadbanned"] == 'yes';
3- apres ton code forum ajoute / after your code forum add
$uploadbanneduntil = $user["uploadbanneduntil"];
if ($uploadbanneduntil != "0000-00-00 00:00:00"){
$banuploaduntil = "Remains: <font color=red><b>".mkprettytime(strtotime($uploadbanneduntil) - gmtime())."</b></font> to go...";
} else {
$banuploaduntil = "";
}
print("<tr><td height='5'></td></tr>n"); //===| 5px space here!
//upload banned
if (get_user_class() >= 5) {
print("<form method='post' action='admin-modtasks.php'>n");
print("<input type='hidden' name='action' value='uploadbanned' />n");
print("<input type='hidden' name='userid' value='$id' />n");
print("<input type='hidden' name='username' value='".$user["username"]."' />n");
print("<tr><td>".T_("UPLOAD_BANNED").": </td><td class='table_col2' align='left'><input name='uploadbanned' value='yes' type='radio' " . ($uploadbanned ? " checked='checked'" : "") . " /> Yes <input name='uploadbanned' value='no' type='radio' " . (!$uploadbanned ? " checked='checked'" : "") . " /> Non");
print("<font style='margin-left:15px; margin-right:20px'>Banned for: <input type='text' size='4' name='uploadbannedlength' /> days</font>$banuploaduntiln");
print("<div style='margin-top:5px'>Raison: <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");
}
4- dans admin-modtasks ajoute ca / in admin-modtasks add
//===| Start Upload Banned |===//
if ($action == 'uploadbanned') {
$curusername = ($CURUSER['username']);
$curuserid = ($CURUSER['id']);
$username = sqlesc($_POST["username"]);
$userid = $_POST["userid"];
$uploadbanned = sqlesc($_POST["uploadbanned"]);
$uploadbannedlength = sqlesc($_POST["uploadbannedlength"]);
$uploadbanneduntil = get_date_time(gmtime() + $uploadbannedlength * 86400);
$days = $uploadbannedlength . " day" . ($uploadbannedlength > 1 ? "s" : "");
$fbreason = $_POST["forbanreason"];
if ($_POST["uploadbanned"] == 'yes' && $_POST["uploadbannedlength"] == '') {
show_error_msg(T_("ERROR"), "Vous devez spécifier le nombre de jours!   [<a href=account-details.php?id=$userid><b>Retour</b></a>]", 1);
}
if ($_POST["uploadbanned"] == 'yes' && $_POST["forbanreason"] == '') {
show_error_msg(T_("ERROR"), "Vous devez fournir une raison pour cette action!   [<a href=account-details.php?id=$userid><b>Retour</b></a>]", 1);
}
$modcomment = $row['modcomment'];
If ($_POST["uploadbanned"] != 'yes') {
$modcomment2 = gmdate("d-M-Y") . " - $curusername a supprimé l'interdiction de upload. n";
} else {
$modcomment2 = gmdate("d-M-Y") . " - $curusername a ajouté l'interdiction de upload. for $daysn- Reason: $fbreason n";
}
$modcomment = $modcomment2 . "" . $modcomment;
$modcom = sqlesc($modcomment);
If ($_POST["uploadbanned"] != 'yes') {
SQL_Query_exec("UPDATE users SET uploadbanned=$uploadbanned, uploadbanneduntil = '0000-00-00 00:00:00', modcomment = CONCAT($modcom,modcomment) WHERE id = $userid");
$msg = sqlesc("Votre interdiction Upload a été supprimé par ".$curusername."");
$added = sqlesc(get_date_time());
SQL_Query_exec("INSERT INTO messages (sender, receiver, msg, added, subject) VALUES(0, $userid, $msg, $added, 'Ban Upload')");
write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> a supprimé l'interdiction sur le Upload pour l'utilisateur <a href=account-details.php?id=$userid><b>$username</b></a>");
} else {
SQL_Query_exec("UPDATE users SET uploadbanned=$uploadbanned, uploadbanneduntil = '$uploadbanneduntil', modcomment = CONCAT($modcom,modcomment) WHERE id = $userid");
$msg = sqlesc("Vous etes banni de Upload pour ".$days." par ".$curusername."nnReason: ".$fbreason."");
$added = sqlesc(get_date_time());
SQL_Query_exec("INSERT INTO messages (sender, receiver, msg, added, subject) VALUES(0, $userid, $msg, $added, 'Ban Upload')");
write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> a interdit à l'utilisateur du Upload. <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 Upload Banned |====//
5- dans torrent-upload ajoute/in torrent-upload add
if($CURUSER["can_upload"]=="no" || $CURUSER["uploadbanned"] == "yes")
6- pour retire la ban automatique ajoute dans / to remove te ban auto add in ======> cleanup
# Remove ban on upload
$res32 = SQL_Query_exec("SELECT id FROM users WHERE uploadbanned='yes' AND uploadbanneduntil < NOW() AND uploadbanneduntil <> '0000-00-00 00:00:00'");
if (mysql_num_rows($res32) > 0)
{
$dt = sqlesc(get_date_time());
$msg = sqlesc("Your ban on upload has been removed.n");
while ($arr = mysql_fetch_assoc($res32))
{
SQL_Query_exec("UPDATE users SET uploadbanned = 'no', uploadbanneduntil = '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)");
}
}
big thank Artic
PS: [size=18px]Desoler je ne sais pas comment cree se code si une personne sait faire je serais ravi[/size]
-------------------------------------------------------------------------------------------------------------
PS: [size=18px]Sorry, i don't know how to create this code, if some one can create it i will be happy[/size]
[size=14px]UPDATE SQL[/size]
---------------------------------------------------------------------------------------------
Hi this is a young code that a create to ban d'upload, but for the firt time you must to install this code [url="http://www.torrenttrader.pw/topic/17550-recorded-actions-for-changes-into-account-details/"]http://www.torrenttrader.pw/topic/17550-recorded-actions-for-changes-into-account-details/[/url]
Desole pour mon vieux anglais
-----------------
Sorry for my bad english
1- SQL
ALTER TABLE users ADD `uploadbanned` CHAR(3) NOT NULL DEFAULT 'no' AFTER `forumbanned`;
ALTER TABLE `users` ADD `uploadbanneduntil` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `uploadbanned`
2- Chercher dans / Search in ======> account-details
$forumbanned = $user["forumbanned"] == 'yes';
et ajoute ca au dessous / and add that below
$uploadbanned = $user["uploadbanned"] == 'yes';
3- apres ton code forum ajoute / after your code forum add
$uploadbanneduntil = $user["uploadbanneduntil"];
if ($uploadbanneduntil != "0000-00-00 00:00:00"){
$banuploaduntil = "Remains: <font color=red><b>".mkprettytime(strtotime($uploadbanneduntil) - gmtime())."</b></font> to go...";
} else {
$banuploaduntil = "";
}
print("<tr><td height='5'></td></tr>n"); //===| 5px space here!
//upload banned
if (get_user_class() >= 5) {
print("<form method='post' action='admin-modtasks.php'>n");
print("<input type='hidden' name='action' value='uploadbanned' />n");
print("<input type='hidden' name='userid' value='$id' />n");
print("<input type='hidden' name='username' value='".$user["username"]."' />n");
print("<tr><td>".T_("UPLOAD_BANNED").": </td><td class='table_col2' align='left'><input name='uploadbanned' value='yes' type='radio' " . ($uploadbanned ? " checked='checked'" : "") . " /> Yes <input name='uploadbanned' value='no' type='radio' " . (!$uploadbanned ? " checked='checked'" : "") . " /> Non");
print("<font style='margin-left:15px; margin-right:20px'>Banned for: <input type='text' size='4' name='uploadbannedlength' /> days</font>$banuploaduntiln");
print("<div style='margin-top:5px'>Raison: <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");
}
4- dans admin-modtasks ajoute ca / in admin-modtasks add
//===| Start Upload Banned |===//
if ($action == 'uploadbanned') {
$curusername = ($CURUSER['username']);
$curuserid = ($CURUSER['id']);
$username = sqlesc($_POST["username"]);
$userid = $_POST["userid"];
$uploadbanned = sqlesc($_POST["uploadbanned"]);
$uploadbannedlength = sqlesc($_POST["uploadbannedlength"]);
$uploadbanneduntil = get_date_time(gmtime() + $uploadbannedlength * 86400);
$days = $uploadbannedlength . " day" . ($uploadbannedlength > 1 ? "s" : "");
$fbreason = $_POST["forbanreason"];
if ($_POST["uploadbanned"] == 'yes' && $_POST["uploadbannedlength"] == '') {
show_error_msg(T_("ERROR"), "Vous devez spécifier le nombre de jours!   [<a href=account-details.php?id=$userid><b>Retour</b></a>]", 1);
}
if ($_POST["uploadbanned"] == 'yes' && $_POST["forbanreason"] == '') {
show_error_msg(T_("ERROR"), "Vous devez fournir une raison pour cette action!   [<a href=account-details.php?id=$userid><b>Retour</b></a>]", 1);
}
$modcomment = $row['modcomment'];
If ($_POST["uploadbanned"] != 'yes') {
$modcomment2 = gmdate("d-M-Y") . " - $curusername a supprimé l'interdiction de upload. n";
} else {
$modcomment2 = gmdate("d-M-Y") . " - $curusername a ajouté l'interdiction de upload. for $daysn- Reason: $fbreason n";
}
$modcomment = $modcomment2 . "" . $modcomment;
$modcom = sqlesc($modcomment);
If ($_POST["uploadbanned"] != 'yes') {
SQL_Query_exec("UPDATE users SET uploadbanned=$uploadbanned, uploadbanneduntil = '0000-00-00 00:00:00', modcomment = CONCAT($modcom,modcomment) WHERE id = $userid");
$msg = sqlesc("Votre interdiction Upload a été supprimé par ".$curusername."");
$added = sqlesc(get_date_time());
SQL_Query_exec("INSERT INTO messages (sender, receiver, msg, added, subject) VALUES(0, $userid, $msg, $added, 'Ban Upload')");
write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> a supprimé l'interdiction sur le Upload pour l'utilisateur <a href=account-details.php?id=$userid><b>$username</b></a>");
} else {
SQL_Query_exec("UPDATE users SET uploadbanned=$uploadbanned, uploadbanneduntil = '$uploadbanneduntil', modcomment = CONCAT($modcom,modcomment) WHERE id = $userid");
$msg = sqlesc("Vous etes banni de Upload pour ".$days." par ".$curusername."nnReason: ".$fbreason."");
$added = sqlesc(get_date_time());
SQL_Query_exec("INSERT INTO messages (sender, receiver, msg, added, subject) VALUES(0, $userid, $msg, $added, 'Ban Upload')");
write_log("<a href=account-details.php?id=$curuserid><b>$curusername</b></a> a interdit à l'utilisateur du Upload. <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 Upload Banned |====//
5- dans torrent-upload ajoute/in torrent-upload add
if($CURUSER["can_upload"]=="no" || $CURUSER["uploadbanned"] == "yes")
6- pour retire la ban automatique ajoute dans / to remove te ban auto add in ======> cleanup
# Remove ban on upload
$res32 = SQL_Query_exec("SELECT id FROM users WHERE uploadbanned='yes' AND uploadbanneduntil < NOW() AND uploadbanneduntil <> '0000-00-00 00:00:00'");
if (mysql_num_rows($res32) > 0)
{
$dt = sqlesc(get_date_time());
$msg = sqlesc("Your ban on upload has been removed.n");
while ($arr = mysql_fetch_assoc($res32))
{
SQL_Query_exec("UPDATE users SET uploadbanned = 'no', uploadbanneduntil = '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)");
}
}
big thank Artic
PS: [size=18px]Desoler je ne sais pas comment cree se code si une personne sait faire je serais ravi[/size]
-------------------------------------------------------------------------------------------------------------
PS: [size=18px]Sorry, i don't know how to create this code, if some one can create it i will be happy[/size]
[size=14px]UPDATE SQL[/size]
ALTER TABLE `users` ADD `uploadbanned` CHAR(3) NOT NULL DEFAULT 'no';
ALTER TABLE `users` ADD `uploadbanneduntil` datetime NOT NULL DEFAULT '0000-00-00 00:00:00';
ALTER TABLE `users` ADD `forumbanned` CHAR(3) NOT NULL DEFAULT 'no';
ALTER TABLE `users` ADD `forumbanneduntil` datetime NOT NULL DEFAULT '0000-00-00 00:00:00';

[/url]