nom ... sprawdź to... Prywatny track...
function torrenttable($res, $variant = "index") {
global $pic_base_url, $CURUSER;
$last_browse = $CURUSER['last_browse'];
$time_now = gmtime();
if ($last_browse > $time_now) {
$last_browse=$time_now;
}
?>
<table width=737 border="0" cellspacing="0" cellpadding="5">
<?
$count_get = 0;
foreach ($_GET as $get_name => $get_value) {
$get_name = mysql_escape_string(strip_tags(str_replace(array("\"","'"),array("",""),$get_name)));
$get_value = mysql_escape_string(strip_tags(str_replace(array("\"","'"),array("",""),$get_value)));
if ($get_name != "sort" && $get_name != "type") {
if ($count_get > 0) {
$oldlink = $oldlink . "&" . $get_name . "=" . $get_value;
} else {
$oldlink = $oldlink . $get_name . "=" . $get_value;
}
$count_get++;
}
}
if ($count_get > 0) {
$oldlink = $oldlink . "&";
}
if ($_GET['sort'] == "1") {
if ($_GET['type'] == "desc") {
$link1 = "asc";
} else {
$link1 = "desc";
}
}
if ($_GET['sort'] == "3") {
if ($_GET['type'] == "desc") {
$link3 = "asc";
} else {
$link3 = "desc";
}
}
if ($_GET['sort'] == "4") {
if ($_GET['type'] == "desc") {
$link4 = "asc";
} else {
$link4 = "desc";
}
}
if ($_GET['sort'] == "5") {
if ($_GET['type'] == "desc") {
$link5 = "asc";
} else {
$link5 = "desc";
}
}
if ($_GET['sort'] == "6") {
if ($_GET['type'] == "desc") {
$link6 = "asc";
} else {
$link6 = "desc";
}
}
if ($_GET['sort'] == "7") {
if ($_GET['type'] == "desc") {
$link7 = "asc";
} else {
$link7 = "desc";
}
}
if ($_GET['sort'] == "8") {
if ($_GET['type'] == "desc") {
$link8 = "asc";
} else {
$link8 = "desc";
}
}
if ($_GET['sort'] == "9") {
if ($_GET['type'] == "desc") {
$link9 = "asc";
} else {
$link9 = "desc";
}
}
if ($link1 == "") { $link1 = "asc"; } // Nazwa torrenta
if ($link3 == "") { $link3 = "desc"; }
if ($link4 == "") { $link4 = "desc"; }
if ($link5 == "") { $link5 = "desc"; }// Wielko?? torrenta
if ($link6 == "") { $link6 = "desc"; }// Liczba userów którzy pobrali torrenta
if ($link7 == "") { $link7 = "desc"; }// Userzy wysy?aj?cy torrenta
if ($link8 == "") { $link8 = "desc"; }// Userzy pobieraj?cy torrenta
if ($link9 == "") { $link9 = "desc"; }// User który wstawi? torrenta
?>
<tr>
<td class="colhead" align="center">Kat.</td>
<td class="colhead" align="left"><a href="browse.php?<? print $oldlink; ?>sort=1&type=<? print $link1; ?>">Nazwa[/url]</td>
<td class="colhead" align="center">DL</td>
<td class="colhead" align="center"><img src="/pic/files.gif" border="0" align="center"></td>
<td class="colhead" align="right"><a href="browse.php?<? print $oldlink; ?>sort=3&type=<? print $link3; ?>"><img src="/pic/comments.gif" border="0" align="center">[/url]</td>
<td class="colhead" align="center">Dodano</td>
<td class="colhead" align="center"><a href="browse.php?<? print $oldlink; ?>sort=5&type=<? print $link5; ?>">Rozmiar[/url]</td>
<td class="colhead" align="center"><a href="browse.php?<? print $oldlink; ?>sort=6&type=<? print $link6; ?>">Pobra?</td>
<td class="colhead" align="right"><a href="browse.php?<? print $oldlink; ?>sort=7&type=<? print $link7; ?>"><img src="/pic/up.gif" border="0" align="center">[/url]</td>
<td class="colhead" align="right"><a href="browse.php?<? print $oldlink; ?>sort=8&type=<? print $link8; ?>"><img src="/pic/down.gif" border="0" align="center">[/url]</td>
<td class="colhead" align="center"><a href="browse.php?<? print $oldlink; ?>sort=9&type=<? print $link9; ?>">Dodał/a[/url]</td>
</tr>
<?
while ($row = mysql_fetch_assoc($res)) {
$id = $row["id"];
print("<tr class=podswietl>\n");
print("<td class=border align=\"center\" style='padding: 0px'>");
if (isset($row["cat_name"])) {
print("<a href=\"browse.php?cat=" . $row["category"] . "\">");
if (isset($row["cat_pic"]) && $row["cat_pic"] != "")
print("<img border=\"0\" src=\"$pic_base_url" . $row["cat_pic"] . "\" alt=\"" . $row["cat_name"] . "\" />");
else
print($row["cat_name"]);
print("[/url]");
}
else
print("-");
print("</td>\n");
$uplreq = ($row["uplreq"]=="yes" ? "<img src='/pic/req.png' title='Torrent b?d?cy spe?nieniem czyjej? pro?by.' />" : "");
$double_lu = ($row["double_lu"]=="yes" ? "<font color=#4bbaf5>[x2]</font>" : "");
$nukee = ($row["nuke"]=="yes" ? "<img src='/pic/nuke.gif' title='Torrent ma b??dy.' />" : "");
$free = ($row["free"]=="yes" ? "<font color=#00ff00>[FL]</font>" : "");
$podbity = ($row['setnew']=="yes" ? "<img src='pic/podbity.gif' title='Podbity' />" : "");
$poster=$row["poster"];
$des = mysql_real_escape_string(format_comment($row["descrbal"]));
$des = ereg_replace('"',""",$des);
$dispname = htmlspecialchars($row["name"]);
if (!empty($row['genre'])) {
$genre = "(" . htmlspecialchars($row["genre"]) . ")";
}
else {
$genre = "";
}
print("<td class=border valign=top align=\"left\">");
if ($row["pl"] == "yes")
print ("<img src='pic/PL_OB.gif' title='Torrent polski ' /> ");
print ("<a href=\"details.php?");
print("id=$id");
// print("&hit=1");
if ($row['filename'])
if (sql_timestamp_to_unix_timestamp($row["added"]) >= $last_browse) {
print("\"onmouseover=\"return overlib('<table width=100%><tr><td><img src=$poster width=128 height=150></td><td>".CutName($des,460)."</td></tr></table>', WIDTH, 400, DELAY, 200);\" onmouseout=\"return nd();\">
$dispname[/url]$uplreq $nukee $double_lu $free $podbity <img src='pic/nowy.png' title='Torrent nowy (wstawiony od ostatniej wizyty).'/><>[br /]" . gmdate("d.m.Y - H:i",((strtotime($row["added"]))+(7200))) . " (" . get_elapsed_time(sql_timestamp_to_unix_timestamp($row["added"])) . " temu)\n");
}else{
print("\"onmouseover=\"return overlib('<table width=100%><tr><td><img src=$poster width=128 height=150></td><td>".CutName($des,460)."</td></tr></table>', WIDTH, 400, DELAY, 200);\" onmouseout=\"return nd();\">$dispname[/url]$uplreq $nukee $double_lu $free <>[br /]$genre\n");
}
$DL = '<a href="download.php/' . $id . '/' . $row['filename'] . '"><img src=pic/download.png border=0 alt=Download title="Szybkie pobieranie torrenta.">[/url]';
print("<td class=border align=center>$DL</td>\n");
print("<td class=border align=\"right\">" . $row["numfiles"] . "</td>\n");
if (!$row["comments"])
print("<td class=border align=\"right\">" . $row["comments"] . "</td>\n");
else {
if ($variant == "index")
print("<td class=border align=\"right\"><a href=\"details.php?id=$id&&tocomm=1\">" . $row["comments"] . "[/url]</td>\n");
else
print("<td class=border align=\"right\"><a href=\"details.php?id=$id&page=0#startcomments\">" . $row["comments"] . "[/url]</td>\n");
}
print("<td class=border align=\"center\"><nobr>" . str_replace(" ", "[br /]", $row["added"]) . "</nobr></td>\n");
$_s = "";
if ($row["times_completed"] != 1)
$_s = "y";
print("<td class=border align=center>" . str_replace(" ", "", mksize($row["size"])) . "</td><td class=border align=center><a href=viewsnatches.php?id=$row[id]>" . number_format($row["times_completed"]) . " raz$_s[/url]</td>\n");
if ($row["seeders"]) {
if ($variant == "index")
{
if ($row["leechers"]) $ratio = $row["seeders"] / $row["leechers"]; else $ratio = 1;
print("<td class=border align=right><a href=peery.php?id=$id><font color=" .
get_slr_color($ratio) . ">" . $row["seeders"] . "</font>[/url]</td>\n");
}
else
print("<td class=border align=\"right\"><a class=\"" . linkcolor($row["seeders"]) . "\" href=\"peery.php?id=$id\">" .
$row["seeders"] . "[/url]</td>\n");
}
else
print("<td class=border align=\"right\"><span class=\"" . linkcolor($row["seeders"]) . "\">" . $row["seeders"] . "</span></td>\n");
if ($row["leechers"]) {
if ($variant == "index")
print("<td class=border align=right><a href=peery.php?id=$id>" .
number_format($row["leechers"]) . ($peerlink ? "[/url]" : "") .
"</td>\n");
else
print("<td class=border align=\"right\"><a class=\"" . linkcolor($row["leechers"]) . "\" href=\"peery.php?id=$id\">" .
$row["leechers"] . "[/url]</td>\n");
}
else
print("<td class=border align=\"right\">0</td>\n");
$row22 = sql_query("SELECT anonymous FROM users WHERE id = " . $row['owner']);
$res22 = mysql_fetch_assoc($row22);
if($res22["anonymous"] == "yes" AND get_user_class() < UC_MODERATOR AND $CURUSER["id"] != $row["owner"]){
$row["owner"] = "";
$row["username"] = "Anonimowy";
}
else
$row["owner"] = "<a href=userdetails.php?id=" . $row["owner"] . ">";
print("<td class=border align=center>" . (isset($row["username"]) ? ("" . $row["owner"] . "" . htmlspecialchars($row["username"])
. "[/url]") : "unknown") . "</td>\n");
print("</tr>\n");
}
print("</table>\n");
return $rows;
}
function genrelist() {
$ret = array();
$res = mysql_query("SELECT id, name FROM categories ORDER BY name");
while ($row = mysql_fetch_array($res))
$ret[] = $row;
return $ret;
}