Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   BT.Manager (phpMyBitTorrent) (http://www.bvlist.com/forumdisplay.php?f=23)
-   -   Log full with error messages (http://www.bvlist.com/showthread.php?t=3274)

wMan 24th August 2009 10:29

Log full with error messages
 
Code:

Data base sql error

 Error Executing SQL Query
Error ID: 1064
Error Message: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND active = '1' AND warned = '0'' at line 1

still this one found a fix but fix didn't kinda fix it any way if someone knows hove to fix it let me know

joeroberts 24th August 2009 15:14

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'");
      }
  }
  }
}
}


wMan 24th August 2009 17:15

keeps trashing
my functions.php
[php] /*
*----------------------------phpMyBitTorrent V 2.0-----------------------------*
*--- The Ultimate BitTorrent Tracker and BMS (Bittorrent Management System) ---*
*-------------- Created By Antonio Anzivino (aka DJ Echelon) --------------*
*------------- http://www.p2pmania.it -------------*
*------------ Based on the Bit Torrent Protocol made by Bram Cohen ------------*
*------------- http://www.bittorrent.com -------------*
*------------------------------------------------------------------------------*
*------------------------------------------------------------------------------*
*-- This program is free software; you can redistribute it and/or modify --*
*-- it under the terms of the GNU General Public License as published by --*
*-- the Free Software Foundation; either version 2 of the License, or --*
*-- (at your option) any later version. --*
*-- --*
*-- This program is distributed in the hope that it will be useful, --*
*-- but WITHOUT ANY WARRANTY; without even the implied warranty of --*
*-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --*
*-- GNU General Public License for more details. --*
*-- --*
*-- You should have received a copy of the GNU General Public License --*
*-- along with this program; if not, write to the Free Software --*
*-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --*
*-- --*
*------------------------------------------------------------------------------*
*------

joeroberts 25th August 2009 01:24

try this one sorry got from wrong file
PHP 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[uid]");
       
$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[uid] AND active = '1' AND warned = '0'") 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 = '0'");
       }
   }
   }
}




All times are GMT +2. The time now is 02:42.

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