Members   Search      Help    Register    Login    Home
Home » Support Forums for PMBT 1.X » Feature Request » User promotion
User promotion [message #3010] Tue, 20 October 2009 20:24 Go to next message
Voreios is currently offline Voreios  Finland
Messages: 75
Registered: October 2009
Seeder
Could we have an option where a user could be promoted to a higher lever if for example his ratio is "this" and his upload size is "that" ?
Re: User promotion [message #3011 is a reply to message #3010] Tue, 20 October 2009 20:35 Go to previous messageGo to next message
joeroberts is currently offline joeroberts  United States
Messages: 1971
Registered: June 2006
Location: U.S.A
Releaser
Da HacKer
open include/cleanup.php
add after
if (!function_exists('get_date_time')) {
function get_date_time($timestamp = 0)
{
  if ($timestamp)
    return date("Y-m-d H:i:s", $timestamp);
  else
    return gmdate("Y-m-d H:i:s");
}
}

function autopromote($upload, $ratio, $level){
	$res = $db->sql_query("SELECT count(id) as count, id FROM ".$db_prefix."_users WHERE  active = 1 AND uploaded >= $uploaded AND uploaded / downloaded >= $ratio AND warned = '0'") ;
        while ($arr = $db->sql_fetchrow($res))
        {
if($arr['count'] =< 0)break;
  $db->sql_query("UPDATE ".$db_prefix."_users SET  can_do ='".$level."' WHERE id='".$arr['id']."'") ; 
}
}

now find
autoclean();

and add after
autopromote("upload", "ratio", "level")

make sure to edit upload ratio and level


http://a.imageshack.us/img831/5562/mybikes.png
Re: User promotion [message #3012 is a reply to message #3011] Tue, 20 October 2009 21:01 Go to previous messageGo to next message
Voreios is currently offline Voreios  Finland
Messages: 75
Registered: October 2009
Seeder
Thanks for the fast reply but do I have to actually edit with numbers ? This one ?

autopromote("upload", "ratio", "level")
Re: User promotion [message #3013 is a reply to message #3012] Tue, 20 October 2009 21:25 Go to previous messageGo to next message
joeroberts is currently offline joeroberts  United States
Messages: 1971
Registered: June 2006
Location: U.S.A
Releaser
Da HacKer
1024*1024*1024*1 = 1gig
$uplo = 1024*1024*1024*1;
$rat = 1.0;
$promote = "VIP";
autopromote($uplo, $rat, $promote)


http://a.imageshack.us/img831/5562/mybikes.png
Re: User promotion [message #3014 is a reply to message #3013] Tue, 20 October 2009 21:47 Go to previous messageGo to next message
Voreios is currently offline Voreios  Finland
Messages: 75
Registered: October 2009
Seeder
I am sorry, I still don't get it. Where these settings must get inserted ? Sad
Re: User promotion [message #3015 is a reply to message #3014] Tue, 20 October 2009 22:21 Go to previous messageGo to next message
joeroberts is currently offline joeroberts  United States
Messages: 1971
Registered: June 2006
Location: U.S.A
Releaser
Da HacKer
it all goes in the same file M8
include/cleanup.php


http://a.imageshack.us/img831/5562/mybikes.png
Re: User promotion [message #3078 is a reply to message #3011] Thu, 29 October 2009 14:50 Go to previous messageGo to next message
Daffy is currently offline Daffy  United Kingdom
Messages: 359
Registered: October 2009
Location: uk
Releaser

im wanting this on my tracker, if a user has uploaded 15gb or more and has ratio 1:1 above to be promoted to power user, if less ratio drops than user. will this work on latest pmbt?

Re: User promotion [message #3213 is a reply to message #3010] Tue, 17 November 2009 15:03 Go to previous messageGo to next message
cop1976 is currently offline cop1976  United Kingdom
Messages: 66
Registered: September 2009
Seeder
I think it does not work on pmbt2.0.4. I tried this code, but my users were not automatically promoted to a higher level. Can anyone see what is wrong in this code?
Re: User promotion [message #3318 is a reply to message #3013] Sun, 06 December 2009 14:01 Go to previous message
Daffy is currently offline Daffy  United Kingdom
Messages: 359
Registered: October 2009
Location: uk
Releaser

cant get it to work either, i need this too. promote and demote :S

Previous Topic:OpenID
Next Topic:muti upload
Goto Forum:
  


Current Time: Wed Feb 08 21:32:28 GMT 2012

Total time taken to generate the page: 0.01121 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software