Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
User Posts

Go to Profile

so i noticed my country wasent listed in the drop down list for user country so i modified the edit languages from admincp to do the job

[color=rgb(41, 105, 176)]in admincp before the last <? add[/color]


///start countrys
if ($action=="countrys" && $do=="view"){
 stdhead(T_("COUNTRYS"));
 navmenu();
 begin_frame(T_("COUNTRYS"));
 echo '<br />';
 echo '<br />';
 echo "<center><a href='admincp?action=countrys&amp;do=add'><b>Add New country</b></a></center><br />";

 print("<i><center>Please note that country image is optional</i><br /><br /></center>");

 echo("<center><table width='95%' class='table_table'><tr>");
 echo("<th class='table_head'><b>".T_("NAME")."</b></th><th class='table_head'><b>Image</b></th><th width='30' class='table_head'></th></tr>");
 $query = "SELECT * FROM countries ORDER BY name ASC";
 $sql = SQL_Query_exec($query);
 while ($row = mysqli_fetch_array($sql)) {
   $id = $row['id'];
   $name = $row['name'];
   $flagpic = $row['flagpic'];

   print("<tr><td class='table_col1'>$name</td><td class='table_col2' align='center'>");
   if (isset($row["flagpic"]) && $row["flagpic"] != "")
     print("<img border=\"0\" src=\"" . $site_config['SITEURL'] . "/images/languages/" . $row["flagpic"] . "\" alt=\"" . $row["name"] . "\" />");
   else
     print("-");
   print("</td><td class='table_col1'><a href='admincp?action=countrys&amp;do=edit&amp;id=$id'>[EDIT]</a> <a href='admincp?action=countrys&amp;do=delete&amp;id=$id'>[DELETE]</a></td></tr>");
 }
 echo("</table></center>");
 end_frame();
 stdfoot();
}


if ($action=="countrys" && $do=="edit"){
 stdhead(T_("COUNTRYS_MANAGEMENT"));
 navmenu();

 $id = (int)$_GET["id"];

 if (!is_valid_id($id))
   show_error_msg(T_("ERROR"),T_("INVALID_ID"),1);

 $res = SQL_Query_exec("SELECT * FROM countries WHERE id=$id");

 if (mysqli_num_rows($res) != 1)
   autolink("admincp.php?action=countrys&do=view", "No country with ID $id.");

 $arr = mysqli_fetch_array($res);

 if ($_GET["save"] == '1'){
 
   $name = $_POST['name'];
   if ($name == "")
     show_error_msg(T_("ERROR"), "country name cannot be empty!",1);
   $domain = $_POST['domain'];
   $image = $_POST['image'];
   $name = sqlesc($name);
   $image = sqlesc($image);
   $domain = sqlesc($domain);

   SQL_Query_exec("UPDATE countries SET name=$name, flagpic=$image, domain=$domain WHERE id=$id");
   autolink("admincp.php?action=countrys&do=view", "country was edited successfully.");

 } else {
   begin_frame("Edit country");
   print("<form method='post' action='?action=countrys&amp;do=edit&amp;id=$id&amp;save=1'>\n");
   print("<center><table border='0' cellspacing='0' cellpadding='5'>\n");
   print("<tr><td align='left'><b>Name: </b><input type='text' name='name' value=\"".$arr['name']."\" /></td></tr>\n");
   print("<tr><td align='left'><b>Image: </b><input type='text' name='image' value=\"".$arr['flagpic']."\" /> single filename</td></tr>\n");
   print("<tr><td align='left'><b>Domain: </b><input type='text' name='domain' value=\"".$arr['domain']."\" /></td></tr>\n");
   print("<tr><td align='center'><input type='submit' value='Submit' /></td></tr>\n");
   print("</table></center>\n");
   print("</form>\n");
       end_frame();
 }
 stdfoot();
}

if ($action=="countrys" && $do=="delete"){
 stdhead(T_("COUNTRY_MANAGEMENT"));
 navmenu();

 $id = (int)$_GET["id"];

 if ($_GET["sure"] == '1'){

   if (!is_valid_id($id))
     show_error_msg(T_("ERROR"),"Invalid country item ID",1);

   SQL_Query_exec("DELETE FROM countries WHERE id=$id"); //delete old country
   autolink("admincp.php?action=countrys&do=view", "Country Deleted.");

 }else{
   begin_frame("Delete country");
   print("<form method='post' action='?action=countrys&amp;do=delete&amp;id=$id&amp;sure=1'>\n");
   print("<center><table border='0' cellspacing='0' cellpadding='5'>\n");
   print("<tr><td align='center'><input type='submit' value='Submit' /></td></tr>\n");
   print("</table></center>\n");
   print("</form>\n");
 }
 end_frame();
 stdfoot();
}

if ($action=="countrys" && $do=="takeadd"){
     $name = $_POST['name'];
   if ($name == "")
       autolink("admincp.php?action=countrys&do=view", "Name cannot be empty!.");
   $domain = $_POST['domain'];
   $image = $_POST['image'];
   $name = sqlesc($name);
   $image = sqlesc($image);
   $domain = sqlesc($domain);
   $check="SELECT * FROM countries WHERE name = '$_POST[name]'";
$rs = SQL_Query_exec($check);
$data = mysqli_fetch_array($rs, MYSQLI_NUM);
if($data[0] > 1) {
   autolink("admincp.php?action=countrys&do=view", "Country Already Exists!");
}
else
{
 SQL_Query_exec("INSERT INTO countries (name, flagpic, domain) VALUES ($name, $image, $domain)");
}
 if (mysqli_affected_rows($GLOBALS["DBconnector"]) == 1) {
   autolink("admincp.php?action=countrys&do=view", "country was added successfully");
 }
 else
 {
     autolink("admincp.php?action=countrys&do=view", "Unable to add country");
 }
}

if ($action=="countrys" && $do=="add"){
 stdhead(T_("COUNTRYS_MANAGEMENT"));
 navmenu();

 begin_frame("Add country");
 print("<center><form method='post' action='admincp'>\n");
 print("<input type='hidden' name='action' value='countrys' />\n");
 print("<input type='hidden' name='do' value='takeadd' />\n");

 print("<table border='0' cellspacing='0' cellpadding='5'>\n");

 print("<tr><td align='left'><b>Name:</b> <input type='text' name='name' /></td></tr>\n");
 print("<tr><td align='left'><b>Image:</b> <input type='text' name='image' /></td></tr>\n");
 print("<tr><td align='left'><b>Domain:</b> <input type='text' name='domain' /></td></tr>\n");
 print("<tr><td colspan='2'><input type='submit' value='Submit' /></td></tr>\n");
 print("</table></form><br /><br /></center>\n");
 end_frame();
 stdfoot();
}
//end  countrys


add a link into admincp

<td align="center"><a href="admincp.php?action=countrys&amp;do=view"><img src="images/admin/country.jpg" border="0" width="32" height="32" alt="" /><br /><?php echo T_("COUNTRY_MANAGEMENT"); ?></a><br /></td


add to languages/english.php


$LANG["COUNTRY_MANAGEMENT"] = "Countries Management";
$LANG["COUNTRYS"] = "Countries";


add to images/admin

[ATTACH]5128[/ATTACH]

edit: added a check to see if country was already added first post updated

add the countries 1 and 2 into images/languages
I'll take a look at the weekend I've a heavy work load on atm ? and yes [USER=311]@MicroMonkey[/USER] thats the plan ?
i dont have any http announces to test :(
Found this in the forums edited it works as it iinstalls the database and adds an admin user.  the devs might want to tinker with it
not sure the entered password works correctly here it is

you need to add a database and edit backend mysql.php with the correct details then add the whole install folder to your root and navigate to http://your.domain.com/install
could just figure out why the original isnt working


function escape_url($url) {
   $ret = '';
   for($i = 0; $i < strlen($url); $i+=2)
   $ret .= '%'.$url[$i].$url[$i + 1];
   return $ret;
}

/**
* Scrape torrent and return stats
*
* @param $scrape
*   string: Scrape URL
* @param $hash
*   string: SHA1 hash (info_hash) of torrent
* @return
*   array:
*     All -1 if failed
*     - seeds: integer - number of seeders
*     - leechers: integer - number of leechers
*     - downloaded: integer - number of complete downloads
*
*/
function torrent_scrape_url($scrape, $hash) {
   if (function_exists("curl_exec")) {
       $ch = curl_init();
       $timeout = 5;
       curl_setopt ($ch, CURLOPT_URL, $scrape.'?info_hash='.escape_url($hash));
       curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
       curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
       curl_setopt ($ch, CURLOPT_HEADER, false);
       $fp = curl_exec($ch);
       curl_close($ch);
   } else {
       ini_set('default_socket_timeout',10);
       $fp = @file_get_contents($scrape.'?info_hash='.escape_url($hash));
   }
   $ret = array();
   if ($fp) {
       $stats = BDecode($fp);
       $binhash = pack("H*", $hash);
       $binhash = addslashes($binhash);
       $seeds = $stats['files'][$binhash]['complete'];
       $peers = $stats['files'][$binhash]['incomplete'];
       $downloaded = $stats['files'][$binhash]['downloaded'];
       $ret['seeds'] = $seeds;
       $ret['peers'] = $peers;
       $ret['downloaded'] = $downloaded;
   }

   if ($ret['seeds'] === null) {
       $ret['seeds'] = -1;
       $ret['peers'] = -1;
       $ret['downloaded'] = -1;
   }

   return $ret;
}
? Need more people to test this so it can be moved to completed
i now see what you wanted the backup stats and torrent stats seprate i prefer the original way as it gives total seeds etc but if its good for you
btw you can remove

} else {
           $stats = torrent_scrape_url($tracker, $row["info_hash"]);
       }

not needed
post your code [USER=20311]@shadows[/USER]  changing to what you said gives me 0 stats
On the backup trackers that's what's its suposeed to do gets total seeds leech and completed adds them all together and gives total for each how did you get it to work what did you change.? And what is it you want it to do instead of what it's doing now.?
this is the entire code as i have it in torrent-details


//===| Scrape External Torrents
   if ($row["external"]=='yes')
   {
       print ("<td width='160' border='0' align='right' valign='top'><table><tr>");
       if ($scrape =='1')
       {
           $seeders = $leechers = $downloaded = NULL;
           print("<td class='table_col1' border'0' width='150' valign='middle'>
           <div style='margin-top:5px; border='0' margin-bottom:10px; font:bold 16px Times' align='center'><font color='#FF2000'>".T_("EXTERNAL_TORRENT")."</font></div>");

         //===| UDP Scraper

$tress = SQL_Query_exec("SELECT * FROM `announce` WHERE `torrent` = $id");
if (mysqli_num_rows($tress) > 1){
$resu = SQL_Query_exec("SELECT url FROM announce WHERE torrent=$id");
}
else
{
$resu = SQL_Query_exec("SELECT id, info_hash, announce FROM torrents WHERE external = 'yes' AND id = $id");
}
while ($rowu = mysqli_fetch_array($resu)){
if (mysqli_num_rows($tress) > 1){
$ann = $rowu["url"];
}else{
$ann = $rowu["announce"];  
}
$annlist = array($ann);
$seeders = $leechers = $downloaded = NULL;
foreach ($annlist as $ann)                    
{
$tracker = explode("/", $ann);
$path = array_pop($tracker);
$oldpath = $path;
$path = preg_replace("/^announce/", "scrape", $path);
$tracker = implode("/", $tracker)."/".$path;
if ($oldpath == $path){
continue;
}
}
if ($openbittorrent_done){
continue;
}
if (preg_match("/thepiratebay.org/i", $tracker) || preg_match("/tracker.tfile/", $tracker)){
$tracker = "udp://tracker.openbittorrent.com:80/scrape";
$openbittorrent_done = 1;
}
if(preg_match('/udp:\/\//', $tracker)){
$udp=true;
try
{
$timeout = 5;
$udp= new udptscraper($timeout);
$stats=$udp->scrape($tracker,$row["info_hash"]);
//print_r($stats); exit();
foreach ($stats as $idu=>$scrape)
{
$seeders1 += $scrape['seeders'];
$leechers1 += $scrape['leechers'];
$downloaded1 += $scrape['completed'];
}
}
catch(ScraperException $e)
{
$e->isConnectionError();
}
}
else
{
$stats = torrent_scrape_url($tracker, $row["info_hash"]);
}
if ($scrape['seeds'] != -1)
{
$seeders += $scrape['seeds'];
$leechers += $scrape['peers'];
$downloaded += $scrape['downloaded'];

 SQL_Query_exec("UPDATE `announce` SET `online` = 'yes', `seeders` = '" .$scrape[seeders]."', `leechers` = '" .$scrape[leechers]."', `times_completed` = '".$scrape[completed]."' WHERE `url` = ".sqlesc($ann)." AND `torrent` = $id");
       } else {
         SQL_Query_exec("UPDATE `announce` SET `online` = 'no' WHERE `url` = ".sqlesc($ann)." AND `torrent` = $id");

       }
     }

if ($seeders !== NULL)
{
SQL_Query_exec("UPDATE torrents SET leechers = '".$leechers1."', seeders = '".$seeders1."', times_completed = '".$downloaded1."', last_action = '".get_date_time()."', visible = 'yes' WHERE id = '".$row['id']."'");
}
else
{
SQL_Query_exec("UPDATE torrents SET last_action = '".get_date_time()."' WHERE id ='".$row['id']."'");
}

//===| End UDP Scraper

                   
           if ($seeders !== NULL)
           {
               print ("<div style='margin-bottom:5px; margin-left:20px'><b>".T_("LIVE_STATS")."</b>: </div>");
               print ("<div style='margin-left:20px'>".T_("SEEDERS").": <font color='limegreen'>".$seeders1."</font></div>");
               print ("<div style='margin-left:20px'>".T_("LEECHERS").": <font color='#FF2000'>".$leechers1."</font></div>");
               print ("<div style='margin-left:20px'>".T_("COMPLETED").": <font color='#0080FF'>".$downloaded1."</font></div>");
           }
           else
           {
               print ("<div style='margin-top:10px; margin-bottom:5px' align='center'><b>".T_("LIVE_STATS")."</b>: </div>");
               print ("<div style='font:italic 14px Times' align='center'><font color='#FF2000'>".T_("TRACKERS_OFFLINE")."!</font></div>");
           }
           print ("<div style='margin-top:10px; margin-bottom:10px' align='center'>
               <a href='torrents-details.php?id=".$id."'><input type='submit' name='submit' value=".T_("SUBMIT")."></a>
           </div>");
           print ("</td>");
       }
       else
       {
           print ("<td class='table_col1' width='150' border='0' valign='middle' align='center'>
               <div style='margin-top:5px; margin-bottom:10px; font:bold 16px Times' align='center'><font color='#FF2000'>".T_("EXTERNAL_TORRENT")."</font></div>
               <div style='font:normal 12px Times' align='center'>".T_("UPDATE_STATS")."</div></div>
                   <form action='torrents-details.php?id=$id&amp;scrape=1' method='post'>
                       <div style='margin-top:5px; margin-bottom:10px' align='center'><input type='submit' name='submit' value=".T_("UPDATE")." /></div>
                   </form>
               </td>");
       }
       print ("</tr></table></td>");
   }
   //===| End Scrape External Torrents
its working on my main tracker whats the annonce url your trying to scrape ?
can someone else try this script before i start debugging it all just to make sure it isnt an issue at shadows end
[USER=20311]@shadows[/USER] try this bud


     //===| UDP Scraper

$tress = SQL_Query_exec("SELECT * FROM `announce` WHERE `torrent` = $id");
if (mysqli_num_rows($tress) > 1){
$resu = SQL_Query_exec("SELECT url FROM announce WHERE torrent=$id");
}
else
{
$resu = SQL_Query_exec("SELECT id, info_hash, announce FROM torrents WHERE external = 'yes' AND id = $id");
}
while ($rowu = mysqli_fetch_array($resu)){
if (mysqli_num_rows($tress) > 1){
$ann = $rowu["url"];
}else{
$ann = $rowu["announce"];
}
$annlist = array($ann);
$seeders = $leechers = $downloaded = NULL;
foreach ($annlist as $ann)                  
{
$tracker = explode("/", $ann);
$path = array_pop($tracker);
$oldpath = $path;
$path = preg_replace("/^announce/", "scrape", $path);
$tracker = implode("/", $tracker)."/".$path;
if ($oldpath == $path){
continue;
}
}
if ($openbittorrent_done){
continue;
}
if (preg_match("/thepiratebay.org/i", $tracker) || preg_match("/tracker.tfile/", $tracker)){
$tracker = "udp://tracker.openbittorrent.com:80/scrape";
$openbittorrent_done = 1;
}
if(preg_match('/udp:\/\//', $tracker)){
$udp=true;
try
{
$timeout = 5;
$udp= new udptscraper($timeout);
$stats=$udp->scrape($tracker,$row["info_hash"]);
//print_r($stats); exit();
foreach ($stats as $idu=>$scrape)
{
$seeders1 += $scrape['seeders'];
$leechers1 += $scrape['leechers'];
$downloaded1 += $scrape['completed'];
}
}
catch(ScraperException $e)
{
$e->isConnectionError();
}
}
else
{
$stats = torrent_scrape_url($tracker, $row["info_hash"]);
}

if ($scrape['seeds'] != -1)
{
$seeders += $scrape['seeds'];
$leechers += $scrape['peers'];
$downloaded += $scrape['downloaded'];


remove require_once("backend/parse.php");
another addition i was getting an error about the backup configs already existing ie

Warning:  fopen(backups/saveconfig_original.php): failed to open stream: File exists
Warning:  fwrite() expects parameter 1 to be resource, boolean
Warning:  fclose() expects parameter 1 to be resource, boolean given in

find
 
$fn = ("backend/config.php");


above add


$bkup = ("backups/saveconfig.php");


find


chmod($fn, 0777);


add under

 if (file_exists($bkup)) {
 unlink("backups/saveconfig.php");
 unlink("backups/saveconfig_original.php");
  }  
just a small addition to chmod the file to 0777 to write  and then back to 0644 after the save

find

$ancien_config_lecture = fopen("backend/config.php", "r");


above add


  $fn = ("backend/config.php");
  chmod($fn, 0777);


find

fclose ($ancien_config_lecture);


after add

chmod($fn, 0644);


save and exit
stops the file permissions error when trying to write to a file thats 0664
sorry bud codes all good must have been a cache issue i readded the code from start to finish and now it shows up as should
and yes it was the array offset for torrenttable colums :rolleyes: took a leaf out of [USER=311]@MicroMonkey[/USER]  and changed


header("Refresh: 0; url=admincp.php?action=configuration");

to


autolink("admincp.php?action=configuration", "Reconfiguring. New Config Saved.");

?
sorted the error by changing


<td valign="top">Available columns:</td>
        <td>
        <?php $column = array('category', 'name', 'dl', 'uploader', 'comments', 'completed', 'size', 'seeders', 'leechers', 'health', 'ratio', 'external', 'wait', 'rating', 'added', 'nfo'); ?>
        <ul id="sortable-list">
          <?php for ($i = 0; $i < count($column); $i++): ?>
          <li class="sortme" title="<?php echo $column[$i]; ?>"><input type="checkbox" name="" value="" <?php echo ( in_array( $column[$i], explode(',', $site_config['torrenttable_columns']) ) ? 'checked="checked"' : null ); ?> /> <?php echo $column[$i]; ?></li>
          <?php endfor; ?>              
                  </li>
       
          <?php
           if($i%2 == 1)
          echo"</td><td>";
  ?>
            </ul>
 
        </td>
    </tr>

<table class="f-border" cellspacing="0" cellpadding="5"  align="center" width="100%">

    <tr class="f-title">
        <td colspan="2"><b>Column on expand table:</b><br /></td>
    </tr>

   <tr>
        <td>Expansion table:</td>
        <td>
            <?php $expand = array('size', 'speed', 'added', 'tracker', 'completed', 'comments', 'completed'); ?>
        <ul id="sortable-list">
          <?php for ($i = 0; $i < count($expand); $i++): ?>
          <li class="sortme" title="<?php echo $expand[$i]; ?>"><input type="checkbox" name="" value="" <?php echo ( in_array( $expand[$i], explode(',', $site_config['torrenttable_columns']) ) ? 'checked="checked"' : null ); ?> /> <?php echo $expand[$i]; ?></li>
          <?php endfor; ?>
                  </li>
          <?php
           if($i%2 == 1)
          echo"</td><td>";

           ?>
            </ul>

But now it's not adding it to the config on save ??
hey bud getting some illegal strings errors in torrenttable colums settings

[ATTACH]5124[/ATTACH]
Daily Login Bonus — 2019-07-27 12:57:28 in v3 Mods Completed
This will add 1 GB to users who login daily credits to (ERvD and Arcticwolf for the sys comment code)

ok first off lets add the SQL


CREATE TABLE IF NOT EXISTS `dailys` (

 `id` int(10) NOT NULL AUTO_INCREMENT,

 `userid` int(10) NOT NULL DEFAULT '0',

 `added` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',

 `expiry` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',

 PRIMARY KEY (`id`)

) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=11 ;


now the users SQL


ALTER TABLE `users` ADD `daily` enum('yes','no') NOT NULL DEFAULT 'no';
ALTER TABLE `users` ADD `syscomment` TEXT NOT NULL;


Now open up index.php and find


printf(T_("SHOUTBOX_REFRESH"), 5)."<br />";
   end_frame();
}


Add under


//RESET EVERY 24H DAILY BONUS

if ($CURUSER["daily"] == "yes")

{

$today = get_date_time();

$userid = $CURUSER["id"];

$dres = SQL_Query_exec("SELECT userid, expiry FROM dailys WHERE userid='$userid'");

$daily = mysqli_fetch_assoc($dres);

 if ($CURUSER["id"] == $daily["userid"] && $today >= $daily["expiry"])

 {

  $ddel = SQL_Query_exec("DELETE FROM dailys WHERE userid='$userid'");

  $dup = SQL_Query_exec("UPDATE users SET daily='no' WHERE id='$userid'");

 }

}



//ADD DAILY BONUS

if ($CURUSER['daily'] == "no")

{

$userid = $CURUSER["id"];

$expiry = (int)1;

//1 = 1 one day

$timenow = get_date_time();

$expiretime = get_date_time(gmtime() + (86400 * $expiry));

//86400 = 24H

$dadd = SQL_Query_exec("INSERT INTO dailys (userid, added, expiry) VALUES ('$userid','$timenow','$expiretime')");

$syscomment = $CURUSER["syscomment"];

$syscomment = gmdate("Y-m-d h:i:s A") . " - has been credited his/her daily 1Gb bonus by -System.n <br />". $syscomment;

$syscomment = sqlesc($syscomment);

$dadd = SQL_Query_exec("UPDATE users SET uploaded = uploaded+1073741824,syscomment=$syscomment WHERE id='$userid'");
//1073741824 = 1GB

$dadd = SQL_Query_exec("UPDATE users SET daily='yes' WHERE id='$userid'");

$msg = sqlesc("Your Next Daily Login Bonus Of 1 GB Will Be In: ".$expiretime."");

$added = sqlesc(get_date_time());

@SQL_Query_exec("INSERT INTO messages (sender, receiver, msg, added) VALUES(0, $userid, $msg, $added)");

} else
{ }


save and close

open up account-details.php find



$modcomment = htmlspecialchars($user["modcomment"]);


under add


$syscomment = htmlspecialchars($user["syscomment"]);


find


print("<tr><td>".T_("MOD_COMMENT").": </td><td align='left'><textarea cols='50' rows='10' name='modcomment'>$modcomment</textarea></td></tr>\n");


under add


print("<tr><td>".T_("SYS_COMMENT").": </td><td align='left'><textarea cols='50' rows='10' name='modcomment'>$syscomment</textarea></td></tr>\n");


open up languages/english.php and add


$LANG["SYS_COMMENT"] = "Sys Comment";
ok blackpearl that isnt you're torrent-details.php original becuase if it was you would not have got any stats at all since you did not have require_once udpscraper or parse.php in you're torrents details plus theres a chunk of code missing from the start of the udp scrapper ie,

print ("<td width='160' border='0' align='right' valign='top'><table><tr>");
       if ($scrape =='1')
       {
           $seeders1 = $leechers1 = $downloaded1 = NULL;
           print("<td class='table_col1' border'0' width='150' valign='middle'>
           <div style='margin-top:5px; border='0' margin-bottom:10px; font:bold 16px Times' align='center'><font color='#FF2000'>".T_("EXTERNAL_TORRENT")."</font></div>");


if you comment out the submit button its not going to add the updated stats to the database unless you refresh the page

 // print ("<td class='table_col1' width='150' valign='middle' align='center'>
            //   <div style='margin-top:5px; margin-bottom:10px; font:bold 16px Times' align='center'><font color='#FF2000'>".T_("EXTERNAL_TORRENT")."</font></div>
              // </div>
               //    <form action='torrents-details.php?id=$id&amp;scrape=1' method='post'>
                     //  <div style='margin-top:5px; margin-bottom:10px' align='center'><input type='submit' name='submit' value=".T_("UPDATE_STATS")." /></div>

my last post works as should if you install it correctly anyway this one works for me


<?php
require_once("backend/functions.php");
require_once("backend/BDecode.php");
require_once("backend/parse.php");
require_once("backend/udptscraper.php");
dbconn();

$torrent_dir = $site_config["torrent_dir"];  
$nfo_dir = $site_config["nfo_dir"];  

//check permissions
if ($site_config["MEMBERSONLY"]){
   loggedinonly();

   if($CURUSER["view_torrents"]=="no")
       show_error_msg(T_("ERROR"), T_("NO_TORRENT_VIEW"), 1);
}

//************ DO SOME "GET" STUFF BEFORE PAGE LAYOUT ***************

$id = (int) $_GET["id"];
$scrape = (int)$_GET["scrape"];
if (!is_valid_id($id))
   show_error_msg(T_("ERROR"), T_("THATS_NOT_A_VALID_ID"), 1);

//GET ALL MYSQL VALUES FOR THIS TORRENT
$res = SQL_Query_exec("SELECT torrents.anon, torrents.seeders, torrents.banned, torrents.leechers, torrents.info_hash, torrents.filename, torrents.nfo, torrents.last_action, torrents.numratings, torrents.name, torrents.owner, torrents.save_as, torrents.descr, torrents.visible, torrents.size, torrents.added, torrents.views, torrents.hits, torrents.times_completed, torrents.id, torrents.type, torrents.external, torrents.image1, torrents.image2, torrents.announce, torrents.numfiles, torrents.freeleech, IF(torrents.numratings < 2, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating, torrents.numratings, categories.name AS cat_name, torrentlang.name AS lang_name, torrentlang.image AS lang_image, categories.parent_cat as cat_parent, users.username, users.privacy FROM torrents LEFT JOIN categories ON torrents.category = categories.id LEFT JOIN torrentlang ON torrents.torrentlang = torrentlang.id LEFT JOIN users ON torrents.owner = users.id WHERE torrents.id = $id");
$row = mysqli_fetch_assoc($res);

//DECIDE IF TORRENT EXISTS
if (!$row || ($row["banned"] == "yes" && $CURUSER["edit_torrents"] == "no"))
   show_error_msg(T_("ERROR"), T_("TORRENT_NOT_FOUND"), 1);

//torrent is availiable so do some stuff

if ($_GET["hit"]) {
   SQL_Query_exec("UPDATE torrents SET views = views + 1 WHERE id = $id");
   header("Location: torrents-details.php?id=$id");
   die;
   }

   stdhead(T_("DETAILS_FOR_TORRENT")." \"" . $row["name"] . "\"");

   if ($CURUSER["id"] == $row["owner"] || $CURUSER["edit_torrents"] == "yes")
       $owned = 1;
   else
       $owned = 0;

//take rating
if ($_GET["takerating"] == 'yes'){
   $rating = (int)$_POST['rating'];

   if ($rating <= 0 || $rating > 5)
       show_error_msg(T_("RATING_ERROR"), T_("INVAILD_RATING"), 1);

   $res = SQL_Query_exec("INSERT INTO ratings (torrent, user, rating, added) VALUES ($id, " . $CURUSER["id"] . ", $rating, '".get_date_time()."')");

   if (!$res) {
       if (mysqli_errno($GLOBALS["DBconnector"]) == 1062)
           show_error_msg(T_("RATING_ERROR"), T_("YOU_ALREADY_RATED_TORRENT"), 1);
       else
           show_error_msg(T_("RATING_ERROR"), T_("A_UNKNOWN_ERROR_CONTACT_STAFF"), 1);
   }

   SQL_Query_exec("UPDATE torrents SET numratings = numratings + 1, ratingsum = ratingsum + $rating WHERE id = $id");
   show_error_msg(T_("RATING_SUCCESS"), T_("RATING_THANK")."<br /><br /><a href='torrents-details.php?id=$id'>" .T_("BACK_TO_TORRENT"). "</a>");
}

//take comment add
if ($_GET["takecomment"] == 'yes'){
   loggedinonly();
   $body = $_POST['body'];
 
   if (!$body)
       show_error_msg(T_("RATING_ERROR"), T_("YOU_DID_NOT_ENTER_ANYTHING"), 1);

   SQL_Query_exec("UPDATE torrents SET comments = comments + 1 WHERE id = $id");

   SQL_Query_exec("INSERT INTO comments (user, torrent, added, text) VALUES (".$CURUSER["id"].", ".$id.", '" .get_date_time(). "', " . sqlesc($body).")");

   if (mysqli_affected_rows($GLOBALS["DBconnector"]) == 1)
           show_error_msg(T_("COMPLETED"), T_("COMMENT_ADDED"), 0);
       else
           show_error_msg(T_("ERROR"), T_("UNABLE_TO_ADD_COMMENT"), 0);
}//end insert comment

//START OF PAGE LAYOUT HERE
$char1 = 50; //cut length
$shortname = CutName(htmlspecialchars($row["name"]), $char1);

begin_frame(T_("TORRENT_DETAILS_FOR"). " \"" . $shortname . "\"");

echo "<div align='right'>[<a href='report.php?torrent=$id'><b>" .T_("REPORT_TORRENT"). "</b></a>]&nbsp;";
if ($owned)
   echo "[<a href='torrents-edit.php?id=$row[id]&amp;returnto=" . urlencode($_SERVER["REQUEST_URI"]) . "'><b>".T_("EDIT_TORRENT")."</b></a>]";
echo "</div>";

echo "<center><h1>" . $shortname . "</h1></center>";

// Calculate local torrent speed test
if ($row["leechers"] >= 1 && $row["seeders"] >= 1 && $row["external"]!='yes'){
   $speedQ = SQL_Query_exec("SELECT (SUM(p.downloaded)) / (UNIX_TIMESTAMP('".get_date_time()."') - UNIX_TIMESTAMP(added)) AS totalspeed FROM torrents AS t LEFT JOIN peers AS p ON t.id = p.torrent WHERE p.seeder = 'no' AND p.torrent = '$id' GROUP BY t.id ORDER BY added ASC LIMIT 15");
   $a = mysqli_fetch_assoc($speedQ);
   $totalspeed = mksize($a["totalspeed"]) . "/s";
}else{
   $totalspeed = T_("NO_ACTIVITY");
}

//download box
echo "<center><table border='0' width='100%'><tr><td><div id='downloadbox'>";
if ($row["banned"] == "yes"){
   print ("<center><b>" .T_("DOWNLOAD"). ": </b>BANNED!</center>");
}else{
   print ("<table border='0' cellpadding='0' width='100%'><tr><td align='center' valign='middle' width='54'><a href=\"download.php?id=$id&amp;name=" . rawurlencode($row["filename"]) . "\"><img src=\"".$site_config["SITEURL"]."/images/download_torrent.png\" border=\"0\" alt='' /></a></td>");
   print ("<td valign='top'><a href=\"download.php?id=$id&amp;name=" . rawurlencode($row["filename"]) . "\">".T_("DOWNLOAD_TORRENT")."</a><br />");
   print ("<b>" .T_("HEALTH"). ": </b><img src='".$site_config["SITEURL"]."/images/health/health_".health($row["leechers"], $row["seeders"]).".gif' alt='' /><br />");
   print ("<b>" .T_("SEEDS"). ": </b><font color='green'>" . number_format($row["seeders"]) . "</font><br />");
   print ("<b>".T_("LEECHERS").": </b><font color='#ff0000'>" .  number_format($row["leechers"]) . "</font><br />");

   if ($row["external"]!='yes'){
       print ("<b>".T_("SPEED").": </b>" . $totalspeed . "<br />");
   }

   print ("<b>".T_("COMPLETED").":</b> " . number_format($row["times_completed"]) . "&nbsp;");

   if ($row["external"] != "yes" && $row["times_completed"] > 0) {
       echo("[<a href='torrents-completed.php?id=$id'>" .T_("WHOS_COMPLETED"). "</a>] ");
       if ($row["seeders"] <= 1) {
           echo("[<a href='torrents-reseed.php?id=$id'>" .T_("REQUEST_A_RE_SEED"). "</a>]");
       }
   }
   echo "<br />";

   if ($row["external"]!='yes' && $row["freeleech"]=='1'){
       print ("<b>".T_("FREE_LEECH").": </b><font color='#ff0000'>".T_("FREE_LEECH_MSG")."</font><br />");
   }

   print ("<b>".T_("LAST_CHECKED").": </b>" . date("d-m-Y H:i:s", utc_to_tz_time($row["last_action"])) . "<br /></td>");
  //===| Scrape External Torrents
   if ($row["external"]=='yes')
   {
       print ("<td width='160' border='0' align='right' valign='top'><table><tr>");
       if ($scrape =='1')
       {
           $seeders1 = $leechers1 = $downloaded1 = NULL;
           print("<td class='table_col1' border'0' width='150' valign='middle'>
           <div style='margin-top:5px; border='0' margin-bottom:10px; font:bold 16px Times' align='center'><font color='#FF2000'>".T_("EXTERNAL_TORRENT")."</font></div>");

    //===| UDP Scraper

$tress = SQL_Query_exec("SELECT * FROM `announce` WHERE `torrent` = $id");
if (mysqli_num_rows($tress) > 1){
$resu = SQL_Query_exec("SELECT url FROM announce WHERE torrent=$id");
}
else
{
$resu = SQL_Query_exec("SELECT id, info_hash FROM torrents WHERE external = 'yes' AND id = $id");
}
while ($rowu = mysqli_fetch_array($resu)){
if (mysqli_num_rows($tress) > 1){
$ann = $rowu["url"];
}else{
$TorrentInfo = ParseTorrent("$site_config[torrent_dir]/$rowu[id].torrent");
$ann = $TorrentInfo[0];
}
$annlist = array();
if ($TorrentInfo[6])
{
foreach ($TorrentInfo[6] as $ann)
{
$annlist[] = $ann[0];
}
}
else
$annlist = array($ann);
$seeders = $leechers = $downloaded = NULL;
foreach ($annlist as $ann)                  
{
$tracker = explode("/", $ann);
$path = array_pop($tracker);
$oldpath = $path;
$path = preg_replace("/^announce/", "scrape", $path);
$tracker = implode("/", $tracker)."/".$path;
if ($oldpath == $path){
continue;
}
}
if ($openbittorrent_done){
continue;
}
if (preg_match("/thepiratebay.org/i", $tracker) || preg_match("/tracker.tfile/", $tracker)){
$tracker = "udp://tracker.openbittorrent.com:80/scrape";
$openbittorrent_done = 1;
}
if(preg_match('/udp:\/\//', $tracker)){
$udp=true;
try
{
$timeout = 5;
$udp= new udptscraper($timeout);
$stats=$udp->scrape($tracker,$row["info_hash"]);
//print_r($stats); exit();
foreach ($stats as $idu=>$scrape)
{
$seeders1 += $scrape['seeders'];
$leechers1 += $scrape['leechers'];
$downloaded1 += $scrape['completed'];
}
}
catch(ScraperException $e)
{
$e->isConnectionError();
}
}
else
{
$stats = torrent_scrape_url($tracker, $row["info_hash"]);
}

if ($stats['seeds'] != -1)
{
$seeders += $stats['seeds'];
$leechers += $stats['peers'];
$downloaded += $stats['downloaded'];

 SQL_Query_exec("UPDATE `announce` SET `online` = 'yes', `seeders` = '" .$scrape['seeders']."', `leechers` = '" .$scrape['leechers']."', `times_completed` = '".$scrape['completed']."' WHERE `url` = ".sqlesc($ann)." AND `torrent` = $id");
       } else {
         SQL_Query_exec("UPDATE `announce` SET `online` = 'no' WHERE `url` = ".sqlesc($ann)." AND `torrent` = $id");

       }
     }

if ($seeders !== NULL)
{
SQL_Query_exec("UPDATE torrents SET leechers = '".$leechers1."', seeders = '".$seeders1."', times_completed = '".$downloaded1."', last_action = '".get_date_time()."', visible = 'yes' WHERE id = '".$row['id']."'");
}
else
{
SQL_Query_exec("UPDATE torrents SET last_action = '".get_date_time()."' WHERE id ='".$row['id']."'");
}

//===| End UDP Scraper

                 
           if ($seeders !== NULL)
           {
               print ("<div style='margin-bottom:5px; margin-left:20px'><b>".T_("LIVE_STATS")."</b>: </div>");
               print ("<div style='margin-left:20px'>".T_("SEEDERS").": <font color='limegreen'>".$seeders1."</font></div>");
               print ("<div style='margin-left:20px'>".T_("LEECHERS").": <font color='#FF2000'>".$leechers1."</font></div>");
               print ("<div style='margin-left:20px'>".T_("COMPLETED").": <font color='#0080FF'>".$downloaded1."</font></div>");
           }
           else
           {
               print ("<div style='margin-top:10px; margin-bottom:5px' align='center'><b>".T_("LIVE_STATS")."</b>: </div>");
               print ("<div style='font:italic 14px Times' align='center'><font color='#FF2000'>".T_("TRACKERS_OFFLINE")."!</font></div>");
           }
          print ("<div style='margin-top:10px; margin-bottom:10px' align='center'>
          <a href='torrents-details.php?id=".$id."'><input type='submit' name='submit' value=".T_("SUBMIT")."></a>
          </div>");
           print ("</td>");
       }
       else
       {
           print ("<td class='table_col1' width='150' valign='middle' align='center'>
               <div style='margin-top:5px; margin-bottom:10px; font:bold 16px Times' align='center'><font color='#FF2000'>".T_("EXTERNAL_TORRENT")."</font></div>
               </div>
                   <form action='torrents-details.php?id=$id&amp;scrape=1' method='post'>
                       <div style='margin-top:5px; margin-bottom:10px' align='center'><input type='submit' name='submit' value=".T_("UPDATE_STATS")." /></div>
                   </form>
               </td>");
       }
       print ("</tr></table></td>");
   }
   //===| End Scrape External Torrents
///END SCRAPE
   echo "</tr></table>";
}
echo "</div></td></tr></table></center><br /><br />";
//end download box


echo "<fieldset class='download'><legend><b>Details</b></legend>";
echo "<table cellpadding='3' border='0' width='100%'>";
print("<tr><td align='left'><b>".T_("NAME").":</b></td><td>" . $shortname . "</td></tr>\n");
print("<tr><td align='left' colspan='2'><b>" .T_("DESCRIPTION"). ":</b><br />" .  format_comment($row['descr']) . "</td></tr>\n");
print("<tr><td align='left'><b>" .T_("CATEGORY"). ":</b></td><td>" . $row["cat_parent"] . " > " . $row["cat_name"] . "</td></tr>\n");

if (empty($row["lang_name"])) $row["lang_name"] = "Unknown/NA";
print("<tr><td align='left'><b>" .T_("LANG"). ":</b></td><td>" . $row["lang_name"] . "\n");

if (isset($row["lang_image"]) && $row["lang_image"] != "")
           print("&nbsp;<img border=\"0\" src=\"" . $site_config['SITEURL'] . "/images/languages/" . $row["lang_image"] . "\" alt=\"" . $row["lang_name"] . "\" />");

print("</td></tr>");

print("<tr><td align='left'><b>" .T_("TOTAL_SIZE"). ":</b></td><td>" . mksize($row["size"]) . " </td></tr>\n");
print("<tr><td align='left'><b>" .T_("INFO_HASH"). ":</b></td><td>" . $row["info_hash"] . "</td></tr>\n");
print("");
if ($row["anon"] == "yes" && !$owned)
   print("<tr><td align='left'><b>" .T_("ADDED_BY"). ":</b></td><td>Anonymous</td></tr>");
elseif ($row["username"])
   print("<tr><td align='left'><b>" .T_("ADDED_BY"). ":</b></td><td><a href='account-details.php?id=" . $row["owner"] . "'>" . $row["username"] . "</a></td></tr>");
else
   print("<tr><td align='left'><b>" .T_("ADDED_BY"). ":</b></td><td>Unknown</td></tr>");

print("<tr><td align='left'><b>" .T_("DATE_ADDED"). ":</b></td><td>" . date("d-m-Y H:i:s", utc_to_tz_time($row["added"])) . "</td></tr>\n");
print("<tr><td align='left'><b>" .T_("VIEWS"). ":</b></td><td>" . number_format($row["views"]) . "</td></tr>\n");
print("<tr><td align='left'><b>".T_("HITS").":</b></td><td>" . number_format($row["hits"]) . "</td></tr>\n");
echo "</table></fieldset><br /><br />";

// $srating IS RATING VARIABLE
       $srating = "";
       $srating .= "<table class='f-border' cellspacing=\"1\" cellpadding=\"4\" width='100%'><tr><td class='f-title' width='60'><b>".T_("RATINGS").":</b></td><td class='f-title' valign='middle'>";
       if (!isset($row["rating"])) {
               $srating .= "Not Yet Rated";
       }else{
           $rpic = ratingpic($row["rating"]);
           if (!isset($rpic))
               $srating .= "invalid?";
           else
               $srating .= "$rpic (" . $row["rating"] . " ".T_("OUT_OF")." 5) " . $row["numratings"] . " ".T_("USERS_HAVE_RATED");
       }
       $srating .= "\n";
       if (!isset($CURUSER))
           $srating .= "(<a href=\"account-login.php?returnto=" . urlencode($_SERVER["REQUEST_URI"]) . "&amp;nowarn=1\">Log in</a> to rate it)";
       else {
           $ratings = array(
                   5 => T_("COOL"),
                   4 => T_("PRETTY_GOOD"),
                   3 => T_("DECENT"),
                   2 => T_("PRETTY_BAD"),
                   1 => T_("SUCKS")
           );
           //if (!$owned || $moderator) {
               $xres = SQL_Query_exec("SELECT rating, added FROM ratings WHERE torrent = $id AND user = " . $CURUSER["id"]);
               $xrow = mysqli_fetch_assoc($xres);
               if ($xrow)
                   $srating .= "<br /><i>(".T_("YOU_RATED")." \"" . $xrow["rating"] . " - " . $ratings[$xrow["rating"]] . "\")</i>";
               else {
                   $srating .= "<form style=\"display:inline;\" method=\"post\" action=\"torrents-details.php?id=$id&amp;takerating=yes\"><input type=\"hidden\" name=\"id\" value=\"$id\" />\n";
                   $srating .= "<select name=\"rating\">\n";
                   $srating .= "<option value=\"0\">(".T_("ADD_RATING").")</option>\n";
                   foreach ($ratings as $k => $v) {
                       $srating .= "<option value=\"$k\">$k - $v</option>\n";
                   }
                   $srating .= "</select>\n";
                   $srating .= "<input type=\"submit\" value=\"".T_("VOTE")."\" />";
                   $srating .= "</form>\n";
               }
           //}
       }
       $srating .= "</td></tr></table>";

print("<center>". $srating . "</center>");// rating

//END DEFINE RATING VARIABLE

echo "<br />";
                                               
if ($row["image1"] != "" OR $row["image2"] != "") {
 if ($row["image1"] != "")
   $img1 = "<img src='".$site_config["SITEURL"]."/uploads/images/$row[image1]' width='150' border='0' alt='' />";
 if ($row["image2"] != "")
   $img2 = "<img src='".$site_config["SITEURL"]."/uploads/images/$row[image2]' width='150' border='0' alt='' />";
 print("<center>". $img1 . "&nbsp;&nbsp;" . $img2."</center><br />");
}

if ($row["external"]=='yes'){
   print ("<br /><b>Tracker:</b><br /> ".htmlspecialchars($row['announce'])."<br />");
}

$tres = SQL_Query_exec("SELECT * FROM `announce` WHERE `torrent` = $id");
if (mysqli_num_rows($tres) > 1){
   echo "<br /><b>".T_("THIS_TORRENT_HAS_BACKUP_TRACKERS")."</b><br />";
   echo '<table cellpadding="1" cellspacing="2" class="table_table"><tr>';
   echo '<th class="table_head">URL</th><th class="table_head">'.T_("SEEDERS").'</th><th class="table_head">'.T_("LEECHERS").'</th><th class="table_head">'.T_("COMPLETED").'</th></tr>';
   $x = 1;
   while ($trow = mysqli_fetch_assoc($tres)) {
       $colour = $trow["online"] == "yes" ? "green" : "red";
       echo "<tr class=\"table_col$x\"><td><font color=\"$colour\"><b>".htmlspecialchars($trow['url'])."</b></font></td><td align=\"center\">".number_format($trow["seeders"])."</td><td align=\"center\">".number_format($trow["leechers"])."</td><td align=\"center\">".number_format($trow["times_completed"])."</td></tr>";
       $x = $x == 1 ? 2 : 1;
   }
   echo '</table>';
}

echo "<br /><br /><b>".T_("FILE_LIST").":</b>&nbsp;<img src='images/plus.gif' id='pic1' onclick='klappe_torrent(1)' alt='' /><div id='k1' style='display: none;'><table align='center' cellpadding='0' cellspacing='0' class='table_table' border='1' width='100%'><tr><th class='table_head' align='left'>&nbsp;".T_("FILE")."</th><th width='50' class='table_head'>&nbsp;".T_("SIZE")."</th></tr>";
$fres = SQL_Query_exec("SELECT * FROM `files` WHERE `torrent` = $id ORDER BY `path` ASC");
if (mysqli_num_rows($fres)) {
   while ($frow = mysqli_fetch_assoc($fres)) {
       echo "<tr><td class='table_col1'>".htmlspecialchars($frow['path'])."</td><td class='table_col2'>".mksize($frow['filesize'])."</td></tr>";
   }
}else{
   echo "<tr><td class='table_col1'>".htmlspecialchars($row["name"])."</td><td class='table_col2'>".mksize($row["size"])."</td></tr>";
}
echo "</table></div>";

if ($row["external"]!='yes'){
   echo "<br /><br /><b>".T_("PEERS_LIST").":</b><br />";
   $query = SQL_Query_exec("SELECT * FROM peers WHERE torrent = $id ORDER BY seeder DESC");

   $result = mysqli_num_rows($query);
       if($result == 0) {
           echo T_("NO_ACTIVE_PEERS")."\n";
       }else{
           ?>

           <table border="0" cellpadding="3" cellspacing="0" width="100%" class="table_table">
           <tr>
               <th class="table_head"><?php echo T_("PORT"); ?></th>
               <th class="table_head"><?php echo T_("UPLOADED"); ?></th>
               <th class="table_head"><?php echo T_("DOWNLOADED"); ?></th>
               <th class="table_head"><?php echo T_("RATIO"); ?></th>
               <th class="table_head"><?php echo T_("_LEFT_"); ?></th>
               <th class="table_head"><?php echo T_("FINISHED_SHORT"). "%"; ?></th>
               <th class="table_head"><?php echo T_("SEED"); ?></th>
               <th class="table_head"><?php echo T_("CONNECTED_SHORT"); ?></th>
               <th class="table_head"><?php echo T_("CLIENT"); ?></th>
               <th class="table_head"><?php echo T_("USER_SHORT"); ?></th>
           </tr>

           <?php
           while($row1 = mysqli_fetch_assoc($query))    {
             
               if ($row1["downloaded"] > 0){
                   $ratio = $row1["uploaded"] / $row1["downloaded"];
                   $ratio = number_format($ratio, 3);
               }else{
                   $ratio = "---";
               }

               $percentcomp = sprintf("%.2f", 100 * (1 - ($row1["to_go"] / $row["size"])));  

               if ($site_config["MEMBERSONLY"]) {
                   $res = SQL_Query_exec("SELECT id, username, privacy FROM users WHERE id=".$row1["userid"]."");
                   $arr = mysqli_fetch_array($res);
                 
                   $arr["username"] = "<a href='account-details.php?id=$arr[id]'>$arr[username]</a>";
               }
             
               # With $site_config["MEMBERSONLY"] off this will be shown.
               if ( !$arr["username"] ) $arr["username"] = "Unknown User";
     
               if ($arr["privacy"] != "strong" || ($CURUSER["control_panel"] == "yes")) {
                   print("<tr><td class='table_col2'>".$row1["port"]."</td><td class='table_col1'>".mksize($row1["uploaded"])."</td><td class='table_col2'>".mksize($row1["downloaded"])."</td><td class='table_col1'>".$ratio."</td><td class='table_col2'>".mksize($row1["to_go"])."</td><td class='table_col1'>".$percentcomp."%</td><td class='table_col2'>$row1[seeder]</td><td class='table_col1'>$row1[connectable]</td><td class='table_col2'>".htmlspecialchars($row1["client"])."</td><td class='table_col1'>$arr[username]</td></tr>");
               }else{
                   print("<tr><td class='table_col2'>".$row1["port"]."</td><td class='table_col1'>".mksize($row1["uploaded"])."</td><td class='table_col2'>".mksize($row1["downloaded"])."</td><td class='table_col1'>".$ratio."</td><td class='table_col2'>".mksize($row1["to_go"])."</td><td class='table_col1'>".$percentcomp."%</td><td class='table_col2'>$row1[seeder]</td><td class='table_col1'>$row1[connectable]</td><td class='table_col2'>".htmlspecialchars($row1["client"])."</td><td class='table_col1'>Private</td></tr>");
               }

           }
           echo "</table>";
   }
}

echo "<br /><br />";

//DISPLAY NFO BLOCK
function my_nfo_translate($nfo){
       $trans = array(
       "\x80" => "&#199;", "\x81" => "&#252;", "\x82" => "&#233;", "\x83" => "&#226;", "\x84" => "&#228;", "\x85" => "&#224;", "\x86" => "&#229;", "\x87" => "&#231;", "\x88" => "&#234;", "\x89" => "&#235;", "\x8a" => "&#232;", "\x8b" => "&#239;", "\x8c" => "&#238;", "\x8d" => "&#236;", "\x8e" => "&#196;", "\x8f" => "&#197;", "\x90" => "&#201;",
       "\x91" => "&#230;", "\x92" => "&#198;", "\x93" => "&#244;", "\x94" => "&#246;", "\x95" => "&#242;", "\x96" => "&#251;", "\x97" => "&#249;", "\x98" => "&#255;", "\x99" => "&#214;", "\x9a" => "&#220;", "\x9b" => "&#162;", "\x9c" => "&#163;", "\x9d" => "&#165;", "\x9e" => "&#8359;", "\x9f" => "&#402;", "\xa0" => "&#225;", "\xa1" => "&#237;",
       "\xa2" => "&#243;", "\xa3" => "&#250;", "\xa4" => "&#241;", "\xa5" => "&#209;", "\xa6" => "&#170;", "\xa7" => "&#186;", "\xa8" => "&#191;", "\xa9" => "&#8976;", "\xaa" => "&#172;", "\xab" => "&#189;", "\xac" => "&#188;", "\xad" => "&#161;", "\xae" => "&#171;", "\xaf" => "&#187;", "\xb0" => "&#9617;", "\xb1" => "&#9618;", "\xb2" => "&#9619;",
       "\xb3" => "&#9474;", "\xb4" => "&#9508;", "\xb5" => "&#9569;", "\xb6" => "&#9570;", "\xb7" => "&#9558;", "\xb8" => "&#9557;", "\xb9" => "&#9571;", "\xba" => "&#9553;", "\xbb" => "&#9559;", "\xbc" => "&#9565;", "\xbd" => "&#9564;", "\xbe" => "&#9563;", "\xbf" => "&#9488;", "\xc0" => "&#9492;", "\xc1" => "&#9524;", "\xc2" => "&#9516;", "\xc3" => "&#9500;",
       "\xc4" => "&#9472;", "\xc5" => "&#9532;", "\xc6" => "&#9566;", "\xc7" => "&#9567;", "\xc8" => "&#9562;", "\xc9" => "&#9556;", "\xca" => "&#9577;", "\xcb" => "&#9574;", "\xcc" => "&#9568;", "\xcd" => "&#9552;", "\xce" => "&#9580;", "\xcf" => "&#9575;", "\xd0" => "&#9576;", "\xd1" => "&#9572;", "\xd2" => "&#9573;", "\xd3" => "&#9561;", "\xd4" => "&#9560;",
       "\xd5" => "&#9554;", "\xd6" => "&#9555;", "\xd7" => "&#9579;", "\xd8" => "&#9578;", "\xd9" => "&#9496;", "\xda" => "&#9484;", "\xdb" => "&#9608;", "\xdc" => "&#9604;", "\xdd" => "&#9612;", "\xde" => "&#9616;", "\xdf" => "&#9600;", "\xe0" => "&#945;", "\xe1" => "&#223;", "\xe2" => "&#915;", "\xe3" => "&#960;", "\xe4" => "&#931;", "\xe5" => "&#963;",
       "\xe6" => "&#181;", "\xe7" => "&#964;", "\xe8" => "&#934;", "\xe9" => "&#920;", "\xea" => "&#937;", "\xeb" => "&#948;", "\xec" => "&#8734;", "\xed" => "&#966;", "\xee" => "&#949;", "\xef" => "&#8745;", "\xf0" => "&#8801;", "\xf1" => "&#177;", "\xf2" => "&#8805;", "\xf3" => "&#8804;", "\xf4" => "&#8992;", "\xf5" => "&#8993;", "\xf6" => "&#247;",
       "\xf7" => "&#8776;", "\xf8" => "&#176;", "\xf9" => "&#8729;", "\xfa" => "&#183;", "\xfb" => "&#8730;", "\xfc" => "&#8319;", "\xfd" => "&#178;", "\xfe" => "&#9632;", "\xff" => "&#160;",
       );
       $trans2 = array("\xe4" => "&auml;",        "\xF6" => "&ouml;",        "\xFC" => "&uuml;",        "\xC4" => "&Auml;",        "\xD6" => "&Ouml;",        "\xDC" => "&Uuml;",        "\xDF" => "&szlig;");
       $all_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
       $last_was_ascii = False;
       $tmp = "";
       $nfo = $nfo . "\00";
       for ($i = 0; $i < (strlen($nfo) - 1); $i++)
       {
               $char = $nfo[$i];
               if (isset($trans2[$char]) and ($last_was_ascii or strpos($all_chars, ($nfo[$i + 1]))))
               {
                       $tmp = $tmp . $trans2[$char];
                       $last_was_ascii = True;
               }
               else
               {
                       if (isset($trans[$char]))
                       {
                               $tmp = $tmp . $trans[$char];
                       }
                       else
                       {
                           $tmp = $tmp . $char;
                       }
                       $last_was_ascii = strpos($all_chars, $char);
               }
       }
       return $tmp;
}
//-----------------------------------------------

//DISPLAY NFO BLOCK
if($row["nfo"]== "yes"){
   $nfofilelocation = "$nfo_dir/$row[id].nfo";
   $filegetcontents = file_get_contents($nfofilelocation);
   $nfo = htmlspecialchars($filegetcontents);
       if ($nfo) {  
           $nfo = my_nfo_translate($nfo);
           echo "<br /><br /><b>NFO:</b><br />";
           print("<textarea class='nfo' style='width:98%;height:100%;' rows='20' cols='20' readonly='readonly'>".stripslashes($nfo)."</textarea>");
       }else{
           print(T_("ERROR")." reading .nfo file!");
       }
}
end_frame();

begin_frame(T_("COMMENTS"));
   //echo "<p align=center><a class=index href=torrents-comment.php?id=$id>" .T_("ADDCOMMENT"). "</a></p>\n";

   $subres = SQL_Query_exec("SELECT COUNT(*) FROM comments WHERE torrent = $id");
   $subrow = mysqli_fetch_array($subres);
   $commcount = $subrow[0];

   if ($commcount) {
       list($pagertop, $pagerbottom, $limit) = pager(10, $commcount, "torrents-details.php?id=$id&amp;");
       $commquery = "SELECT comments.id, text, user, comments.added, avatar, signature, username, title, class, uploaded, downloaded, privacy, donated FROM comments LEFT JOIN users ON comments.user = users.id WHERE torrent = $id ORDER BY comments.id $limit";
       $commres = SQL_Query_exec($commquery);
   }else{
       unset($commres);
   }

   if ($commcount) {
       print($pagertop);
       commenttable($commres, 'torrent');
       print($pagerbottom);
   }else {
       print("<br /><b>" .T_("NOCOMMENTS"). "</b><br />\n");
   }

   require_once("backend/bbcode.php");

   if ($CURUSER) {
       echo "<center>";
       echo "<form name=\"comment\" method=\"post\" action=\"torrents-details.php?id=$row[id]&amp;takecomment=yes\">";
       echo textbbcode("comment","body")."<br />";
       echo "<input type=\"submit\"  value=\"".T_("ADDCOMMENT")."\" />";
       echo "</form></center>";
   }

   end_frame();

stdfoot();
?>
Zip up you're torrents-details.php and post it I'll take a look when I get in
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 1
  • Members: 0
  • Guests online: 1
  • Comments: 3
  • Messages: 1,728