Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > BT.Manager (phpMyBitTorrent)
Reply
  #1  
Old 30th August 2012, 23:35
Giorgatzelos's Avatar
Giorgatzelos Giorgatzelos is offline
Senior Member
 
Join Date: Nov 2009
Greece
Posts: 300
Default Error just after typing tracker's url and going to login...
1. As you can see in the picture i am having this issue:


Code:
PHP Error Message Fatal error: Call to undefined function multiscrape() in.../public_html/include/cleanup.php on line 463
After a small web search i found other trackers having the same issue! [and not fixed]

i found somewhere in here this:
Quote:
also in cleanup.php at line 463 change
PHP Code:
        if ($autoscrapemultiscrape(); 
to
PHP Code:
        if (isset($autoscrape)) multiscrape(); 
and also optimized the database but it didn't fix it...as far as the border errors and colours you see in that picture i fixed it myself after i uploaded the picture...

This is shown only at login area...
Attached Thumbnails
error.jpg  

Last edited by Giorgatzelos; 31st August 2012 at 02:26.
Reply With Quote
  #2  
Old 31st August 2012, 08:34
x360zone's Avatar
x360zone x360zone is offline
Senior Member
 
Join Date: Jul 2011
United Kingdom
Posts: 915
Default hi
using free hosting dont mean things will run the way you want then just a good tip
__________________

7.5 tsse
future tracker source & hosting, vps
trackers installs + Themes
http://www.foxyhosting.co.uk
http://www.downmy.top testing zone
offshore vps & cpanel hosting & Shoutcast & VPN
STOP cyberbullying
any setups tracker installs vps hosting vps setups themes mods hit me up
over the last three months ive become a snake breeder,pythons,hogs,boa,corn,rat,king,carpet and what joy it is


Reply With Quote
  #3  
Old 31st August 2012, 12:00
Giorgatzelos's Avatar
Giorgatzelos Giorgatzelos is offline
Senior Member
 
Join Date: Nov 2009
Greece
Posts: 300
Default
This error message is due to free hosting? And why it is displayed only at login?
If i delete the line it does not show...but i don't know if that is ok for the tracker...
Is there another way of not showing this annoying message?

Last edited by Giorgatzelos; 31st August 2012 at 12:31.
Reply With Quote
  #4  
Old 31st August 2012, 23:50
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default
do not remove that line!
please show me your cleanup.php
__________________
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
  #5  
Old 1st September 2012, 00:08
Giorgatzelos's Avatar
Giorgatzelos Giorgatzelos is offline
Senior Member
 
Join Date: Nov 2009
Greece
Posts: 300
Default
PHP Code:
<?php
/*
*----------------------------phpMyBitTorrent V 2.0-beta3-----------------------*
*--- 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 --*
*--                                                                          --*
*------------------------------------------------------------------------------*
*------              ©2005 phpMyBitTorrent Development Team              ------*
*-----------               http://phpmybittorrent.com               -----------*
*------------------------------------------------------------------------------*
*-----------------   Sunday, September 14, 2008 9:05 PM   ---------------------*
*/
error_reporting(0);
if (!
defined('IN_PMBT'))die("You can't access this file directly");

if (isset(
$autoscrape)) {
require_once(
"include/bdecoder.php");
require_once(
"include/torrent_functions.php");
}
function 
autoinvites($length$minlimit$maxlimit$minratio$invites)
       {
       global 
$db$db_prefix;
    
$minlimit $minlimit*1024*1024*1024;
    
$maxlimit $maxlimit*1024*1024*1024;
    
$res $db->sql_query("SELECT id, invites FROM ".$db_prefix."_users WHERE  active = 1 AND downloaded >= $minlimit AND downloaded < $maxlimit AND uploaded / downloaded >= $minratio AND warned = '0' AND invites < 10 AND UNIX_TIMESTAMP(invitedate) < UNIX_TIMESTAMP(NOW()) - $length*86400") ;
if (
$db->sql_numrows($res) > 0)
    {
        while (
$arr $db->sql_fetchrow($res))
        {
if (
$arr[invites] == 9)
$invites 1;
elseif (
$arr[invites] == && $invites == 3)
$invites 2;
  
$db->sql_query("UPDATE ".$db_prefix."_users SET invites = invites + ".$invites.", invitedate = NOW() WHERE id='".$arr['id']."'") ; 
 }
}
}
function 
cleanup() {
        global 
$db$db_prefix$admin_email$runhnrsystem$btuser$autoscrape,$most_users_online $dead_torrent_interval$announce_interval$down_limit$autodel_users$sitename$autodel_users_time$inactwarning_time$siteurl$forumbase,$forumshare,$phpEx$config,$phpbb_root_path,$forumpx$autoclean_interval;
        
//most users online
        
$sql "SELECT COUNT(id)as num_users  FROM ".$db_prefix."_online_users";
        
$sql_count $db->sql_query($sql);
        
$numbero = (int) $db->sql_fetchfield('num_users');
        
$db->sql_freeresult($sql_count);
        if(
$most_users_online $numbero)
        {
        
$db->sql_query("UPDATE ".$db_prefix."_config SET `most_on_line` = '".$numbero."', `when_most` = NOW()");
        }
//clean up donations
    
$sql "SELECT COUNT(DISTINCT username) as name 
    FROM "
.$db_prefix."_users 
    WHERE donator = 'true'"
;
    
$res $db->sql_query($sql);        
    
$doners = (int) $db->sql_fetchfield('name');
    
$db->sql_freeresult($res);
   if (
$doners 0) {
    
$sql2 "SELECT  id, dondate, donator_tell 
    FROM "
.$db_prefix."_users 
    WHERE donator = 'true'
    AND UNIX_TIMESTAMP(donator_tell) < UNIX_TIMESTAMP(NOW())-0"
;
    
$res2 $db->sql_query($sql2);        
    while (
$arr $db->sql_fetchrow($res2)) {
    
$donatedate $arr['dondate'];
    
$doner_tell $arr['donator_tell'];
    
$uid $arr['id'];
       if(
get_date_time(gmtime()) >= $doner_tell){
       
$db->sql_query("UPDATE ".$db_prefix."_users SET `dondate`= '0000-00-00 00:00:00', `donator_tell`='0000-00-00 00:00:00', `donator`= 'false', `dongift`=0 WHERE `id` = ".$uid.";");
       }
    }
  }
  unset(
$sql,$res,$arr,$uid,$donatedate,$doner_tell);
$hnr_sql "SELECT `hnr_system`, `seedtime`, `time_before_warn`, `maxhitrun`, `warnlength` FROM `".$db_prefix."_hit_n_run` ";
        
$hnr_sql1=$db->sql_query($hnr_sql);
        
$rowhnr $db->sql_fetchrow($hnr_sql1);
        
$db->sql_freeresult($hnr_sql);
        
$hnr_system $rowhnr['hnr_system'];
        
$warnlength $rowhnr['warnlength'];
        
$maxhitrun $rowhnr['maxhitrun'];
        
$seedtime $rowhnr['seedtime']*60;
        
$time_before_warn = ($rowhnr['time_before_warn']*60);
        
$warnlength = ($rowhnr['warnlength']*60*60*24);
        
$timedelay time()-($announce_interval+$time_before_warn);
if(
$hnr_system == 'true')
{
// Message users who have hit and run
$dohr false;
  
$sqlc "SELECT COUNT(s.id)as hrcount  FROM ".$db_prefix."_snatched AS s INNER JOIN ".$db_prefix."_torrents AS t ON s.torrentid = t.id WHERE s.userid <> t.owner AND `completedat` > '0000-00-00 00:00:00' AND `completedat` > '2009-03-27 17:53:50' AND `seeding_time` > '0' AND `seeding_time` < '".$seedtime."' AND s.`downloaded` > s.`uploaded` AND `seeder` = 'no'  AND s.last_action < '".get_date_time(gmtime() - ($announce_interval+$time_before_warn))."' AND hitrunwarn = 'no'";
  
$resc $db->sql_query($sqlc)or btsqlerror($sqlc);
    while (
$arrc $db->sql_fetchrow($resc)) {
    
$dohr true;
}  
  
$sql "SELECT s.id, userid, torrentid, t.name FROM ".$db_prefix."_snatched AS s INNER JOIN ".$db_prefix."_torrents AS t ON s.torrentid = t.id WHERE s.userid <> t.owner AND `completedat` > '0000-00-00 00:00:00' AND `completedat` > '2009-03-27 17:53:50' AND `seeding_time` > '0' AND `seeding_time` < '".$seedtime."' AND s.`downloaded` > s.`uploaded` AND `seeder` = 'no'  AND s.last_action < '".get_date_time(gmtime() - ($announce_interval+$time_before_warn))."' AND hitrunwarn = 'no'";
  
$res $db->sql_query($sql)or btsqlerror($sql);
//  echo $sql;
  
if ($dohr) {
  
//die("warn");
    
$ids $userids = array();
    while (
$arr $db->sql_fetchrow($res)) {
    if(
hitrun($arr['userid'])){
      
$ids[] = $arr["id"];
      
$userids[] = $arr["userid"];
      
$hitrun[$arr["userid"]]++;
      
$torrents[$arr["userid"]] .= "\n[b][url=".$siteurl."/details.php?id=$arr[torrentid]]".addslashes($arr['name'])."[/url][/b]";
    }
    }
    
$userids array_unique($userids);
    foreach(
$userids as $userid) {
    
$hnrtorrents $torrents[$userid];
    
$hnrtot $hitrun[$userid];
    
$hnrcount = ($hitrun[$userid] == "" "s");
    
$these = ($hitrun[$userid] == "this" "these");
    
$is = ($hitrun[$userid] == "is" "are");
          
$msg str_replace(array("{hnrtot}","{hnrcount}","{these}","{is}","{hnrtorrents}"),array($hnrtot,$hnrcount,$these,$hnrtorrents),_BT_HNR_NOTICE_PM); 
      
$db->sql_query("INSERT INTO ".$db_prefix."_private_messages (sent, sender, recipient, subject, text) VALUES (NOW(), 0, $userid, 'Hit and Run', '$msg')") ;
    }
    if(
sizeof($ids) != 0)$db->sql_query("UPDATE ".$db_prefix."_snatched SET hitrunwarn = 'pending', last_action='".get_date_time()."' WHERE id IN (".implode(", "$ids).")") or sqlerr();
  }
  
// Process hit and runs of users that have not returned
  
$sql "SELECT id, userid FROM ".$db_prefix."_snatched WHERE hitrunwarn = 'pending' AND last_action < '".get_date_time(gmtime() - ($announce_interval+$time_before_warn))."'";
  
$res $db->sql_query($sql);
  if (
$db->sql_numrows($res) > 0) {
    
$ids $userids = array();
    while (
$arr $db->sql_fetchrow($res)) {
      
$ids[] = $arr["id"];
      
$userids[] = $arr["userid"];
      
$hitrun[$arr["userid"]]++;
    }
    
$userids array_unique($userids);
    foreach(
$userids as $userid)
      
$db->sql_query("UPDATE ".$db_prefix."_users SET hitruns = hitruns + $hitrun[$userid], hitrun = '".get_date_time()."' WHERE id = $userid");
    
$db->sql_query("UPDATE ".$db_prefix."_snatched SET hitrunwarn = 'yes', hitrun = '".get_date_time()."' WHERE id IN (".implode(", "$ids).")");
  }
// Warn repeating hit and runners
 // $maxhitrun = 0;
  
$sql "SELECT id FROM ".$db_prefix."_users WHERE hitruns > $maxhitrun AND hitrun < '".get_date_time(gmtime() - ($announce_interval+$time_before_warn))."' AND warned = '0'";
  
$res $db->sql_query($sql);
  if (
$db->sql_numrows($res) > 0) {
    
$userids = array();
    
$modcomment addslashes(_btmod_HNR_mesage_a);
    
$msg _bt_HNR_WARN_PM;
    while (
$arr $db->sql_fetchrow($res)) {
      
$userids[] = $arr["id"];
      
$db->sql_query("INSERT INTO ".$db_prefix."_private_messages (sent, sender, recipient, subject, text) VALUES (NOW(), 0, $arr[id], 'Hit and Run', '$msg')");
    }
    
//$warnlength = 604800;
    
$db->sql_query("UPDATE ".$db_prefix."_users SET warned = '1', warn_kapta='" strtotime(gmdate("Y-m-d H:i:s"time())) . "', warn_hossz = warn_hossz + '".$warnlength."', modcomment = CONCAT('$modcomment', modcomment), hitruns = 0, HNR_W = HNR_W + '1' WHERE id IN (".implode(", "$userids).")");
  }  
  unset(
$ids,$userids,$msg);
  
$sql "SELECT id, userid FROM ".$db_prefix."_snatched WHERE seeder = 'yes' AND     hitrunwarn = 'yes'";
  
$res $db->sql_query($sql);
  if (
$db->sql_numrows($res) > 0) {
    
$ids $userids = array();
    
$msg addslashes(_bt_hnrremoved);
    
$modcomment _btmod_HNR_mesage_b;
    while (
$arr $db->sql_fetchrow($res)) {
      
$ids[] = $arr["id"];
      
$userids[] = $arr["userid"];
     
// $userids[] = $arr["id"];
      
$db->sql_query("INSERT INTO ".$db_prefix."_private_messages (sent, sender, recipient, subject, text) VALUES (NOW(), 0, ".$arr["userid"].", 'Hit and Run', '$msg')");
}
    
//$warnlength = 604800;
    
$db->sql_query("UPDATE ".$db_prefix."_users SET warned = '0', warn_kapta='" strtotime(gmdate("Y-m-d H:i:s"time())) . "', warn_hossz = warn_hossz - '".$warnlength."', modcomment = CONCAT('$modcomment', modcomment), hitruns = 0, HNR_W = HNR_W - '1' WHERE id IN (".implode(", "$userids).")");
    
$db->sql_query("UPDATE ".$db_prefix."_snatched SET hitrun ='0000-00-00 00:00:00', hitrunwarn = 'no' WHERE id IN (".implode(", "$ids).")");
}
}

    
$db->sql_query("DELETE FROM ".$db_prefix."_users WHERE active = 0 AND UNIX_TIMESTAMP(regdate) < UNIX_TIMESTAMP(NOW()) - 86400;");
    
# Delete PMs that have been removed by both Sender and Recipient
    
$db->sql_query(    "DELETE FROM ".$db_prefix."_private_messages WHERE sender = '0' AND recipient_del = 'true';");
    
$db->sql_query(    "DELETE FROM ".$db_prefix."_private_messages WHERE sender_del = 'true' AND recipient_del = 'true';");
    
$db->sql_query(    "DELETE FROM ".$db_prefix."_private_messages WHERE recipient = '0';");
    
$db->sql_query(    "DELETE FROM ".$db_prefix."_private_messages WHERE save = 'false' AND UNIX_TIMESTAMP(sent) < UNIX_TIMESTAMP(NOW()) - 2592000;");
    
#clean snatch list
   // $db->sql_query("UPDATE ".$db_prefix."_snatched SET seeder = 'no' WHERE seeder = 'yes' AND UNIX_TIMESTAMP(last_action) < UNIX_TIMESTAMP(NOW()) - ".intval($announce_interval).";";


        #Reset Statistics. Run where there is a dead peer
        
$sql "DELETE FROM ".$db_prefix."_peers WHERE UNIX_TIMESTAMP(last_action) < UNIX_TIMESTAMP(NOW()) - ".($announce_interval+60).";"//One minute of tolerance
        
$res $db->sql_query($sql);
        if (
$db->sql_affectedrows($res) > 0) {
                
$db->sql_query("UPDATE ".$db_prefix."_torrents SET seeders = 0, leechers = 0, tot_peer = 0, speed = 0 WHERE tracker IS NULL OR backup_tracker = 'true';");

                
$sql "SELECT COUNT(*) AS tot, torrent, seeder, SUM(upload_speed) AS speed FROM ".$db_prefix."_peers GROUP BY torrent, seeder;";
                
$res $db->sql_query($sql);
                while(
$row $db->sql_fetchrow($res)) {
                        if (
$row["seeder"] == "yes"$sql "UPDATE ".$db_prefix."_torrents SET seeders = '".$row["tot"]."', speed = speed + '".$row["speed"]."' WHERE id='".$row["torrent"]."';";
                        else 
$sql "UPDATE ".$db_prefix."_torrents SET leechers = '".$row["tot"]."', speed = speed + '".$row["speed"]."' WHERE id='".$row["torrent"]."';";
                        
$db->sql_query($sql);
                }

                
$db->sql_query("UPDATE ".$db_prefix."_torrents SET tot_peer = seeders + leechers;");
        }
        
$db->sql_query("UPDATE ".$db_prefix."_torrents SET evidence = 0 WHERE evidence = 1 AND UNIX_TIMESTAMP(added) < UNIX_TIMESTAMP(NOW()) - 14*84600;");
        
$db->sql_query("UPDATE ".$db_prefix."_torrents SET visible = 'no' WHERE type != 'link' AND tot_peer <= '".$down_limit."' AND UNIX_TIMESTAMP(last_action) < UNIX_TIMESTAMP(NOW()) - ".intval($dead_torrent_interval)." AND evidence != 1 AND (TRACKER IS NULL OR ".intval($autoscrape).");");
        
$db->sql_query("UPDATE ".$db_prefix."_torrents SET visible = 'yes' WHERE tot_peer > '".$down_limit."';");

#prune users
if ($autodel_users)    
{
$userwarninactivesub = Array();
$userwarninactivesub['english'] = "".$sitename." Warning";
$userwarninactivesub['german'] = "".$sitename." Achtung";
$userwarninactivesub['spanish'] = "Advertencia ".$sitename."";
$userwarninactivesub['brazilian'] = "".$sitename." adverte";
$userwarninactivesub['portuguese'] = "".$sitename." adverte";

$userwarninactivetext = Array();

$warntexten1 "Hi,
we would like to warn you that you have not been active on **siteurl** for more than **inactwarning_time** days,
if you do not want to have your account deleted please login to it.
"
;
if (
$autodel_users_time != 0)
{
$warntexten2 "You have **autodel_users_time** days to log in from now. 
Otherwise we will delete your account permanently."
;
}
else 
$warntexten2 "";
$warntexten3 "
Thanks **sitename** Admin
**siteurl**"
;
$userwarninactivetext['english'] = "".$warntexten1.$warntexten2.$warntexten3."";


$warntextger1 "Wir möchten darauf hinweisen , dass du auf **siteurl** seit mehr als **inactwarning_time** Tagen nicht mehr aktiv warst, 
wenn Du nicht willst, dass dein Account gelöscht wird, logge dich bitte ein. 
"
;
if (
$autodel_users_time != 0)
{
$warntextger2 "Du hast ab jetzt **autodel_users_time** Tage Zeit um dich auf **sitename** einzuloggen.
Ansonsten werden wir deinen Account permanent löschen."
;
}
else 
$warntextger2 "";
$warntextger3 "
Danke**sitename**Admin.
**siteurl**"
;

$userwarninactivetext['german'] = "".$warntextger1.$warntextger2.$warntextger3."";

$warntextspa1 "Hola, 
Queriamos decirte que no visitaste nuestra pagina **siteurl** por mas de **inactwarning_time** dias.
Si no quieres que tu Cuenta sea borrada, por favor logueate. 
"
;
if (
$autodel_users_time != 0)
{
$warntextspa2 "Tienes **autodel_users_time** dias para loguearte nuevamente apartir de hoy.
De otra manera borraremos tu cuenta de forma permanente."
;
}
else 
$warntextspa2 "";
$warntextspa3 "
Gracias. Los **sitename** administradores
**siteurl**"
;

$userwarninactivetext['spanish'] = "".$warntextspa1.$warntextspa2.$warntextspa3."";

$warntextbra1 "Oi,
Nós gostaríamos de avisa-lo que voce nao tem estado ativo no **siteurl** por mais de **inactwarning_time** dias.
Se voce nao quer ter sua conta excluída, por favor conecte-se. 
"
;
if (
$autodel_users_time != 0)
{
$warntextbra2 "Voce tem **autodel_users_time** dias a partir de hoje para fazer isso.
Caso contrário nós iremos apagar sua conta permanentemente."
;
}
else 
$warntextbra2 "";
$warntextbra3 "
Obrigado **sitename** Administrador
**siteurl**"
;
$userwarninactivetext['brazilian'] = "".$warntextbra1.$warntextbra2.$warntextbra3."";

$warntextpor1 "Oi,
Nós gostaríamos de avisa-lo que voce nao tem estado ativo no **siteurl** por mais de **inactwarning_time** dias.
Se voce nao quer ter sua conta excluída, por favor conecte-se. 
"
;
if (
$autodel_users_time != 0)
{
$warntextpor2 "Voce tem **autodel_users_time** dias a partir de hoje para fazer isso.
Caso contrário nós iremos apagar sua conta permanentemente."
;
}
else 
$warntextpor2 "";
$warntextpor3 "
Obrigado **sitename** Administrador
**siteurl**"
;

$userwarninactivetext['portuguese'] = "".$warntextpor1.$warntextpor2.$warntextpor3."";

$sql "SELECT id, email, inactwarning, lastlogin, language, ban FROM ".$db_prefix."_users WHERE ban != 1 AND inactwarning != 1 AND lastlogin != '0000-00-00 00:00:00' AND (UNIX_TIMESTAMP(lastlogin) < UNIX_TIMESTAMP(NOW()) - ".$inactwarning_time.") ;";
$res $db->sql_query($sql);
while (
$get_info $db->sql_fetchrow($res))
{
echo 
$get_info['id']."<br>";
//logerror($get_info['id'].$get_info['email'].$get_info['inactwarning'].$get_info['lastlogin'], "prune time");
$replace_markers = Array("**sitename**","**siteurl**","**inactwarning_time**","**autodel_users_time**");
$replace_data = Array ("".$sitename."","".$siteurl."","".($inactwarning_time/86400)."","".($autodel_users_time/86400)."");
if (
$get_info['language'] == ""$get_info['language'] = "english";
$warn_mail = new eMail;
$warn_mail->sender $admin_email;
$warn_mail->subject $userwarninactivesub[$get_info['language']];
$warn_mail->body str_replace($replace_markers,$replace_data,$userwarninactivetext[$get_info['language']]);
$warn_mail->Add($get_info['email']);
$warn_mail->Send();
$up_warn "UPDATE ".$db_prefix."_users SET inactwarning = 1, inactive_warn_time = NOW() WHERE  id = ".$get_info['id'].";";
$db->sql_query($up_warn);
}
}
$db->sql_query("UPDATE ".$db_prefix."_users SET inactwarning = 0, inactive_warn_time = '0000-00-00 00:00:00' WHERE inactwarning = 1 AND UNIX_TIMESTAMP(lastlogin) > UNIX_TIMESTAMP(NOW()) - (".$inactwarning_time.");");
        
#Clean Shoutbox after 8 hours
       // $db->sql_query("DELETE FROM ".$db_prefix."_shouts WHERE UNIX_TIMESTAMP(posted) < UNIX_TIMESTAMP(NOW()) - (8 * 60 * 60);");

        #Clean online user list after 10 minutes of inactivity
        
$db->sql_query("DELETE FROM ".$db_prefix."_online_users WHERE UNIX_TIMESTAMP(last_action) < UNIX_TIMESTAMP(NOW()) - 1600;");

$res $db->sql_query("SELECT * FROM ".$db_prefix."_lottery_config") ;
while (
$arr $db->sql_fetchrow($res))
$arr_config[$arr['name']] = $arr['value'];

if (
$arr_config['enable'] == 1)
{
if (
gmdate("Y-m-d H:i:s"time()) > $arr_config['end_date'])
{
if (
$arr_config["ticket_amount_type"] == GB)
$arr_config['ticket_amount'] = 1024 1024 1024 $arr_config['ticket_amount'];
else if (
$arr_config["ticket_amount_type"] == MB)
$arr_config['ticket_amount'] = 1024 1024 $arr_config['ticket_amount'];
$size $arr_config['ticket_amount'];

if (
$arr_config["ticket_amount_type"] == GB)
$arr_config['prize_fund'] = 1024 1024 1024 $arr_config['prize_fund'];
else if (
$arr_config["ticket_amount_type"] == MB)
$arr_config['prize_fund'] = 1024 1024 $arr_config['prize_fund'];
$prize_fund $arr_config['prize_fund'];

$total $db->sql_numrows($db->sql_query("SELECT * FROM ".$db_prefix."_tickets"));
if (
$arr_config["use_prize_fund"])
{
$pot $prize_fund $arr_config['total_winners'];
$res $db->sql_query("SELECT user FROM ".$db_prefix."_tickets ORDER BY RAND() LIMIT $arr_config[total_winners]") ;
$who_won = array();
$msg "Congratulations, You have won: <b>".mksize($pot)."</b>.<br /><br />This has been added to your upload amount<br /><br />Thanks for playing Lottery.";
while (
$arr $db->sql_fetchrow($res))
{
$res2 $db->sql_query("SELECT modcomment FROM ".$db_prefix."_users WHERE id = $arr[user]") ;
$arr2 $db->sql_fetchrow($res2);
$modcomment $arr2['modcomment'];
$modcom "User won the lottery: " mksize($pot) . " at " gmdate("Y-m-d H:i:s"time()) . "\n" $modcomment;
$db->sql_query("UPDATE ".$db_prefix."_users SET uploaded = uploaded + $pot, modcomment = '".$modcom."' WHERE id = $arr[user]") ;
$db->sql_query("INSERT INTO ".$db_prefix."_private_messages (sender, recipient, subject, text, sent) VALUES('1', '".$arr['user']."', 'LOTTERY', '".$msg."', NOW())") ;
$who_won[] = $arr['user'];
}
}
else
{
$pot $total $size $arr_config['total_winners'];
$res $db->sql_query("SELECT user FROM ".$db_prefix."_tickets ORDER BY RAND() LIMIT $arr_config[total_winners]") ;
$who_won = array();
$msg "Congratulations, You have won: <b>".mksize($pot)."</b>.<br /><br />This has been added to your upload amount<br /><br />Thanks for playing Lottery.";
while (
$arr $db->sql_fetchrow($res))
{
$res2 $db->sql_query("SELECT modcomment FROM ".$db_prefix."_users WHERE id = $arr[user]") ;
$arr2 $db->sql_fetchrow($res2);
$modcomment $arr2['modcomment'];
$modcom "User won the lottery: " mksize($pot) . " at " gmdate("Y-m-d H:i:s"time()) . "\n" $modcomment;
$db->sql_query("UPDATE ".$db_prefix."_users SET uploaded = uploaded + $pot, modcomment = '".$modcom."' WHERE id = $arr[user]") ;
$db->sql_query("INSERT INTO ".$db_prefix."_private_messages (sender, recipient, subject, text, sent) VALUES('1', '".$arr['user']."', 'LOTTERY', '".$msg."', NOW())") ;
$who_won[] = $arr['user'];
}
}
$who_won implode("|"$who_won);
$who_won_date gmdate("Y-m-d H:i:s"time());
$who_won_prize $pot;
$db->sql_query("TRUNCATE TABLE ".$db_prefix."_tickets") ;
if (
$who_won != '')
{
$db->sql_query("UPDATE ".$db_prefix."_lottery_config SET value = '$who_won' WHERE name = 'lottery_winners'") ;
$db->sql_query("UPDATE ".$db_prefix."_lottery_config SET value = '$who_won_prize' WHERE name = 'lottery_winners_amount'") ;
$db->sql_query("UPDATE ".$db_prefix."_lottery_config SET value = '$who_won_date' WHERE name = 'lottery_winners_time'") ;
}
$db->sql_query("UPDATE ".$db_prefix."_lottery_config SET value = '0' WHERE name = 'enable'") ;
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                    TRYS CASINO                                                                   //
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
   
$hours 1// Hours to wait after using all tries, until they will be restarted
   
$sql $db->sql_query("SELECT userid, trys, date, enableplay FROM ".$db_prefix."_casino WHERE UNIX_TIMESTAMP(date) < UNIX_TIMESTAMP(NOW()) - 300 AND trys >= '0' AND enableplay = 'yes'");
   while (
$arr $db->sql_fetchrow($res))
   {
       
$db->sql_query("UPDATE ".$db_prefix."_casino SET trys='0' WHERE userid='".$arr['userid']."'");
   }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                    TRYS CASINO                                                                //
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                        EFFACEMENT DES VIEILLES REQUETES                                                        //
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    
$hours 720// Hours to keep no filled requests 720=30days, 30*24=720
    
$res $db->sql_query("SELECT id, userid, request, descr, added, hits, cat, filled, filledby FROM ".$db_prefix."_requests WHERE UNIX_TIMESTAMP(added) < UNIX_TIMESTAMP(NOW()) - $hours*3600") ;
    while (
$arr $db->sql_fetchrow($res))
    {
$db->sql_query("DELETE FROM ".$db_prefix."_requests WHERE id=$arr[id]") ;
$db->sql_query("DELETE FROM ".$db_prefix."_addedrequests WHERE id=$arr[id]") ;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                      FIN EFFACEMENT DES VIEILLES REQUETES                                                      //
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                      EFFACEMENT DES PROPOSITIONS UPLOAD                                                        //
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    
$hours 360// Hours to keep offers 360=15days, 15*24=360
    
$jours = ($hours/24);
    
$res $db->sql_query("SELECT id, name, userid FROM ".$db_prefix."_offers WHERE UNIX_TIMESTAMP(added) < UNIX_TIMESTAMP(NOW()) - $hours*3600");
    while (
$arr $db->sql_fetchrow($res))
    {
     
$db->sql_query("DELETE FROM ".$db_prefix."_offers WHERE id=$arr[id]") ;
     
$db->sql_query("DELETE FROM ".$db_prefix."_offervotes WHERE offerid=$arr[id]") ;
     
$db->sql_query("UPDATE ".$db_prefix."_users SET seedbonus = seedbonus - '10.0' WHERE id = $arr[userid]") ;
      }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                     FIN EFFACEMENT DES PROPOSITIONS UPLOAD                                                     //
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//die();

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                            FLASHSCORES                                                           //
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    
$hours 720// Hours to keep MPS 720=30 days, 720/24=30
    
$res =$db->sql_query("SELECT ID, game, user, level, score, date FROM ".$db_prefix."_flashscores WHERE UNIX_TIMESTAMP(date) < UNIX_TIMESTAMP(NOW()) - $hours*3600");
    while (
$arr $db->sql_fetchrow($res))
    {
        
$db->sql_query("DELETE FROM ".$db_prefix."_flashscores WHERE date < '".get_date_time(gmtime() - $hours)."'");
    }
    
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                          FLASHSCORES                                                         //
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//SET INVITE AMOUNTS ACCORDING TO RATIO/GIGS ETC
autoinvites(10,1,4,.90,1);
autoinvites(10,4,7,.95,2);
autoinvites(10,7,10,1.00,3);
autoinvites(10,10,100000,1.05,4);
//END INVITES
if (isset($autoscrape)) multiscrape();        
autoclean();
if (
$autodel_users)
{
    
$sql "SELECT id FROM ".$db_prefix."_users WHERE inactwarning = 1 AND UNIX_TIMESTAMP(inactive_warn_time) < UNIX_TIMESTAMP(NOW()) - ".intval($autodel_users_time).";";
    
$res $db->sql_query($sql);
    while (
$row $db->sql_fetchrow($res))
    {
     
removedinactive($row['id']);
    }
$db->sql_freeresult($res);
}
}
//cleanup();
register_shutdown_function("cleanup");
?>
This is my cleanup.php after i tried to correct the error and did this:

Code:
if ($autoscrape) multiscrape();
to
Code:
if (isset($autoscrape)) multiscrape();
Reply With Quote
  #6  
Old 1st September 2012, 15:05
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default
is your login user.php or login.php?
__________________
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
The Following User Says Thank You to joeroberts For This Useful Post:
Giorgatzelos (3rd September 2012)
  #7  
Old 1st September 2012, 16:20
Giorgatzelos's Avatar
Giorgatzelos Giorgatzelos is offline
Senior Member
 
Join Date: Nov 2009
Greece
Posts: 300
Default
It is user.php...
Reply With Quote
  #8  
Old 2nd September 2012, 15:59
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default
Please show me your user.php
__________________
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
  #9  
Old 2nd September 2012, 16:07
Giorgatzelos's Avatar
Giorgatzelos Giorgatzelos is offline
Senior Member
 
Join Date: Nov 2009
Greece
Posts: 300
Default
this is my user.php ...
PHP Code:
<?php
/*
*----------------------------phpMyBitTorrent V 2.0.4---------------------------*
*--- 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 --*
*--                                                                          --*
*------------------------------------------------------------------------------*
*------              Â©2005 phpMyBitTorrent Development Team              ------*
*-----------               http://phpmybittorrent.com               -----------*
*------------------------------------------------------------------------------*
*-----------------   Sunday, September 14, 2008 9:05 PM   ---------------------*
*/
if (defined('IN_PMBT'))die ("You can't include this file");
define("IN_PMBT",true);
include(
"header.php");
include_once(
"include/config.php");
include_once(
"language/mailtexts.php");


if (!empty(
$_GET["returnto"])) {
    
$returnto $_GET["returnto"];
    
$returnto str_replace('mode=login','',$returnto);

}
switch (
$op) {
        case 
"loginform": {
                
//include("header.php");
                
OpenTable(_btlogin);
                echo 
"<form method=\"POST\" action=\"user.php\"><input type=\"hidden\" name=\"op\" value=\""._btlogin."\">\n";
                echo 
"<p align=\"center\">"._btusername."<br><input type=\"text\" name=\"username\" size=\"17\">\n<br>"._btpassword."<br><input type=\"password\" name=\"password\" size=\"17\"></p>\n";
                if (
$gfx_check) {
                        
$rnd_code strtoupper(RandomAlpha(5));
                        echo 
"<img src=\"gfxgen.php?code=".base64_encode($rnd_code)."\"><br><input type=\"text\" name=\"gfxcode\" size=\"10\" maxlength=\"6\">";
                        echo 
"<input type=\"hidden\" name=\"gfxcheck\" value=\"".md5($rnd_code)."\">\n\n\n\n";
                }
                echo 
"<p><input type=\"submit\" value=\""._btlogin."\"></p></form>";
            echo 
"<p><a href=\"user.php?op=register\">"._btsignup."</a><br />\n\n";
                
CloseTable();
                break;
        }
        case 
"login": {
                if (!isset(
$username) OR $username == "" OR !isset($password) OR $password == "") {
                        
bterror(_btusrpwdnotset,_btlogin); //missing data
                
} elseif ($gfx_check AND (!isset($gfxcode) OR $gfxcode == "" OR $gfxcheck != md5(strtoupper($gfxcode)))) {
                        
bterror(_bterrcode,_btlogin);
                } else {
                        
$result $db->sql_query("SELECT active FROM ".$db_prefix."_users WHERE username = '".addslashes($username)."' AND password = '".md5($password)."'");
                        if (
$db->sql_numrows($result) == 1) {
                                list (
$active) = $db->sql_fetchrow($result);
                                if (
$active == 1) {
                                
$ip getip();
        
$sql "UPDATE ".$db_prefix."_users SET lastip = '".sprintf("%u",ip2long($ip))."', lasthost = '".gethostbyaddr($ip)."', lastlogin = NOW() WHERE username = '".addslashes($username)."';";
        
$db->sql_query($sql);

                                if (isset(
$remember) AND $remember == "yes"){
                                 
$db->sql_query("UPDATE ".$db_prefix."_users SET rem = 'yes' WHERE username = '".addslashes($username)."';")or die("thats not fare");
                                
$autologin =true;
                                 }
                                        
ob_end_clean();
                                        unset(
$btuser);
                                        
userlogin($username$btuser);
                                         if(
$forumshare){
                                             
$result2 $db->sql_query("SELECT level  FROM ".$db_prefix."_users WHERE clean_username = '".addslashes($clean_username)."'");
                                             list (
$level) = $db->sql_fetchrow($result2);
                                                    if(
$level === 'admin')$admin 1;
                                                    else
                                                    
$admin 0;
                                             
define'IN_PHPBB'true );
                                             
$phpbb_root_path './'.$forumbase '/'
                                                
$phpEx substr(strrchr(__FILE__'.'), 1);
                                                include(
$forumbase '/common.' $phpEx);
                                               include(
$forumbase '/includes/functions_display.' $phpEx);
                                             include(
$forumbase '/includes/bbcode.' $phpEx);
    
                                                
$user->session_begin();
                                                
$auth->acl$user->data );
                                                
$user->setup();
                                                
$user->session_create(get_user_forum_name($_POST['username']), $admin$autologin1);
                                                
                                        }
                                        if(!
$returnto)header("Location: ".$siteurl."/user.php?op=loginconfirm");
                                        else
                                        
header("Location: ".$siteurl."/user.php?op=loginconfirm&returnto=".$returnto);
                                        
#header('location: ' . $returnto);
                                        
die();
                                }
                                else {
                                        
bterror(_btuserinactive,_btlogin); //user not active
                                
}
                        } else {
                        
logerror('User login failed for '.$username'Failed Login');
                                
bterror(_btuserpasswrong,_btlogin); //bad data
                        
}
                }
                break;
        }
        case 
"loginconfirm": {

        if (!empty(
$returnto)) {
        
$returnto str_replace('@','&'$returnto);
                echo 
"<meta http-equiv=\"refresh\" content=\"3;url=" $returnto."\">";
        }
        else {
                
                echo 
"<meta http-equiv=\"refresh\" content=\"3;url=index.php\">";
                }
                
$sql "SELECT level FROM ".$db_prefix."_users WHERE id = '".$user->id."';";
                
$res $db->sql_query($sql);
                list (
$level) = $db->sql_fetchrow($res);
                
$db->sql_freeresult($res);
                
OpenTable(_btlogin);
                echo 
"<p>".str_replace("**priv**",@constant("_btclass".$level),_btloginsuccessful)."</p>";
                
CloseTable();
                break;
        }
        case 
"logout": {
                
setcookie("btuser","",time()-3600,$cookiepath,$cookiedomain,0);
                
setcookie("btlanguage","",time()-3600,$cookiepath,$cookiedomain,0);
                
setcookie("bttheme","",time()-3600,$cookiepath,$cookiedomain,0);
                
$db->sql_query("UPDATE ".$db_prefix."_users SET act_key ='".RandomAlpha(32)."' WHERE id = '".$user->id."';");
                
$db->sql_query("DELETE FROM ".$db_prefix."_online_users WHERE id = '".$user->id."';"); 
                if(
$forumshare)forumlogout($user->id); 
                
$btuser "";
                
ob_end_clean();
                
header("Location: ".$siteurl."/user.php?op=logoutconfirm");
                die();
        }
        case 
"logoutconfirm": {
                echo 
"<meta http-equiv=\"refresh\" content=\"3;url=index.php\">";
                
OpenTable(_btlogin);
                echo 
"<p>"._btlogoutsuccessful."</p>";
                
CloseTable();
                break;

        }
        case 
"takeregister": {
                if (
$user->user) die();
                include(
"user/takeregister.php");
                break;
        }
        case 
"banchat": {
        if(!
checkaccess("bann_shouts")){
OpenErrTable(_btaccdenied);
echo 
"<p>"._btuserban_shout."</p>";
CloseErrTable();
break;
}
                
OpenTable(_btuserban_shoutban);
                echo 
"<p>"._btuserban_shoutbanned."</p>";
                
CloseTable();
                
$sql "UPDATE ".$db_prefix."_users SET can_shout = 'false' WHERE id = '".$id."';";
                if (!
$db->sql_query($sql)) btsqlerror($sql);
                break;
        }
        case 
"demote_user_HNR": {
        if(!
checkaccess("hnr_demote")){
OpenErrTable(_btaccdenied);
echo 
"<p>"._btuserban_shout."</p>";
CloseErrTable();
break;
}
logerror("<a href=\"".$siteurl."/user.php?op=profile&id=".$id."\">$n</a> Was demoted by ".$user->name"HNR Demotion");
                
OpenTable(_btuserban_shoutban);
                echo 
"<p>"._btuserban_hnr."</p>";
                
CloseTable();
                
$sql "UPDATE ".$db_prefix."_users SET can_do = 'SHIT HEAD' WHERE id = '".$id."';";
                if (!
$db->sql_query($sql)) btsqlerror($sql);
break;
        }
        case 
"unbanchat": {
        if(!
checkaccess("bann_shouts")){
OpenErrTable(_btaccdenied);
echo 
"<p>"._btuserban_shout."</p>";
CloseErrTable();
break;
}
                
OpenTable(_btuserban_shoutban);
                echo 
"<p>"._btuserban_shoutunban."</p>";
                
CloseTable();
                
$sql "UPDATE ".$db_prefix."_users SET can_shout = 'true' WHERE id = '".$id."';";
                if (!
$db->sql_query($sql)) btsqlerror($sql);
                break;
        }
        case 
"confirm": {
                if (
$user->user) die();
                
$errmsg = Array();
                if (!isset(
$username) OR $username == "")
                        
$errmsg[] = _bterrusernamenotset;
                if (!isset(
$act_key) OR $act_key == "")
                        
$errmsg[] = _bterrkeynotset;
                if (
count($errmsg) == 0) {
                        if (
$db->sql_numrows($db->sql_query("SELECT * FROM ".$db_prefix."_users WHERE username ='".escape($username)."';")) == 0)
                                
$errmsg[] = _bterrusernotexists;
                        if (
$db->sql_numrows($db->sql_query("SELECT * FROM ".$db_prefix."_users WHERE username ='".escape($username)."' AND active = 1;")) != 0)
                                
$errmsg[] = _btuseralreadyactive;
                        if (
$db->sql_numrows($db->sql_query("SELECT * FROM ".$db_prefix."_users WHERE username ='".escape($username)."' AND md5(act_key) = '".escape($act_key)."';")) == 0)
                                
$errmsg[] = _bterrinvalidactkey;
                }
                if (
count($errmsg) != 0bterror($errmsg,_btacterror);
                
$sql "UPDATE ".$db_prefix."_users SET active = 1 WHERE username = '".escape($username)."';";
                if (!
$db->sql_query($sql)) btsqlerror($sql);
                
$sql "INSERT INTO ".$db_prefix."_shouts (user, text, posted) VALUES ('1', '"._btusershout_welcome."".escape($username)."', NOW());";
                if(
$shout_config['shoutnewuser'] == "yes")$db->sql_query($sql);

                
//userlogin(escape($username),$btuser);
                
if($forumshare)forumadd($username);
                
OpenTable(_btsignup);
                echo 
"<p>"._btactcomplete."</p>";
                
CloseTable();
                break;
        }
        case 
"register": {
                if (
$user->user) die();
                include_once(
"user/register.php");
                break;
        }
        case 
"loginfailure": {
                
OpenTable(_btlogin);
                switch (
intval($errcode)) {
                        case 
1: {
                                
bterror(_btusrpwdnotset,_btlogin);
                                break;
                        }
                        case 
2: {
                                
bterror(_btuserpasswrong,_btlogin);
                                break;
                        }
                        case 
3: {
                                
bterror(_btuserinactive,_btlogin);
                                break;
                        }
                        case 
4: {
                                
bterror(_btuserinactive,_btlogin);
                                break;
                        }
                }
                
CloseTable();
                break;
        }
        case 
"loginsuccess": {
                echo 
"<meta http-equiv=\"refresh\" content=\"3;url=index.php\">";
                
OpenTable(_btlogin);
                echo 
"<p>"._btloginsuccessful."</p>";
                
CloseTable();
                break;
        }
        case 
"profile": {
                include(
"user/profile.php");
                break;
        }
        case 
"editprofile": {
                include(
"user/editprofile.php");
                break;
        }
        case 
"lostpassword": {
                if (
$user->user) break;
                include(
"user/lostpassword.php");
                break;
        }
        case 
"lostpasswordconfirm": {
                if (
$user->user) break;
                if (!isset(
$uid) OR !is_numeric($uid) OR !isset($code)) bterror();
                 
$sql "UPDATE ".$db_prefix."_users SET password = newpasswd, newpasswd = NULL WHERE id = '".intval($uid)."' ;";
                
$db->sql_query($sql);
                if (
$db->sql_affectedrows()) {
                        
OpenTable(_btlostpassword);
                        echo 
"<p>"._btlostpwdcomplete."</p>";
                        
CloseTable();
                } else 
bterror(_btlostpwdinvalid,_btlostpassword);
                break;
        }
        case 
"delete": {
                if (!
$user->userloginrequired("user");
                if (isset(
$id)) {
                        if (!
$user->adminloginrequired("admin");
                        else 
$uid $id;
                        
$sql "SELECT username, ban FROM ".$db_prefix."_users WHERE id = '".$uid."';";
                        
$res $db->sql_query($sql);
                        list (
$username$ban) = $db->sql_fetchrow($res);
                        
$db->sql_freeresult($res);
                        if(
$ban == 1bterror(_btuserban_userban,_btdeluser);
                        if (empty(
$username)) bterror(_bterrusernotexists,_btdeluser);
                } else 
$uid $user->id;
if(
getlevel($uid) == "owner" && $user->group != "owner"){
OpenErrTable(_btaccdenied);
echo 
"<p>"._btuser_edit."</p>";
CloseErrTable();
break;
}

                if (isset(
$postback)) {
                        
$sql "SELECT avatar FROM ".$db_prefix."_users WHERE id = '".$id."';";
                        
$res $db->sql_query($sql);
                        list (
$avatar) = $db->sql_fetchrow($res);
                        
$db->sql_freeresult($sql);
                        if (
preg_match("/^user/",$avatar)) @unlink($avatar);

                        if (
$gfx_check AND (!isset($gfxcode) OR $gfxcode == "" OR $gfxcheck != md5(strtoupper($gfxcode)))) bterror(_bterrcode,_btdeluser);
                        if(
$forumshare AND get_user_forum_name($username)>=2)forum_delete($uid$username);
                        
$sql = Array();
                        
$sql[] = "DELETE FROM ".$db_prefix."_tickets WHERE user = '".$uid."';";
                        
$sql[] = "DELETE FROM ".$db_prefix."_snatched WHERE userid = '".$uid."';";
                        
$sql[] = "DELETE FROM ".$db_prefix."_shouts WHERE user = '".$uid."';";
                        
$sql[] = "DELETE FROM ".$db_prefix."_download_completed WHERE user = '".$uid."';";
                        
$sql[] = "DELETE FROM ".$db_prefix."_privacy_backup WHERE master = '".$uid."' OR slave = '".$uid."';";
                        
$sql[] = "DELETE FROM ".$db_prefix."_privacy_file WHERE master = '".$uid."' OR slave = '".$uid."';";
                        
$sql[] = "DELETE FROM ".$db_prefix."_privacy_global WHERE master = '".$uid."' OR slave = '".$uid."';";
                        
$sql[] = "DELETE FROM ".$db_prefix."_comments_notify WHERE user = '".$uid."';";
                        
$sql[] = "DELETE FROM ".$db_prefix."_seeder_notify WHERE user = '".$uid."';";
                        
$sql[] = "DELETE FROM ".$db_prefix."_online_users WHERE id = '".$uid."';";
                        
$sql[] = "UPDATE ".$db_prefix."_torrents SET owner = '0', ownertype = '2' WHERE owner = '".$uid."';";
                        
$sql[] = "UPDATE ".$db_prefix."_peers SET uid = '0' WHERE uid = '".$uid."';";
                        
$sql[] = "DELETE FROM ".$db_prefix."_private_messages_blacklist WHERE master = '".$uid."' OR slave = '".$uid."';";
                        
$sql[] = "DELETE FROM ".$db_prefix."_private_messages_bookmarks WHERE master = '".$uid."' OR slave = '".$uid."';";
                        
$sql[] = "DELETE FROM ".$db_prefix."_private_messages WHERE recipient = '".$uid."';";
                        
$sql[] = "DELETE FROM ".$db_prefix."_users WHERE id = '".$uid."';";

                        foreach (
$sql as $query) {
                                
$db->sql_query($query) or btsqlerror($sql);
                        }

                        
OpenTable(_btdeluser);
                        echo 
"<p>"._btaccountdeleted."</p>";
                        if (!isset(
$id)) echo "<meta http-equiv=\"refresh\" content=\"3;url=index.php\">";
                        
CloseTable();
                } else {
                        
OpenTable(_btdeluser);
                        if (isset(
$id)) echo "<p>".str_replace("**user**",htmlspecialchars($username),_btdeluserwarningadm)."</p>";
                        else echo 
"<p>"._btdeluserwarning."</p>";

                        echo 
"<form method=\"POST\" action=\"user.php\"><input type=\"hidden\" name=\"op\" value=\"delete\" />\n";
                        if (isset(
$id)) echo "<input type=\"hidden\" name=\"id\" value=\"".$id."\" />\n";

                        if (
$gfx_check) {
                                
$rnd_code strtoupper(RandomAlpha(5));
                                echo 
_btsecuritycode."<br>\n<img src=\"gfxgen.php?code=".base64_encode($rnd_code)."\" alt=\""._btsecuritycode."\"><br>\n<input type=\"text\" name=\"gfxcode\" size=\"10\" maxlength=\"6\">";
                                echo 
"<input type=\"hidden\" name=\"gfxcheck\" value=\"".md5($rnd_code)."\"><br>\n";
                        }

                        echo 
"<p align=\"center\"><input type=\"submit\" name=\"postback\" value=\""._btconfirmdelete."\"></p>\n";

                        echo 
"</form>";
                        
CloseTable();
                }

                break;
        }
        default: 
bterror("");
}

include(
"footer.php");
?>
Reply With Quote
  #10  
Old 3rd September 2012, 15:17
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default
try this in include/functions.php find
PHP Code:
function loginrequired($level$guickclose false) {
        global 
$user$gfx_check
and change it to
PHP Code:
function loginrequired($level$guickclose false) {
        global 
$db$db_prefix$admin_email$runhnrsystem$btuser$autoscrape,$most_users_online $dead_torrent_interval$announce_interval$down_limit$autodel_users$sitename$autodel_users_time$inactwarning_time$siteurl$forumbase,$forumshare,$phpEx$config,$phpbb_root_path,$forumpx$autoclean_interval;
        global 
$user$gfx_check
__________________
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
The Following User Says Thank You to joeroberts For This Useful Post:
Giorgatzelos (3rd September 2012)
Reply

Tags
error , login , tracker , typing , url

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 12:53. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.