Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   TBDev (http://www.bvlist.com/forumdisplay.php?f=20)
-   -   ajax code dont work anymore updated Apache webserver (http://www.bvlist.com/showthread.php?t=10742)

sharpe1983 19th February 2016 21:46

ajax code dont work anymore updated Apache webserver
 
ive just upgraded my Apache web server to Apache version 2.2.22 and now my ajax browse page dont work just get error 500 could someone tell me whats gone wrong? all my other php pages work ok

thanks in advance

Code:

//ini_set("display_errors","2");
//ERROR_REPORTING(E_ALL);
// == If not working, uncomment above for debugging.

/*
+------------------------------------------------
|  TBDev.net BitTorrent Tracker PHP
|  =============================================
|  by CoLdFuSiOn
|  (c) 2003 - 2009 TBDev.Net
|  http://www.tbdev.net
|  =============================================
|  svn: http://sourceforge.net/projects/tbdevnet/
|  Licence Info: GPL
+------------------------------------------------
|  $Date$
|  $Revision$
|  $Author$
|  $URL$
+------------------------------------------------
                                = Ajax Browse by TheHippy 2010
*/
require_once("include/bittorrent.php");
include("class/db.class.php");
include("class/browse.class.php")
dbconn(true);
loggedinorreturn();
//getpage();
//parked();
if ($_GET['clear_new']){
mysql_query("UPDATE users SET last_browse=".gmtime()." where id=".$CURUSER['id']);
header("Location: browse.php");
}
$torrents = array();
        $res = mysql_query("SELECT torrent, seeder, COUNT(*) AS c FROM peers GROUP BY torrent, seeder");
        while ($row = mysql_fetch_assoc($res)) {
                if ($row["seeder"] == "yes")
                        $key = "seeders";
                else
                        $key = "leechers";
                $torrents[$row["torrent"]][$key] = $row["c"];
        }

        $res = mysql_query("SELECT torrent, COUNT(*) AS c FROM comments GROUP BY torrent");
        while ($row = mysql_fetch_assoc($res)) {
                $torrents[$row["torrent"]]["comments"] = $row["c"];
        }

        $fields = explode(":", "comments:leechers:seeders");
        $res = mysql_query("SELECT id, seeders, leechers, comments FROM torrents");
        while ($row = mysql_fetch_assoc($res)) {
                $id = $row["id"];
                $torr = $torrents[$id];
                foreach ($fields as $field) {
                        if (!isset($torr[$field]))
                                $torr[$field] = 0;
                }
                $update = array();
                foreach ($fields as $field) {
                        if ($torr[$field] != $row[$field])
                                $update[] = "$field = " . $torr[$field];
                }
                if (count($update))
                        mysql_query("UPDATE torrents SET " . implode(",", $update) . " WHERE id = $id");
}
      //$deadtime = deadtime();
      //mysql_query("DELETE FROM peers WHERE last_action < FROM_UNIXTIME($deadtime)");

        $deadtime -= $max_dead_torrent_time;
        mysql_query("UPDATE torrents SET visible='no' WHERE visible='yes' AND last_action < FROM_UNIXTIME($deadtime)");

//mysql_query("UPDATE torrents SET free = 'yes' WHERE free = 'no' AND seeders>='3'")or sqlerr(__FILE__, __LINE__);
//mysql_query("UPDATE torrents SET free = 'no' WHERE free = 'yes' AND seeders<'10'") or sqlerr(__FILE__, __LINE__);
//mysql_query("UPDATE torrents SET free = 'yes' WHERE size > '1073741824' AND seeders>='1'") or sqlerr(__FILE__, __LINE__);
//mysql_query("UPDATE torrents SET free = 'no' WHERE size > '1073741824' AND seeders<'10'") or sqlerr(__FILE__, __LINE__);
//mysql_query("UPDATE torrents SET free = 'yes' WHERE size > '1073741824'") or sqlerr(__FILE__, __LINE__);
//mysql_query ("UPDATE torrents SET request = 'yes' WHERE request = ''") or sqlerr(__FILE__, __LINE__);
//mysql_query ("UPDATE torrents SET request = 'no' WHERE request = 'yes'") or sqlerr(__FILE__, __LINE__);
//mysql_query ("UPDATE torrents SET free = 'no' WHERE free = 'yes'") or sqlerr(__FILE__, __LINE__);
//mysql_query ("UPDATE torrents SET 10days = 'no' WHERE 10days = 'yes'") or sqlerr(__FILE__, __LINE__);
//Remove vip torrents after 7 days
/*
        if (get_user_class() == UC_USER){
$days = 14;
$dt = sqlesc(get_date_time(gmtime() - ($days * 86400)));
mysql_query("UPDATE torrents SET request = 'no' WHERE added < $dt");
}
        if (get_user_class() == UC_MEMBER){
$days = 1;
$dt = sqlesc(get_date_time(gmtime() - ($days * 86400)));
mysql_query("UPDATE torrents SET request = 'no' WHERE added < $dt");
}
        if (get_user_class() == UC_FREAK){
$days = 1;
$dt = sqlesc(get_date_time(gmtime() - ($days * 60)));
mysql_query("UPDATE torrents SET request = 'no' WHERE added < $dt");
}
*/
    //$HTMLOUT .= "";

//Remove vip torrents after 7 days
//$days = 7;
//$dt = sqlesc(get_date_time(gmtime() - ($days * 86400)));
//mysql_query("UPDATE torrents SET request = 'no' WHERE added < $dt");
    $cats = genrelist();
        $output        =        "";
        $cid        =        (isset($_GET['cat_id'])) ? $_GET['cat_id'] : "0";
        $aid        =        (isset($_GET['active'])) ? $_GET['active'] : "3";
        $pid        =        (isset($_GET['page'])) ? $_GET['page'] : "1";
        $stext        =        (isset($_GET['search'])) ? htmlspecialchars($_GET['search']) : "";

       
        $output.=        "";
        $output.=        "";
        $output.=        "";

        $cattotal = count($cats);
        $i                =        2;
        $output.=        "
:view_cate('view_cate_area', 'view_cate_link');\"> Show categories
\n";
        //$output.=        "Dead Only\n";
        //$output.=        "Active+Dead\n";
        $output.=        "All\n";
      foreach($cats as $cat){
                $output        .=        "" . $cat['name'] . "\n";

                if($i        ==8){
                        $output.=        "";

                        $i = 1;
                } else {
                        $i++;       
                }
}
                $output.=        "
 Click HERE to Clear tags
\n";

/////////////////////// HTML OUTPUT //////////////////////////////
    print stdhead();
    //if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') == true) 

/** shoutbox display **/
if ($CURUSER['shoutbox'] == 'yes')
//require_once("include/sb_inc.php");
require_once("ajaxchat.php");
//$shout_toggle = ($CURUSER['shoutbox'] === 'no' ? '
Turn Shoutbox on

' : '');
//echo $shout_toggle;

/*
else
if ($CURUSER['shoutbox'] == 'yes'){
require_once("include/sb_inc.php");
//$shout_toggle = ($CURUSER['shoutbox'] === 'no' ? '

Turn Shoutbox on

' : '');
//echo $shout_toggle;
}
*/
if ($CURUSER['shoutbox'] == 'no'){

top5();
}
      print $output;
        $btors        =        new browseTorrents;
        print("

");
        print($btors->getTorrentList());
        print("
");
        print("");
        print stdfoot();
//--- Added by Wilba --------------------------------
//mysql_query("UPDATE users SET last_browse=".gmtime()." where id=".get_user_id()."");
//mysql_query("UPDATE users SET last_browse=".TIME_NOW." where id=".get_user_id()."");
//---------------------------------------------------
?>


DND 19th February 2016 22:57

error 500.google it. you'll find it has something to do with the htaccess rules

sharpe1983 19th February 2016 23:10

already tried that m8 even removed the .htaccess and still getting 500 error it doesnt say an internal error just says server error 500

The website encountered an error while retrieving http://***/browse1.php. It may be down for maintenance or configured incorrectly.


PHP Syntax Check: Parse error: syntax error, unexpected 'dbconn' (T_STRING) in your code on line 10

DND 19th February 2016 23:55

dbconn..
u using mysql or mysqli?
use dbconn(false); not true into the page
the error just told ya it is unexpected there to have it.. since it connects already in bittorrent/config/announce

sharpe1983 20th February 2016 00:02

im using mysql just changed to false but still get 500 code

DND 20th February 2016 00:12

your server must be misconfigured badly..
what the error log say?
maybe you should config apache2 again and then php.ini

UFFENO1 20th February 2016 11:52

change:
PHP Code:

include("class/browse.class.php"

to:
PHP Code:

include("class/browse.class.php"); 


DND 20th February 2016 13:18

oh lol yeah.. he missed there.

sharpe1983 20th February 2016 19:54

Thank you all working now :P


All times are GMT +2. The time now is 00:33.

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