Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Mods & Themes (http://www.bvlist.com/forumdisplay.php?f=117)
-   -   Auto promote/demote uploader by upload torrent (http://www.bvlist.com/showthread.php?t=9300)

lafouine022 15th July 2013 04:39

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 :friend:

Marco 16th July 2013 09:16

you're good :) thank you very much:drink::friend:

open 19th July 2013 17:11

Auto promote/demote uploader by upload torrent
 
thank you lafouine022

SpEnSeR 29th July 2013 04:14

thanks mate. ill try it out!

Marco 29th July 2013 11:54

i believe it's something same to make users with different rank, like extreme user, elite users etc... :D i will dig it. :drink::friend:
thank you very much

Bump: i couldn't edit my post,
i wish to know if it's possible with power users too ?

Bump: I will just bumping

After 5 torrents the user is uploader , but it take almost a month but it not downgrade back, what's the problem?:muscle:


All times are GMT +2. The time now is 07:36.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.