<?
require "include/bittorrent.php";
dbconn();
loggedinorreturn();
stdhead(testport);
//Letzen 8 torrents mit bild by binnett69 (Poster Version)//
begin_frame("Alle Torrent Bilder Hier mit Seeder und Leecher anzeige ","true","100%");

$query = "SELECT id, name,  poster, seeders, leechers, free FROM torrents WHERE visible='yes' ORDER BY added DESC LIMIT 1024"; 
$result = mysql_query($query); 
$num = mysql_num_rows($result); // count rows 
while ($row = mysql_fetch_assoc($result)){ 
$torrent_info["cat_name"] = $row["cat_name"]; 
$id = $row['id']; 
$arr20 = mysql_fetch_assoc(mysql_query("SELECT COUNT(*) AS cnt FROM users LEFT JOIN peers ON peers.userid = users.id WHERE torrent=$id AND seeder='yes' AND  webseed='yes'")); 
$seeds1 = $arr20["cnt"]; 
$arr21 = mysql_fetch_assoc(mysql_query("SELECT COUNT(*) AS cnt FROM users LEFT JOIN peers ON peers.userid = users.id WHERE torrent=$id AND seeder='yes' AND  adsl='yes'")); 
$seeds2 = $arr21["cnt"];
$poster = $row['poster']; 
if (strlen($row['name']) > 35) 
$name = substr($row['name'], 0, 32) . "..."; 
else 
$name = $row['name']; 
$seeder = $row['seeders']; 
$leecher = $row['leechers']; 
$uploader = $row['uploader'];
?>
<? if($CURUSER){ ?><a href="details.php?id=<?=$id?>" onMouseover="overlib('<b><font color=black><?=$name?></font></b> <br/><font color=green><?=$seeder?> Seeder</font> <br/><font color=red><?=$leecher?> Leecher</font> <br/><font color=yellow><? if($seeds1 != 0) { echo '[Webseed]';} ?></font> <br/><font color=orange><? if($seeds2 != 0) { echo '[ADSL2]';} ?></font> <br/><font color=blue><? if($row[free]=="yes") { echo '[Only Upload]';}?></font>','#CDCDCD')" onMouseout="nd()"><? } ?><img src="<? if($row['poster'] != ""){ echo "" . $poster. ""; } else { echo "default_cover.gif"; } ?>" width="75" height="100" alt="kein Poster" style="border: 0px solid black;"/></a>
<?
}

end_frame();
//Letzen 10 Torrents mit Bild Ende (Poster Version)//
?>