arcticbb

It is currently Thu May 31, 2007 12:01 pm

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Torrent Per Page and Sub Pages, T-Xore
PostPosted: Mon May 21, 2007 11:18 pm 
Offline
User

Joined: Sun May 20, 2007 8:50 pm
Posts: 5
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.png

Code 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> &raquo; <a href="cat.php?id='.$namerow[1].'">'.$namerow[0].'</a> &raquo; <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'])).'&amp;sort=1">Data</a></th>
             <th><a href="subcat.php?id='.strip_tags(trim($_GET['id'])).'&amp;sort=3">Nome</a></th>
             <th width="9%"><a href="subcat.php?id='.strip_tags(trim($_GET['id'])).'&amp;sort=4">Tamanho</a></th>
             <th width="4%"><a href="subcat.php?id='.strip_tags(trim($_GET['id'])).'&amp;sort=5">UL</a></th>
             <th width="4%"><a href="subcat.php?id='.strip_tags(trim($_GET['id'])).'&amp;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


Report this post
 
 Profile Email  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
arcticSilver1 template by phrostwave

powered by phpBB © 2002, 2006 phpBB Group
[ Time : 3.769s | 9 Queries | GZIP : On ]