as to limit the number of torrents that it will
appear in a page and to create sub pages
http://img407.imageshack.us/img407/8195/post3139491179759354thuxp6.pngCode
im subcat.php
Code:
<?
require_once
"config.php";
connect ($dbhost, $dbuser, $dbpass,
$database);
$sort = tsort ($_GET['sort']);
$result =
mysql_query("SELECT * FROM torrents LEFT JOIN categories ON
torrents.subcat = categories.subid WHERE subid =
'".strip_tags(trim($_GET['id']))."' $sort") or die
(mysql_error());
$result_subcatname = mysql_query("SELECT
DISTINCT name,catid,subname,subid FROM categories WHERE
subid='".strip_tags(trim($_GET['id']))."'") or die
(mysql_error());
$count =
mysql_num_rows($result);
$namerow =
mysql_fetch_row($result_subcatname);
// Non htmlentities
are allowed in title (converted automaticly by function
stheader
('Sub categoria : '.$namerow[0].' > '.$namerow[2]);
if
($count == 0){
echo '<h1>No torrents where
found</h1>';
footer();
die;
}
echo '<div id="bread-navi"><a
href="index.php">Home</a> » <a
href="cat.php?id='.$namerow[1].'">'.$namerow[0].'</a>
» <a
href="subcat.php?id='.$namerow[3].'">'.$namerow[2].'</a></div>';
echo '<h1>'.$count.' torrents in
'.$namerow[2].'</h1>';
echo '<table
class="tor" width="100%" cellpadding="0" cellspacing="0"
border="0">
<tr>
<th width="15%"><a
href="subcat.php?id='.strip_tags(trim($_GET['id'])).'&sort=1">Data</a></th>
<th><a
href="subcat.php?id='.strip_tags(trim($_GET['id'])).'&sort=3">Nome</a></th>
<th width="9%"><a
href="subcat.php?id='.strip_tags(trim($_GET['id'])).'&sort=4">Tamanho</a></th>
<th width="4%"><a
href="subcat.php?id='.strip_tags(trim($_GET['id'])).'&sort=5">UL</a></th>
<th width="4%"><a
href="subcat.php?id='.strip_tags(trim($_GET['id'])).'&sort=6">DL</a></th>
<th
width="5%">Saúde</th>
</tr>';
while ($row =
mysql_fetch_array($result)){
extract($row);
echo '<tr>';
echo
'<td>'.substr($added,-0).'</td>';
// limitar
caracteres no nome do torrent
$sub = substr($torrentname,0,
65);
// colocar ... quando o arquivo possuir mais que
50 caracteres
$strlen_var = strlen($torrentname);
if
($strlen_var >= 65)
{
echo
'<td><a href="download.php?id='.$hash.'"><img
src="images/d.gif" title="Fazer download do torrent"
align="absmiddle"/></a> '.regicon($registration,$tracker).'
'.desc($description).'<a href="details.php?id='.$id.'"
title="'.$torrentname.'">'.$sub.'...</a></td>';
}
else
{
echo '<td><a
href="download.php?id='.$hash.'"><img src="images/d.gif"
title="Fazer download do torrent" align="absmiddle"/></a>
'.regicon($registration,$tracker).' '.desc($description).'<a
href="details.php?id='.$id.'">'.$sub.'</a></td>';
}
echo '<td
align="right">'.torsize($size).'</td>';
echo '<td
class="s">'.getpeer($seeds).'</td>';
echo '<td
class="p">'.getpeer($peers).'</td>';
echo '<td width="48" align="center"><img
src="images/h'.health($peers,
$seeds).'.png"></td>';
echo
'</tr>';
}
echo
'</table>';
footer();
?>
the code
admin/delete.php, does not need more to help me, because I will not
use plus this code.
But already this of sub pages I would
like much that helped me