<?php
/*
// +--------------------------------------------------------------------------+
// | Only for   http://board.bt-technik.com/                                  
// | Weitergabe an andere Boards ist Untersagt nur für privaten gebrauch
// |				By djbrocken
// +--------------------------------------------------------------------------+

 */

require "include/bittorrent.php";
dbconn();
stdhead();

begin_table(TRUE);
?>
<?php
begin_frame("Neuster Torrent Detail",true,3);
?>


<?php
$result = mysql_query("SELECT id, name, poster, free, seeders, leechers, descr, filename, free FROM torrents WHERE visible='yes' ORDER BY added DESC LIMIT 1"); 
while ($row = mysql_fetch_assoc($result))
{ 
if($CURUSER){ 
$res31                    =mysql_query("SELECT id,name FROM torrents ORDER BY seeders DESC");
$row31                    =mysql_fetch_array($res31);
$qu1                      ="SELECT * FROM home";
$re1                      =mysql_query($qu1);
$ar1                      = mysql_fetch_array($re1);
$toid                     =$row31["id"];
$tona                     =$row31["name"];
$text                     =$ar1["text"];
}
if (strlen($row['descr']) > 400)
$descr = substr($row['descr'], 0, 400) . "...";
else
$descr = $row['descr'];
$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"]; 
$poster                   = $row['poster']; 
$seeder                   = $row['seeders']; 
$leecher                  = $row['leechers']; 
$filename                 = $row['filename'];
$free                     = $row['free'];
?>

<table width="100%" border="0" class="tablinks">
<tr>
<td width="96" height="180">
<table width="196" height="180" border="0">
<tr>
<td>
<img src="<? if($row['poster'] != ""){ echo "" . $poster. ""; } else { echo "default_cover.gif"; } ?>" width="186" height="100" alt="kein Poster" style="border: 0px solid black;"/>
</td>
</tr>
</table>
</td>
<td width="9">
</td>
<td valign="top">
<table width="400" border="0">
<tr>
<td><font color="green"><b><center> <?php echo $filename; ?> </center></font>
</td>
</tr>
 <br/>
<br/>                                     
<br/>                                        
<tr>
<td><font color="white"><center><?php echo $descr; ?></center></b></font>
</td>
</tr>
</table>
</td>
</tr>
</table>
<html>
<head>
<title>New Torrent Info</title>
<script language="JavaScript">
<!--
var max=0;
function textlist(){max=textlist.arguments.length;for (i=0; i<max; i++) this[i]=textlist.arguments[i];}
tl=new textlist
(
"Unser neuster Torrent ist <?php echo $filename; ?>",
"Dieser Torrent hat:",
" <?php echo $seeder; ?> Seeder und <?php echo $leecher; ?> Leecher",
" ",
"die meisten seeder bei <?php echo $tona; ?>");
var x=0; pos=0;var l=tl[0].length;
function textticker(){document.form1.textfeld.value=tl[x].substring(0,pos)+"_";if(pos++==l){pos=0;
setTimeout("textticker()",2000);
x++;if(x==max) x=0;l=tl[x].length;} 
else setTimeout("textticker()",50);}
// -->
</script>
</head>
<body onload="textticker()">
<div align="center">
<form name="form1">
<input type="text" size="100" name="textfeld" value=" Willkommen auf Army of Hell" style="color: #222222; background-color: #FFFF99; font-family: Verdana; font-size: 14px; border:0">
</form>
</div>
</body>
</html>
<?php
}

end_frame();

?>