View Single Post
  #1  
Old 19th February 2016, 21:46
sharpe1983 sharpe1983 is offline
Member
 
Join Date: Jul 2011
P2P
Posts: 14
Default 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:
<?php
//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 .= "<div id='view_cate_area' style='display:none;'>";
    //print out the tag cloud
    //require_once "include/sb_inc.php";
    //$HTMLOUT .= top5() . "</div><br /><br />";

//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.=	"<input type=\"hidden\" id=\"cater\" value=\"" . $cid . "\" />";
	$output.=	"<input type=\"hidden\" id=\"active\" value=\"" . $aid . "\" />";
	$output.=	"<input type=\"hidden\" id=\"page\" value=\"" . $pid . "\" />";

	$cattotal = count($cats);
	$i		=	2;
	$output.=	"<center><a href=\"javascript:view_cate('view_cate_area', 'view_cate_link');\"><font id=\"view_cate_link\"><img border='0' src=\"pic/plus2.gif?v=2\"/> Show categories</font></a><div id=\"view_cate_area\" class=\"row3\" style=\"display:none;\"><script type=\"text/javascript\"> if (readCookie('ViewCategoriesXz')) view_cate('view_cate_area', 'view_cate_link'); </script><br />\n";
	//$output.=	"<span class=\"ajaxclicker active\" id=\"actimg2\" onmousedown=\"document.getElementById('active').value='2'; doActBg('2','3');\" onclick=\"doBrowse();\"><span><font color='#ffffff'>Dead Only</font></span></span>\n";
	//$output.=	"<span class=\"ajaxclicker active_on\" id=\"actimg3\" onmousedown=\"document.getElementById('active').value='3'; doActBg('3','3');\" onclick=\"doBrowse();\"><span><font color='#ffffff'>Active+Dead</font></span></span><br />\n";
	$output.=	"<span class=\"btn\" onmousedown=\"document.getElementById('cater').value='0'; doCatBg('0','" . $cattotal . "');\" onclick=\"doBrowse();\"><span><font color='#00000'>All</font></span></span>\n";
       foreach($cats as $cat){
		$output	.=	"<span class=\"btn\" id=\"catimg" . $cat['id'] . "\" onmousedown=\"document.getElementById('cater').value='" . $cat['id'] . "'; doCatBg('" . $cat['id'] . "','" . $cattotal . "');\" onclick=\"doBrowse();\"><span><font color='#000000' align='center'>" . $cat['name'] . "</font></span></span>\n";

		if($i	==8){
			$output.=	"<br />";

			$i = 1;
		} else {
			$i++;	
		}
}
		$output.=	"</center></div><table width=100% class=row1 border=0 cellspacing=0 cellpadding=0><tr><td><center><span><br><input placeholder=\"Torrent Search\" style=\"text-align:center; font-size: 18px; width: 800px;\" type=\"text\" onkeyup=\"doBrowse();\" value=\"$stext\" id=\"searchtors\" /></span>&nbsp;<span><a href=getrss.php><i class='fa fa-rss fa-2x' style='color:white'></i></a></span><br><b>Click <a href='?clear_new=1'><strong>HERE</strong></a> to Clear <b><img src=pic/new.gif></b> tags</a></tr></table>\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' ? '<center><a href=\'shoutbox.php?shout=yes\'><b><font color=green>Turn Shoutbox on</b></font></a><p>' : '');
//echo $shout_toggle;

/*
else
if ($CURUSER['shoutbox'] == 'yes'){
require_once("include/sb_inc.php");
//$shout_toggle = ($CURUSER['shoutbox'] === 'no' ? '<center><a href=\'shoutbox.php?shout=yes\'><b><font color=green>Turn Shoutbox on</b></font></a><p>' : '');
//echo $shout_toggle;
}
*/
if ($CURUSER['shoutbox'] == 'no'){

top5();
}
       print $output;
	$btors	=	new browseTorrents;
	print("<fieldset border=\"0\" id=\"browsecontent\">");
	print($btors->getTorrentList());
	print("</fieldset >");
	print("<script type=\"text/javascript\"> doBrowse();</script>");
	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()."");
//---------------------------------------------------
?>
Reply With Quote