You need the class users = 1
your class upoader = 4
This code Auto promote/demote uploader if uploaded 5torrents by week or no
ADD this code in include/cron/dailly_clenup.php
copy all the code below.
PHP Code:
///////AUTO PROMOTE USER if uploaded 5 torrent by week//////Lafouine022///////////////
//require INC_PATH . '/functions_pm.php'; no need in dailly_cleanup
$Tadded = TIMENOW - 604800; /// 604 800 sec for 1 week
$query = mysql_query ('SELECT t.owner,COUNT(*) AS counta FROM torrents t INNER JOIN users u ON (t.owner=u.id) WHERE u.usergroup = \'1\' and t.banned = \'no\' and t.added > FROM_UNIXTIME(' . $Tadded . ') GROUP BY t.owner') or sqlerr(__FILE__,__LINE__);
while ($UP = mysql_fetch_assoc ($query))
{
if ($UP['counta'] > 4)
{
mysql_query ('UPDATE users SET usergroup = usergroup + 3 WHERE id = ' . sqlesc ($UP['owner']));
$subject = 'Promote';
$msg = 'You upload 5 Torrents in the week you become Uploader';
send_pm ($UP['owner'], $msg, $subject, 0);
}
}
///////demote uploader if no uploaded 5 torrent by Week
$query = mysql_query ('SELECT t.owner,COUNT(*) AS counta FROM torrents t INNER JOIN users u ON (t.owner=u.id) WHERE u.usergroup = \'4\' and t.banned = \'no\' and t.added > FROM_UNIXTIME(' . $Tadded . ') GROUP BY t.owner') or sqlerr(__FILE__,__LINE__);
while ($UP = mysql_fetch_assoc ($query))
{
if ($UP['counta'] < 4)
{
mysql_query ('UPDATE users SET usergroup = usergroup - 3 WHERE id = ' . sqlesc ($UP['owner']));
$subject = 'demote';
$msg = 'You do not have 5 Upload Torrent week in become Users.';
send_pm ($UP['owner'], $msg, $subject, 0);
}
}
////////////////////////////////////////////
Enjoy baby