View Single Post
  #2  
Old 24th August 2009, 15:14
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default
include/functions.php
replace the bonouse function with this
Code:
function bonouse(){
    global $db, $db_prefix;
                        $bon = "SELECT active, seeding, by_torrent FROM ".$db_prefix."_bonus_points ;";
                        $bonset = $db->sql_query($bon);
                        list ($active, $seeding_point, $by_torrent) = $db->sql_fetchrow($bonset);
                        $db->sql_freeresult($bonset);
                        if($by_torrent == 1)$point_per = true;
                        else
                        $point_per = false;
if($active=='true')
{

//=== Update seeding bonus  
    /******************************************************
    Use ONLY one of the two options below... 
    the first is per torrents seeded, the second will only give the bonus for ONE torrent no matter how many are seeded.
    
    also you will have to play with how much bonus you want to give...
    ie: seedbonus+0.0225 = 0.25 bonus points per hour
        seedbonus+0.125 = 0.5 bonus points per hour
        seedbonus+0.225 = 1 bonus point per hour
    *****************************************************/
    //======use this part to give seeding bonus per torrent    
if($point_per)
{
   $res = $db->sql_query("SELECT DISTINCT uid FROM ".$db_prefix."_peers WHERE seeder = 'yes'");
   if ($db->sql_numrows($res) > 0)
   {
       while ($arr = $db->sql_fetchrow($res))
       {
       $work = $db->sql_query("select count(*) from torrent_peers WHERE seeder ='yes' AND uid = $arr[userid]");
       $row_count = mysql_result($work,0,"count(*)");
       $seedbonus = $seeding_point*$row_count;
       $db->sql_query("UPDATE ".$db_prefix."_users SET seedbonus = seedbonus + '".$seedbonus."' WHERE id = $arr[userid] AND active = '1' AND warned = 'no'") or sqlerr(__FILE__, __LINE__);
       }
   }
}else{   //==use this part to only give seeding bonus for 1 torrent no matter how many are being seeded
   $res = $db->sql_query("SELECT DISTINCT uid FROM ".$db_prefix."_peers WHERE seeder = 'yes'");
   if ($db->sql_numrows($res) > 0)
   {
       while ($arr = $db->sql_fetchrow($res))
       {

       //$bonus2 = 0.250;
       //$useridb = $arr['userid'];
       $db->sql_query("UPDATE ".$db_prefix."_users SET seedbonus = seedbonus + '".$seeding_point."' WHERE id = $arr[uid] AND active = '1' AND warned = 'no'");
       }
   }
   }
}
}
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent
Do not ask me to make a mod for any other source
Do not Ask me to setup your site.
I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum
My Current Demo is here http://demo.btmanager.org/
Reply With Quote