View Single Post
  #8  
Old 27th July 2008, 22:43
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default Re: Internal server error
fix for torrents need seeding
Code:
<?php
/*
*-------------------------------phpMyBitTorrent--------------------------------*
*--- 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               -----------*
*------------------------------------------------------------------------------*
*/
if(eregi("torrents-needseed.php",$_SERVER["PHP_SELF"])) die("You can't access this file directly");


global $db_prefix;
$sql = ("SELECT id, name, downloaded, completed, seeders, leechers, added FROM ".$db_prefix."_torrents WHERE leechers > 0 AND seeders = 0 ORDER BY leechers DESC LIMIT 10");
$res = $db->sql_query($sql) or btsqlerror($sql);
if ($db->sql_numrows($res) > 0)
	{
OpenTable("TORRENTS THAT NEED SEEDING");
	print("<center><table  class=table_table border=2 cellspacing=0 cellpadding=0 >\n");
	print ("<CENTER>Please help them out, if you happen to have the files on your harddisk. Thank you!</CENTER>\n");
	print("<tr><td class=colhead>TORRENT</td><td class=colhead>LEECH</td><td class=colhead>SNATCHED</td><td class=colhead>COMPLETED</td><td class=colhead>DATE ADDED</td></tr>\n");
		while ($arr = $db->sql_fetchrow($res))
			{
			$torrname = htmlspecialchars($arr['name']);
				if (strlen($torrname) > 55)
				$torrname = substr($torrname, 0, 55) . "...";


			print("<tr><td class=table_col1  align=left><a href=\"details.php?id=".$arr['id']."&hit=1\" alt=\"".$arr['name']."\" 	title=\"".$arr['name']."\">".((strlen($arr['name']) <= 30) ? $arr['name']: substr($arr['name'],0,27)."...")."</td><td  class=table_col1><font color=red> ".number_format($arr['leechers'])." </td><td  class=table_col1>  ".$arr['downloaded']."  </td><td  class=table_col1>  ".$arr['completed']."  </td><td  class=table_col1>  ".$arr['added']."  </td></tr>\n");
			}
		print("</table></center>\n");


CloseTable();
}
else
{
OpenTable("TORRENTS THAT NEED SEEDING");
echo"

<center><h3>NO TORRENTS NEED SEEDED</h3></center></p>";
CloseTable();
}
?>
__________________
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