"STorrents2020, post: 69538, member: 20382":
Those variables in the query may need double quotes to be valid, I prepare these in a array usually so may of missed legacy approach
$res22 = SQL_Query_exec("SELECT `id`, `username` FROM `users` WHERE class = $regular AND `uploaded` > = $limit AND `uploaded/downloaded` > = $minratio AND `added` < $maxdt");
// Auto promote users
$regular = 1; // Regular class ID
$promotclass = 2; // Promoted class ID
$limit = 25 * 1024 * 1024 * 1024;
$minratio = 1.05;
$maxdt = get_date_time(time() - 86400 * 28);
$res22 = SQL_Query_exec("SELECT `id`, `username` FROM `users` WHERE class = $regular AND `uploaded` > = $limit AND `uploaded/downloaded` > = $minratio AND `added` < $maxdt");
if ($res22) {
$dt = get_date_time();
$msg = "Félicitations, vous avez été automatiquement promu Super Membre. \rVous pouvez maintenant faire plus de choses. ";
while ($arr = mysqli_fetch_assoc($res22)) {
SQL_Query_exec("UPDATE users SET class = $promotclass WHERE id = $arr[id]");
$txt = "Vous avez été promu utilisateur avancé!";
$event = "$arr[username] a été promu Super Membre";
SQL_Query_exec("INSERT INTO messages (sender, receiver, added, msg, poster) VALUES(0, $arr[id], $dt, $txt, 0)");
SQL_Query_exec("INSERT INTO ajshoutbox (uid, date, name, text) VALUES (NULL, $arr[username], $event, $dt, 0)");
write_log("L utilisateur <a href=\"/user/?id=$arr[id]\">$arr[username]</a> a été automatiquement promu Super Membre.");
}
}
"niki, post: 69540, member: 20338":
Bonjour spiriteblue test celui ci-dessous et devrais fonctionner
####################################
# AUTO PROMOTE SUPER MEMBRES #
####################################
$gigs = 25*1073741824; // 25 GB
$res_premote = SQL_Query_exec("SELECT id FROM users WHERE class = 1 AND uploaded >= $gigs AND (uploaded / downloaded) >= 1.0");
$time = get_date_time();
while ($arr_premote = mysqli_fetch_assoc($res_premote)) {
SQL_Query_exec("UPDATE users SET class = 2 WHERE id = $arr_premote[id]");
SQL_Query_exec("INSERT INTO messages (sender, receiver, added, msg, subject) VALUES(0, $arr_premote[id], '$time', '
Félicitations, vous avez été automatiquement promu Membre pour Super Membre vous pouvez maintenant faire plus de choses.
, Si votre ratio tombe en dessous de 1,00, vous serez rétrogradé.', 'Vous avez été promu à: Super Membre')");
}
unset($res_premote,$arr_premote);
$res_demote = SQL_Query_exec("SELECT id FROM users WHERE class = 2 AND uploaded >= $gigs AND (uploaded / downloaded) <= 1.0");
while ($arr_demote = mysqli_fetch_assoc($res_demote)) {
SQL_Query_exec("UPDATE users SET class = 1 WHERE id = $arr_demote[id]");
SQL_Query_exec("INSERT INTO messages (sender, receiver, added, msg, subject) VALUES(0, $arr_demote[id], '$time', 'Vous avez été automatiquement rétrogradé deSuper Membre pourMembre.', 'Vous avez été rétrogradé au rang d'utilisateur')");
}
unset($res_demote,$arr_demote);
##########################
# END AUTO PROMOTE SUPEER MEMBRES#
##########################
"STorrents2020, post: 69413, member: 20382":
*** Post updated for both promoting/demoting with:
- Easier IDs for managing promoting/demoting by class
- Corrected datetime entry
Database Error in backend/cleanup.php on line 429: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '00:48:17' at line 1. Query was: SELECT id, username FROM users WHERE class = 1 AND uploaded >= 26843545600 AND uploaded / downloaded >= 1.05 AND added < 2020-10-15 00:48:17. $res22 = SQL_Query_exec("SELECT id, username FROM users WHERE class=$regular AND uploaded >= $limit AND uploaded / downloaded >= $minratio AND added < $maxdt");
// Auto promote users
$regular = 1; // Regular class ID
$promotclass = 2; // Promoted class ID
$limit = 25 * 1024 * 1024 * 1024;
$minratio = 1.05;
$maxdt = get_date_time(time() - 86400 * 28);
$res22 = SQL_Query_exec("SELECT id, username FROM users WHERE class=$regular AND uploaded >= $limit AND uploaded / downloaded >= $minratio AND added < $maxdt");
if ($res22) {
$dt = get_date_time();
$msg = "Félicitations, vous avez été automatiquement promu Super Membre. \rVous pouvez maintenant faire plus de choses. ";
while ($arr = mysqli_fetch_assoc($res22)) {
SQL_Query_exec("UPDATE users SET class = $promotclass WHERE id = $arr[id]");
$txt = "Vous avez été promu utilisateur avancé!";
$event = "$arr[username] a été promu Super Membre";
SQL_Query_exec("INSERT INTO messages (sender, receiver, added, msg, poster) VALUES(0, $arr[id], $dt, $txt, 0)");
SQL_Query_exec("INSERT INTO ajshoutbox (uid, date, name, text) VALUES (NULL, $arr[username], $event, $dt, 0)");
write_log("L utilisateur <a href=\"/user/?id=$arr[id]\">$arr[username]</a> a été automatiquement promu Super Membre.");
}
}
// Auto demote users
$minratio = 0.95;
$res22 = SQL_Query_exec("SELECT id, username FROM users WHERE class=$promotclass AND uploaded / downloaded < $minratio");
if ($res22) {
$dt = get_date_time();
$msg = "Vous avez été automatiquement rétrogradé de Super Mmebre à Membre parce que votre ratio de partage est tombé en dessous de $minratio.";
while ($arr = $res22->fetch()) {
SQL_Query_exec("UPDATE users SET class = $regular WHERE id = $arr[id]");
$txt = "Vous avez été rétrogradé au statut régulier!";
$event = "$arr[username] a été rétrogradé Membre";
SQL_Query_exec("INSERT INTO messages (sender, receiver, added, msg, poster) VALUES(0, $arr[id], $dt, $txt, 0)");
SQL_Query_exec("INSERT INTO ajshoutbox (uid, date, name, text) VALUES (NULL, $arr[username], $event, $dt, 0)");
write_log("L utilisateur <a href=\"/user/?id=$arr[id]\">$arr[username]</a> a été automatiquement rétrogradé au statut normal.");
}
}
// End auto promote users
"coco, post: 69530, member: 20298":
Thank you spiritblue but again same error :(
CREATE TABLE IF NOT EXISTS `helpdesk` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(60) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`msg_problem` text COLLATE utf8_unicode_ci,
`added` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`solved_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`solved` enum('no','yes','ignored') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'no',
`added_by` int(10) NOT NULL DEFAULT '0',
`solved_by` int(10) NOT NULL DEFAULT '0',
`msg_answer` text COLLATE utf8_unicode_ci,
UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3 ;
//=== HELP DESK message
if (get_user_class() >= 5){
$resa = SQL_Query_exec("select count(id) as problems from helpdesk WHERE solved = 'no'");
$arra = mysqli_fetch_assoc($resa);
$problems = $arra['problems'];
if ($problems > 0)
echo("<p><table align=center border=0 cellspacing=0 cellpadding=10 bgcolor=red><tr><td style='padding: 10px; background: #A60A15'>".
"Hi <b>$CURUSER[username]</b>, there ".($problems == 1 ? 'is' : 'are')." <b>$problems question".($problems == 1 ? '' : 's')."</b> at the HELP DESK that needs a reply.<br>please click <b><a href=helpdesk.php?action=problems>HERE</a></b> to deal with it.".
"</td></tr></table></p><br />");
}
"coco, post: 69528, member: 20298":
Can this mod be modified for TTv.3.0 MySQLI
I run UFFENO1 version but when post message and press Help Me give me error Database Error. Please report this to an administrator.
Thanks in advance
"coco, post: 69516, member: 20298":
Hi all. Give me this error after i replace all files: Warning: Use of undefined constant username - assumed 'username' (this will throw an Error in a future version of PHP) in /home/www/tbtw.space/backend/functions.php on line 971
[ATTACH=full]5955[/ATTACH]
ALTER TABLE `groups` ADD `Color` VARCHAR( 7 ) NOT NULL DEFAULT '#856A00' AFTER `level` ;
UPDATE `groups` SET `Color` = '#BD8B00' where group_id = 2;
UPDATE `groups` SET `Color` = '#FF5E00' where group_id = 3;
UPDATE `groups` SET `Color` = '#00ABA6' where group_id = 4;
UPDATE `groups` SET `Color` = '#007F00' where group_id = 5;
UPDATE `groups` SET `Color` = '#00C000' where group_id = 6;
UPDATE `groups` SET `Color` = '#FF0000' where group_id = 7;
"niki, post: 69461, member: 20338":
merci spiritblue sa ne fonctionne pas je regarde pour reprendre depuis le début plus tard
"niki, post: 69459, member: 20338":
merci mais je n'ai pas cette ligne
<link rel="stylesheet" href="<?php echo $site_config["SITEURL"]; ?>/themes/NOM ICI DU DOSSIER DE TON THEME PAR DEFAUT/top/style.css">
je joint le fichier header
<link rel="stylesheet" type="text/css" href="<?php echo $site_config["SITEURL"]; ?>/themes/NOM ICI DU DOSSIER DE TON THEME PAR DEFAUT/theme.css" />"niki, post: 69457, member: 20338":
merci de l'aide spiritblue j'ai fait comme tu dit et rien a faire ça ne fonctionne pas et merci quand même :rolleyes:
"niki, post: 69453, member: 20338":
Bonjour spiritblue c'est se que j'ai fait j'ai suivi les instructions et ça ne fonctionne pas faudrait remettre le module à jour se n'est pas clair tout est mélanger :rolleyes:
<link rel="stylesheet" type="text/css" href="<?php echo $site_config["SITEURL"]; ?>/themes/ICI LE NOM DE TON DOSSIER DU THEME PAR DEFAUT/theme.css" />
<!-- Lightbox pop-ups en style css/js -->
<link rel="stylesheet" type="text/css" href="<?php echo $site_config["SITEURL"]; ?>/js/prettyphoto/css/prettyPhoto.css" media="screen" charset="utf-8" />
<!-- Lightbox pop-ups -->
<script src="<?php echo $site_config["SITEURL"]; ?>/js/jquery-2.2.3.min.js"></script>
<script src="<?php echo $site_config["SITEURL"]; ?>/js/prettyphoto/js/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
$("a[rel^='prettyPhoto']").prettyPhoto({
callback: function(){}, /* Called when prettyPhoto is closed */
theme: 'pp_default', /* pp_default / light_rounded / dark_rounded / light_square / dark_square / facebook */
autoplay: true, /* Automatically start videos: True/False */
default_width: 854,
default_height: 480,
deeplinking: false,
animation_speed: 'normal', /* fast/slow/normal */
});
});
</script>
[/color]"niki, post: 69447, member: 20338":
Bonjour spititblue j'ai pas toucher au js mais peut tu me donner ton js et et autre fichier si il y a ? avec l'explication ou le mettre car j'ai peut être mal placer les fichier ??, merci d'avance de ton aide :D
"niki, post: 69444, member: 20338":
merci spiritblue et toujours pareille youtube ne s'ouvre pas dans une nouvelle fenêtre :rolleyes:
"niki, post: 69442, member: 20338":
merci spiritblue j'ai fait les changement et pour moi ça ne fonctionne pas:rolleyes:
case 'tube':
if ($row["tube"])
print("<td class='ttable_col$x' align='center'><a rel='prettyPhoto' href=".$row['tube']." data-title=\"".T_("VIDEO_WATCH_THIS_VIDEO")."\"><".htmlspecialchars($row['tube'])."><img src='".$site_config["SITEURL"]."/images/Torrents/youtube1.png' border='0' width='50' height='50' alt=\"".$row["name"]."\" /></a></td>");
else
print("<td class='ttable_colx' align='center'><img src='" .$site_config['SITEURL']. "/images/Torrents/no_youtube1.png' border='0' width='50' height='50' alt=\"\" data-title=\"".T_("VIDEO_WATCH_THIS_VIDEO")."\"/></td>");
break;
<a rel='prettyPhoto' href=".$row['tube']." data-title=\"".T_("VIDEO_WATCH_THIS_VIDEO")."\">"niki, post: 69434, member: 20338":
:rolleyes: Bonjour, quand j'ajoute la partie de code ci-dessous dans le fichier function.php l'image youtube n'est pas visible dans la page des torrent
case 'tube':
if ($row["tube"])
print("<td class='ttable_col$x' align='center'><a rel=\"prettyPhoto\" href=".$row['tube']." ><".htmlspecialchars($row['tube'])."><img src='" . $site_config['SITEURL'] . "/images/youtube1.png' border='0' width='50' height='50' alt=\"\" /></a></td>");
else
print("<td class='ttable_colx' align='center'>-</td>");
break;
$site_config["torrenttable_columns"] = "category,tube,name,comments,completed,seeders,leechers"; $res = SQL_Query_exec("SELECT id, username FROM users WHERE class = 1 AND uploaded >= $limit AND uploaded / downloaded >= $minratio AND added < $maxdt");
Database Error in backend/cleanup.php on line 89: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '01:54:06' at line 1. Query was: SELECT id, username FROM users WHERE class = 1 AND uploaded >= 26843545600 AND uploaded / downloaded >= 3 AND added < 2020-08-27 01:54:06.[/TD]
"niki, post: 69374, member: 20338":
[URL unfurl="true"]https://www.torrenttrader.xyz/index.php?threads/mod-stop-user-downloading.1651/[/url]
Hello, is it possible to modify the download ban module for the v3 because I tested the download ban of the v8 on the v3 and it doesn't work, thank you in advance.;)