View Full Version: Cant integrate phpBTTrackerMod.

MPAM Rebooted Forums > Software support (freewares, PHP...) > Cant integrate phpBTTrackerMod.


Title: Cant integrate phpBTTrackerMod.
Description: Works in IE but no FIREFOX


playa4002 - January 2, 2007 08:25 AM (GMT)
I need this site to work in both firefox ( mostly) and ie...

It works when it est it in ie, but firefox gives me strange errors... I know its not your software casing this problem, i see it around. But im no expert when it comes to coding, and problem solving. I appreciate it!

Heres the code of the error giving ( people were saying spacing was giving errors so i tryed to respace some things)

CODE

<?php
require("incl/head.php");
?><?php
function doCrash($msg)
{
echo '</table></table><p class="error">Script error: '.$msg.'</p></body></html>';
exit(1);
}

require_once("incl/config.php");
require_once("incl/funcsv2.php");

$scriptname = $_SERVER["PHP_SELF"];
if (!isset($GLOBALS["countbytes"]))
$GLOBALS["countbytes"] = true;
?><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<meta name="author" content="David Herreman (www.free-css-templates.com)" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
<link rel="stylesheet" href="images/style.css" type="text/css" />
<title>No More Truth</title>
   <style type="text/css">
.style1 {color: #006600}
body {
background-color: #0f0f0f;
}
   </style>
</head>
<body?



<div class="content">
 
  <div class="header">
   <div class="searchf">
    <form method="post" action="#"><p>
     Search: <input type="text" name="search" class="search" value="Not Implimented Yet" /> </p>
    </form>
   </div>
   <div class="leftside">
   <h1>Helpfull Torrents </h1>
   <h2>We Do It For You! </h2>
    </div>
  </div>
 
  <div id="lnews">
   <h2>Why? </h2>
 We want you to have the best freeware around! </div>
   
  <div id="nav">
     <ul>
    <li id="current"><a href="index.php">Home</a></li>
    <li><a href="#">Forums</a></li>
    <li><a href="#">Something</a></li>
    <li><a href="#">Something</a></li>
         <li><a href="#">Something</a></li>
         <li><a href="#">Something</a></li>
        </ul>
  </div>
 
  <div class="main_content">
    <div class="sd_left">
    <div class="text_padding"><table class="torrentlist">

<tr>
 <th>Name/Info Hash</th><th>Seeders</th><th>Leechers</th><th>Completed D/Ls</th>
 <?php
 // Bytes mode off? Ignore the columns
 if ($GLOBALS["countbytes"])
  echo '<th>Bytes Transferred</th><th>Speed</th>';
 ?></tr>

<?php
if ($GLOBALS["persist"])
$db = mysql_pconnect($dbhost, $dbuser, $dbpass) or doCrash("Tracker error: can't connect to database - ".mysql_error());
else
$db = mysql_connect($dbhost, $dbuser, $dbpass) or doCrash("Tracker error: can't connect to database - ".mysql_error());
mysql_select_db($database) or doCrash("Tracker error: can't open database $database - ".mysql_error());

/* Rewrite, part 1: encode "WHERE" statement only. */

if (isset($_GET["seededonly"]))
$where = " WHERE seeds > 0";
else if (isset($_GET["activeonly"]))
$where = " WHERE leechers+seeds > 0";
else
$where = " ";

// Grab dummy column for dlbytes so we can skip doing format()
if ($GLOBALS["countbytes"])
$bytes = 'format(summary.dlbytes/1073741824,3)';
else
$bytes = '0';
$query = "SELECT summary.info_hash, summary.seeds, summary.leechers, format(summary.finished,0), ".$bytes.", namemap.filename, namemap.url, namemap.info, summary.speed FROM summary LEFT JOIN namemap ON summary.info_hash = namemap.info_hash ".$where." ORDER BY namemap.filename";
$results = mysql_query($query) or doCrash("Can't do SQL query - ".mysql_error());
$i = 0;

while ($data = mysql_fetch_row($results)) {
// NULLs are such a pain at times. isset($nullvar) == false
if (is_null($data[5]))
 $data[5] = $data[0];
if (is_null($data[6]))
 $data[6] = "";
if (is_null($data[7]))
 $data[7]="";
if (strlen($data[5]) == 0)
 $data[5]=$data[0];
$myhash = $data[0];
$writeout = "row" . $i % 2;
echo '<tr class="'.$writeout.'">';
echo '<td>';
if (strlen($data[6]) > 0)
 echo "<a href=\"${data[6]}\">${data[5]}</a>";
else
 echo $data[5];
if (strlen($data[7]) > 0)
 echo "<br/>(${data[7]})";
echo '</td>';
for ($j=1; $j < 4; $j++)
 echo '<td class="center">'.$data[$j].'</td>';

if ($GLOBALS["countbytes"])
{
 echo '<td class="center">'.$data[4].' GiB</td>';

 // The SPEED column calcultions.
 if ($data[8] <= 0)
  $speed = "Zero";
 else if ($data[8] > 2097152)
  $speed = round($data[8]/1048576,2) . ' MiB/sec';
 else
  $speed = round($data[8] / 1024, 2) . ' KiB/sec';
 echo '<td class="center">'.$speed.'</td>';
}
echo '</tr>';
$i++;
}

if ($i == 0)
echo '<tr class="row0"><td style="text-align: center;" colspan="6">No data</td></tr>';
?></table><br />    
   
   </div>
    </div>
   
   </div>
   <div id="bottomb">
    <div class="padding">
     <div class="rights">
      <h2>Partners</h2>
       <ul>
        <li> <a href="http://www.solucija.com">solucija.com</a></li>
        <li> <a href="http://www.free-css-templates.com">free-css-templates.com</a></li>
        <li> <a href="http://snews.vietbee.net/">snews.vietbee.net</a></li>
        <li> <a href="http://p-ahlqvist.com/">p-ahlqvist.com</a></li>
        <li> <a href="http://www.brauck.nl/">www.brauck.nl</a></li>
        <li> <a href="http://www.design4.ltd.pl/">www.design4.ltd.pl</a></li>
       </ul>
     </div>
     <div class="bottomd">    
      <h2 class="style1">Past Articles</h2>
       <ul>
        <li><a href="http://www.iollo.com/home/welcome_to_iollos_all_stuff_reviews/">Welcome to iollo's review highway</a></li>
        <li><a href="http://www.iollo.com/home/open_source_web_designs_and_webmaster_forum/">Open Source Web Designs and Webmaster Forum</a></li>
        <li><a href="http://www.solucija.com/home/css-toplist/">CSS Toplist</a></li>
        <li><a href="http://www.solucija.com/home/new-template-internet-music/">New template: Internet Music</a></li>
        <li><a href="http://www.cssheaven.com/">CSS Heaven Gallery</a></li>
       
       
       
       
       </ul>
     </div>
     <div class="bottomc">    
      <h2>Top Articles</h2>
       <ul>
        <li><a href="http://www.solucija.com/home/new-template-internet-music/">New template: Internet Music</a></li>
        <li><a href="http://www.cssheaven.com/">CSS Heaven Gallery</a></li>
        <li><a href="http://www.solucija.com/home/css-toplist/">CSS Toplist</a></li>
        <li><a href="http://www.iollo.com/home/open_source_web_designs_and_webmaster_forum/">Open Source Web Designs and Webmaster Forum</a></li>
        <li><a href="http://www.iollo.com/home/welcome_to_iollos_all_stuff_reviews/">Welcome to iollo's review highway</a></li>
       </ul>
     </div>
     
     
     
     
    </div>
   </div>
   
   
   <div class="footer">
    <div class="padding">
     Powered by <a href="http://snews.solucija.com" title="Single file CSS and XHTML valid CMS">sNews</a> | <a href="#">Login</a>
     <br />
     <img src="images/rss.gif" alt="" />&nbsp;<a href="rss/">RSS Feed</a>&nbsp;
     <img src="images/valid.gif" alt="" />&nbsp;<a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a> &nbsp;<img src="images/valid.gif" alt="" />&nbsp; <a href="http://validator.w3.org/check?uri=referer">XHTML</a>  
     </div>
     </div>
</div>
</body>
</html>

patheticcockroach - January 2, 2007 04:06 PM (GMT)
What's the error you get on Firefox ?

However, my first guess would be that your page isn't proper XHTML so you should remove
CODE
xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"

Firefox doesn't want to display XHTML pages if it founds even the smallest error in them. So removing the XHTML doctype fixes it. MSIE is so broken that it doesn't care, that's why your code works in IE.

playa4002 - January 2, 2007 05:39 PM (GMT)
I got rid of it, and I still get the error
CODE

XML Parsing Error: not well-formed
Location: http://localhost/bittorrents/
Line Number 16, Column 6:<body?
-----^

patheticcockroach - January 2, 2007 05:48 PM (GMT)
Please show me what's in your incl/head.php file. You should remove anything about XHTLM inside of this file too

playa4002 - January 2, 2007 05:57 PM (GMT)
I know to get rid of whats bold, but what else?

CODE
<?php
session_start();
if(!file_exists("incl/config.php") && strpos($_SERVER["PHP_SELF"],"install.php")==false && strpos($_SERVER["PHP_SELF"],"about.php")==false)header("Location: install.php");
if (isset($_SERVER["HTTP_ACCEPT"])&&stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml")) {header("Content-type: application/xhtml+xml; charset=iso-8859-1");}
else {header("Content-type: text/html; charset=iso-8859-1");}
echo '<?xml version="1.0" encoding="iso-8859-1" ?>';
?>
[B]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">[/B]
<html [B]xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"[/B]>

playa4002 - January 2, 2007 05:59 PM (GMT)
Actually i shortned it too, this and it worked, do i need the other stuff?
CODE

<?php
session_start();
if(!file_exists("incl/config.php") && strpos($_SERVER["PHP_SELF"],"install.php")==false && strpos($_SERVER["PHP_SELF"],"about.php")==false)header("Location: install.php");
?>
<html>


Just got rid of the if statement

Also thanks for all your help!

patheticcockroach - January 2, 2007 06:00 PM (GMT)
Ah sorry, my bad. You can put back this stuff if you want (you can also leave it removed). The only thing you have to remove is
CODE
if (isset($_SERVER["HTTP_ACCEPT"])&&stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml")) {header("Content-type: application/xhtml+xml; charset=iso-8859-1");}
else {header("Content-type: text/html; charset=iso-8859-1");}

This is a code that serves the page as application/xhtml+xml. If this is turned on, Firefox won't display the page if there is an error. The other code I mentionned earlier should be ok.

Edit : well I see you found out by yourself ;)

playa4002 - January 2, 2007 06:06 PM (GMT)
But you pushed me in the right direction, Thanks alot :)




Hosted for free by InvisionFree