View Single Post
  #1  
Old 15th July 2013, 04:39
lafouine022 lafouine022 is offline
Senior Member
 
Join Date: Feb 2010
P2P
Posts: 120
Smile Auto promote/demote uploader by upload torrent
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$subject0);
        }

    }
///////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$subject0);
        }

    }    
//////////////////////////////////////////// 
Enjoy baby
Reply With Quote
The Following 7 Users Say Thank You to lafouine022 For This Useful Post:
Botanicar (7th August 2013), DARCK (28th July 2013), eckeO5 (15th July 2013), FENIX (16th July 2013), Marco (16th July 2013), SpEnSeR (29th July 2013), Titya (15th July 2013)