function maketable($res, $mode = 'seeding') { global $lang_getusertorrentlistajax, $CURUSER, $smalldescription_main; switch ($mode) { case 'uploaded': $showsize = true; $showsenum = true; $showlenum = true; $showuploaded = true; $showdownloaded = false; $showratio = false; $showsetime = true; $showletime = false; $showcotime = false; $showanonymous = true; $columncount = 8; break; case 'seeding': $showsize = true; $showsenum = true; $showlenum = true; $showuploaded = true; $showdownloaded = true; $showratio = true; $showsetime = false; $showletime = false; $showcotime = false; $showanonymous = false; $columncount = 8; break; case 'leeching': $showsize = true; $showsenum = true; $showlenum = true; $showuploaded = true; $showdownloaded = true; $showratio = true; $showsetime = false; $showletime = false; $showcotime = false; $showanonymous = false; $columncount = 8; break; case 'completed': $showsize = false; $showsenum = false; $showlenum = false; $showuploaded = true; $showdownloaded = false; $showratio = false; $showsetime = true; $showletime = true; $showcotime = true; $showanonymous = false; $columncount = 8; break; case 'incomplete': $showsize = false; $showsenum = false; $showlenum = false; $showuploaded = true; $showdownloaded = true; $showratio = true; $showsetime = false; $showletime = true; $showcotime = false; $showanonymous = false; $columncount = 7; break; default: break; } $ret = "<table border=\"1\" cellspacing=\"0\" cellpadding=\"5\" width=\"800\"><tr><td class=\"colhead\" style=\"padding: 0px\">" . $lang_getusertorrentlistajax['col_type'] . "</td><td class=\"colhead\" align=\"center\">" . $lang_getusertorrentlistajax['col_name'] . "</td>" . ($showsize ? "<td class=\"colhead\" align=\"center\"><img class=\"size\" src=\"pic/trans.gif\" alt=\"size\" title=\"" . $lang_getusertorrentlistajax['title_size'] . "\" /></td>" : "") . ($showsenum ? "<td class=\"colhead\" align=\"center\"><img class=\"seeders\" src=\"pic/trans.gif\" alt=\"seeders\" title=\"" . $lang_getusertorrentlistajax['title_seeders'] . "\" /></td>" : "") . ($showlenum ? "<td class=\"colhead\" align=\"center\"><img class=\"leechers\" src=\"pic/trans.gif\" alt=\"leechers\" title=\"" . $lang_getusertorrentlistajax['title_leechers'] . "\" /></td>" : "") . ($showuploaded ? "<td class=\"colhead\" align=\"center\">" . $lang_getusertorrentlistajax['col_uploaded'] . "</td>" : "") . ($showdownloaded ? "<td class=\"colhead\" align=\"center\">" . $lang_getusertorrentlistajax['col_downloaded'] . "</td>" : "") . ($showratio ? "<td class=\"colhead\" align=\"center\">" . $lang_getusertorrentlistajax['col_ratio'] . "</td>" : "") . ($showsetime ? "<td class=\"colhead\" align=\"center\">" . $lang_getusertorrentlistajax['col_se_time'] . "</td>" : "") . ($showletime ? "<td class=\"colhead\" align=\"center\">" . $lang_getusertorrentlistajax['col_le_time'] . "</td>" : "") . ($showcotime ? "<td class=\"colhead\" align=\"center\">" . $lang_getusertorrentlistajax['col_time_completed'] . "</td>" : "") . ($showanonymous ? "<td class=\"colhead\" align=\"center\">" . $lang_getusertorrentlistajax['col_anonymous'] . "</td>" : "") . "</tr>\n"; while ($arr = mysql_fetch_assoc($res)) { $catimage = htmlspecialchars($arr["image"]); $catname = htmlspecialchars($arr["catname"]); $sphighlight = get_torrent_bg_color($arr['sp_state']); $sp_torrent = get_torrent_promotion_append($arr['sp_state']); //torrent name $dispname = $nametitle = htmlspecialchars($arr["torrentname"]); $count_dispname = mb_strlen($dispname, "UTF-8"); $max_lenght_of_torrent_name = $CURUSER['fontsize'] == 'large' ? 70 : 80; if ($count_dispname > $max_lenght_of_torrent_name) { $dispname = mb_substr($dispname, 0, $max_lenght_of_torrent_name, "UTF-8") . ".."; } if ($smalldescription_main == 'yes') { //small description $dissmall_descr = htmlspecialchars(trim($arr["small_descr"])); $count_dissmall_descr = mb_strlen($dissmall_descr, "UTF-8"); $max_lenght_of_small_descr = 80; // maximum length if ($count_dissmall_descr > $max_lenght_of_small_descr) { $dissmall_descr = mb_substr($dissmall_descr, 0, $max_lenght_of_small_descr, "UTF-8") . ".."; } } else { $dissmall_descr == ""; } $ret .= "<tr" . $sphighlight . "><td class=\"rowfollow nowrap\" valign=\"middle\" style='padding: 0px'>" . return_category_image($arr['category'], "torrents.php?allsec=1&") . "</td>\n" . "<td class=\"rowfollow\" width=\"100%\" align=\"left\"><a href=\"" . htmlspecialchars("details.php?id=" . $arr[torrent] . "&hit=1") . "\" title=\"" . $nametitle . "\"><b>" . $dispname . "</b></a>" . $sp_torrent . ($dissmall_descr == "" ? "" : "<br />" . $dissmall_descr) . "</td>"; //size if ($showsize) { $ret .= "<td class=\"rowfollow\" align=\"center\">" . mksize_compact($arr['size']) . "</td>"; } //number of seeders if ($showsenum) { $ret .= "<td class=\"rowfollow\" align=\"center\">" . $arr['seeders'] . "</td>"; } //number of leechers if ($showlenum) { $ret .= "<td class=\"rowfollow\" align=\"center\">" . $arr['leechers'] . "</td>"; } //uploaded amount if ($showuploaded) { $uploaded = mksize_compact($arr["uploaded"]); $ret .= "<td class=\"rowfollow\" align=\"center\">" . $uploaded . "</td>"; } //downloaded amount if ($showdownloaded) { $downloaded = mksize_compact($arr["downloaded"]); $ret .= "<td class=\"rowfollow\" align=\"center\">" . $downloaded . "</td>"; } //ratio if ($showratio) { if ($arr['downloaded'] > 0) { $ratio = number_format($arr['uploaded'] / $arr['downloaded'], 3); $ratio = "<font color=\"" . get_ratio_color($ratio) . "\">" . $ratio . "</font>"; } elseif ($arr['uploaded'] > 0) { $ratio = "Inf."; } else { $ratio = "---"; } $ret .= "<td class=\"rowfollow\" align=\"center\">" . $ratio . "</td>"; } if ($showsetime) { $ret .= "<td class=\"rowfollow\" align=\"center\">" . mkprettytime($arr['seedtime']) . "</td>"; } if ($showletime) { $ret .= "<td class=\"rowfollow\" align=\"center\">" . mkprettytime($arr['leechtime']) . "</td>"; } if ($showcotime) { $ret .= "<td class=\"rowfollow\" align=\"center\">" . "" . str_replace(" ", "<br />", gettime($arr['completedat'], false)) . "</td>"; } if ($showanonymous) { $ret .= "<td class=\"rowfollow\" align=\"center\">" . $arr['anonymous'] . "</td>"; } $ret .= "</tr>\n"; } $ret .= "</table>\n"; return $ret; }
form("tracker"); if ($type == 'saved') { print "<tr><td colspan=2 class=\"heading\" valign=\"top\" align=\"center\"><font color=red>" . $lang_usercp['text_saved'] . "</font></td></tr>\n"; } if ($emailnotify_smtp == 'yes' && $smtptype != 'none') { tr_small($lang_usercp['row_email_notification'], "<input type=checkbox name=pmnotif" . (strpos($CURUSER['notifs'], "[pm]") !== false ? " checked" : "") . " value=yes> " . $lang_usercp['checkbox_notification_received_pm'] . "<br />\n<input type=checkbox name=emailnotif" . (strpos($CURUSER['notifs'], "[email]") !== false ? " checked" : "") . " value=\"yes\" /> " . $lang_usercp['checkbox_notification_default_categories'], 1); } $categories = "<table>" . ($allowspecial ? "<tr><td class=embedded align=left><font class=big>" . $lang_usercp['text_at_browse_page'] . "</font></td></tr></table><table>" : "") . "<tr><td class=embedded align=left><b>" . ($brenablecatrow == true ? $brcatrow[0] : $lang_usercp['text_category']) . "</b></td></tr><tr>"; $i = 0; foreach ($brcats as $cat) { $numinrow = $i % $catsperrow; $rownum = (int) ($i / $catsperrow); if ($i && $numinrow == 0) { $categories .= "</tr>" . ($brenablecatrow ? "<tr><td class=embedded align=left><b>" . $brcatrow[$rownum] . "</b></td></tr>" : "") . "<tr>"; } $categories .= "<td align=left class=bottom style=\"padding-bottom: 4px;padding-left: " . $catpadding . "px\"><input class=checkbox name=cat" . $cat[id] . " type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[cat" . $cat[id] . "]") !== false ? " checked" : "") . " value='yes'>" . return_category_image($cat['id'], "torrents.php?allsec=1&") . "</td>\n"; $i++; } $categories .= "</tr>"; if ($allowspecial) { $categories .= "</table><table><tr><td class=embedded align=left><font class=big>" . $lang_usercp['text_at_special_page'] . "</font></td></tr></table><table>"; $categories .= "<tr><td class=embedded align=left><b>" . ($spenablecatrow == true ? $spcatrow[0] : $lang_usercp['text_category']) . "</b></td></tr><tr>"; $i = 0; foreach ($spcats as $cat) { $numinrow = $i % $catsperrow; $rownum = (int) ($i / $catsperrow); if ($i && $numinrow == 0) { $categories .= "</tr>" . ($spenablecatrow ? "<tr><td class=embedded align=left><b>" . $spcatrow[$rownum] . "</b></td></tr>" : "") . "<tr>"; } $categories .= "<td align=left class=bottom style=\"padding-bottom: 4px;padding-left: " . $catpadding . "px\"><input class=checkbox name=cat" . $cat[id] . " type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[cat" . $cat[id] . "]") !== false ? " checked" : "") . " value='yes'><img src=pic/" . get_cat_folder($cat['id']) . htmlspecialchars($cat[image]) . " border='0' alt=\"" . $cat[name] . "\" title=\"" . $cat[name] . "\"></td>\n"; $i++;
} else { $pvote = "<b><a href=\"?id=" . $arr[id] . "&offer_vote=1\">" . $arr[against] . "</a></b>"; } if ($arr["yeah"] == 0 && $arr["against"] == 0) { $v_res = "0"; } else { $v_res = "<b><a href=\"?id=" . $arr[id] . "&offer_vote=1\" title=\"" . $lang_offers['title_show_vote_details'] . "\"><font color=\"green\">" . $arr[yeah] . "</font> - <font color=\"red\">" . $arr[against] . "</font> = " . ($arr[yeah] - $arr[against]) . "</a></b>"; } $addtime = gettime($arr['added'], false, true); $dispname = $arr[name]; $count_dispname = mb_strlen($arr[name], "UTF-8"); $max_length_of_offer_name = 70; if ($count_dispname > $max_length_of_offer_name) { $dispname = mb_substr($dispname, 0, $max_length_of_offer_name - 2, "UTF-8") . ".."; } print "<tr><td class=\"rowfollow\" style=\"padding: 0px\"><a href=\"?category=" . $arr['cat_id'] . "\">" . return_category_image($arr['cat_id'], "") . "</a></td><td style='text-align: left'><a href=\"?id=" . $arr[id] . "&off_details=1\" title=\"" . htmlspecialchars($arr[name]) . "\"><b>" . htmlspecialchars($dispname) . "</b></a>" . ($CURUSER['appendnew'] != 'no' && strtotime($arr["added"]) >= $last_offer ? "<b> (<font class='new'>" . $lang_offers['text_new'] . "</font>)</b>" : "") . $allowed . "</td><td class=\"rowfollow nowrap\" style='padding: 5px' align=\"center\">" . $v_res . "</td><td class=\"rowfollow nowrap\" " . (get_user_class() < $againstoffer_class ? " colspan=\"2\" " : "") . " style='padding: 5px'><a href=\"?id=" . $arr[id] . "&vote=yeah\" title=\"" . $lang_offers['title_i_want_this'] . "\"><font color=\"green\"><b>" . $lang_offers['text_yep'] . "</b></font></a></td>" . (get_user_class() >= $againstoffer_class ? "<td class=\"rowfollow nowrap\" align=\"center\"><a href=\"?id=" . $arr[id] . "&vote=against\" title=\"" . $lang_offers['title_do_not_want_it'] . "\"><font color=\"red\"><b>" . $lang_offers['text_nah'] . "</b></font></a></td>" : ""); print "<td class=\"rowfollow\">" . $comment . "</td><td class=\"rowfollow nowrap\">" . $addtime . "</td>"; if ($offervotetimeout_main > 0 && $offeruptimeout_main > 0) { if ($arr["allowed"] == 'allowed') { $futuretime = strtotime($arr['allowedtime']) + $offeruptimeout_main; $timeout = gettime(date("Y-m-d H:i:s", $futuretime), false, true, true, false, true); } elseif ($arr["allowed"] == 'pending') { $futuretime = strtotime($arr['added']) + $offervotetimeout_main; $timeout = gettime(date("Y-m-d H:i:s", $futuretime), false, true, true, false, true); } if (!$timeout) { $timeout = "N/A"; } print "<td class=\"rowfollow nowrap\">" . $timeout . "</td>"; } print "<td class=\"rowfollow\">" . $addedby . "</td>" . (get_user_class() >= $offermanage_class ? "<td class=\"rowfollow\"><a href=\"?id=" . $arr[id] . "&del_offer=1\"><img class=\"staff_delete\" src=\"pic/trans.gif\" alt=\"D\" title=\"" . $lang_offers['title_delete'] . "\" /></a><br /><a href=\"?id=" . $arr[id] . "&edit_offer=1\"><img class=\"staff_edit\" src=\"pic/trans.gif\" alt=\"E\" title=\"" . $lang_offers['title_edit'] . "\" /></a></td>" : "") . "</tr>";
function torrenttable($res, $variant = "torrent") { global $Cache; global $lang_functions; global $CURUSER, $waitsystem; global $showextinfo; global $torrentmanage_class, $smalldescription_main, $enabletooltip_tweak; global $CURLANGDIR; if ($variant == "torrent") { $last_browse = $CURUSER['last_browse']; $sectiontype = $browsecatmode; } elseif ($variant == "music") { $last_browse = $CURUSER['last_music']; $sectiontype = $specialcatmode; } else { $last_browse = $CURUSER['last_browse']; $sectiontype = ""; } $time_now = TIMENOW; if ($last_browse > $time_now) { $last_browse = $time_now; } if (get_user_class() < UC_VIP && $waitsystem == "yes") { $ratio = get_ratio($CURUSER["id"], false); $gigs = $CURUSER["uploaded"] / (1024 * 1024 * 1024); if ($gigs > 10) { if ($ratio < 0.4) { $wait = 24; } elseif ($ratio < 0.5) { $wait = 12; } elseif ($ratio < 0.6) { $wait = 6; } elseif ($ratio < 0.8) { $wait = 3; } else { $wait = 0; } } else { $wait = 0; } } ?> <table class="torrents" cellspacing="0" cellpadding="5" width="100%"> <tr> <?php $count_get = 0; $oldlink = ""; foreach ($_GET as $get_name => $get_value) { $get_name = mysql_real_escape_string(strip_tags(str_replace(array("\"", "'"), array("", ""), $get_name))); $get_value = mysql_real_escape_string(strip_tags(str_replace(array("\"", "'"), array("", ""), $get_value))); if ($get_name != "sort" && $get_name != "type") { if ($count_get > 0) { $oldlink .= "&" . $get_name . "=" . $get_value; } else { $oldlink .= $get_name . "=" . $get_value; } $count_get++; } } if ($count_get > 0) { $oldlink = $oldlink . "&"; } $sort = $_GET['sort']; $link = array(); for ($i = 1; $i <= 9; $i++) { if ($sort == $i) { $link[$i] = $_GET['type'] == "desc" ? "asc" : "desc"; } else { $link[$i] = $i == 1 ? "asc" : "desc"; } } ?> <td class="colhead" style="padding: 0px"><?php echo $lang_functions['col_type']; ?> </td> <td class="colhead"><a href="?<?php echo $oldlink; ?> sort=1&type=<?php echo $link[1]; ?> "><?php echo $lang_functions['col_name']; ?> </a></td> <?php if ($wait) { print "<td class=\"colhead\">" . $lang_functions['col_wait'] . "</td>\n"; } if ($CURUSER['showcomnum'] != 'no') { ?> <td class="colhead"><a href="?<?php echo $oldlink; ?> sort=3&type=<?php echo $link[3]; ?> "><img class="comments" src="pic/trans.gif" alt="comments" title="<?php echo $lang_functions['title_number_of_comments']; ?> " /></a></td> <?php } ?> <td class="colhead"><a href="?<?php echo $oldlink; ?> sort=4&type=<?php echo $link[4]; ?> "><img class="time" src="pic/trans.gif" alt="time" title="<?php echo $CURUSER['timetype'] != 'timealive' ? $lang_functions['title_time_added'] : $lang_functions['title_time_alive']; ?> " /></a></td> <td class="colhead"><a href="?<?php echo $oldlink; ?> sort=5&type=<?php echo $link[5]; ?> "><img class="size" src="pic/trans.gif" alt="size" title="<?php echo $lang_functions['title_size']; ?> " /></a></td> <td class="colhead"><a href="?<?php echo $oldlink; ?> sort=7&type=<?php echo $link[7]; ?> "><img class="seeders" src="pic/trans.gif" alt="seeders" title="<?php echo $lang_functions['title_number_of_seeders']; ?> " /></a></td> <td class="colhead"><a href="?<?php echo $oldlink; ?> sort=8&type=<?php echo $link[8]; ?> "><img class="leechers" src="pic/trans.gif" alt="leechers" title="<?php echo $lang_functions['title_number_of_leechers']; ?> " /></a></td> <td class="colhead"><a href="?<?php echo $oldlink; ?> sort=6&type=<?php echo $link[6]; ?> "><img class="snatched" src="pic/trans.gif" alt="snatched" title="<?php echo $lang_functions['title_number_of_snatched']; ?> " /></a></td> <td class="colhead"><a href="?<?php echo $oldlink; ?> sort=9&type=<?php echo $link[9]; ?> "><?php echo $lang_functions['col_uploader']; ?> </a></td> <?php if (get_user_class() >= $torrentmanage_class) { ?> <td class="colhead"><?php echo $lang_functions['col_action']; ?> </td> <?php } ?> </tr> <?php $caticonrow = get_category_icon_row($CURUSER['caticon']); if ($caticonrow['secondicon'] == 'yes') { $has_secondicon = true; } else { $has_secondicon = false; } $counter = 0; if ($smalldescription_main == 'no' || $CURUSER['showsmalldescr'] == 'no') { $displaysmalldescr = false; } else { $displaysmalldescr = true; } while ($row = mysql_fetch_assoc($res)) { $id = $row["id"]; $sphighlight = get_torrent_bg_color($row['sp_state']); print "<tr" . $sphighlight . ">\n"; print "<td class=\"rowfollow nowrap\" valign=\"middle\" style='padding: 0px'>"; if (isset($row["category"])) { print return_category_image($row["category"], "?"); if ($has_secondicon) { print get_second_icon($row, "pic/" . $catimgurl . "additional/"); } } else { print "-"; } print "</td>\n"; //torrent name $dispname = trim($row["name"]); $short_torrent_name_alt = ""; $mouseovertorrent = ""; $tooltipblock = ""; $has_tooltip = false; if ($enabletooltip_tweak == 'yes') { $tooltiptype = $CURUSER['tooltip']; } else { $tooltiptype = 'off'; } switch ($tooltiptype) { case 'minorimdb': if ($showextinfo['imdb'] == 'yes' && $row["url"]) { $url = $row['url']; $cache = $row['cache_stamp']; $type = 'minor'; $has_tooltip = true; } break; case 'medianimdb': if ($showextinfo['imdb'] == 'yes' && $row["url"]) { $url = $row['url']; $cache = $row['cache_stamp']; $type = 'median'; $has_tooltip = true; } break; case 'off': break; } if (!$has_tooltip) { $short_torrent_name_alt = "title=\"" . htmlspecialchars($dispname) . "\""; } else { $torrent_tooltip[$counter]['id'] = "torrent_" . $counter; $torrent_tooltip[$counter]['content'] = ""; $mouseovertorrent = "onmouseover=\"get_ext_info_ajax('" . $torrent_tooltip[$counter]['id'] . "','" . $url . "','" . $cache . "','" . $type . "'); domTT_activate(this, event, 'content', document.getElementById('" . $torrent_tooltip[$counter]['id'] . "'), 'trail', false, 'delay',600,'lifetime',6000,'fade','both','styleClass','niceTitle', 'fadeMax',87, 'maxWidth', 500);\""; } $count_dispname = mb_strlen($dispname, "UTF-8"); if (!$displaysmalldescr || $row["small_descr"] == "") { // maximum length of torrent name $max_length_of_torrent_name = 120; } elseif ($CURUSER['fontsize'] == 'large') { $max_length_of_torrent_name = 60; } elseif ($CURUSER['fontsize'] == 'small') { $max_length_of_torrent_name = 80; } else { $max_length_of_torrent_name = 70; } if ($count_dispname > $max_length_of_torrent_name) { $dispname = mb_substr($dispname, 0, $max_length_of_torrent_name - 2, "UTF-8") . ".."; } if ($row['pos_state'] == 'sticky' && $CURUSER['appendsticky'] == 'yes') { $stickyicon = "<img class=\"sticky\" src=\"pic/trans.gif\" alt=\"Sticky\" title=\"" . $lang_functions['title_sticky'] . "\" /> "; } else { $stickyicon = ""; } print "<td class=\"rowfollow\" width=\"100%\" align=\"left\"><table class=\"torrentname\" width=\"100%\"><tr" . $sphighlight . "><td class=\"embedded\">" . $stickyicon . "<a {$short_torrent_name_alt} {$mouseovertorrent} href=\"details.php?id=" . $id . "&hit=1\"><b>" . htmlspecialchars($dispname) . "</b></a>"; $sp_torrent = get_torrent_promotion_append($row['sp_state'], "", true, $row["added"], $row['promotion_time_type'], $row['promotion_until']); $picked_torrent = ""; if ($CURUSER['appendpicked'] != 'no') { if ($row['picktype'] == "hot") { $picked_torrent = " <b>[<font class='hot'>" . $lang_functions['text_hot'] . "</font>]</b>"; } elseif ($row['picktype'] == "classic") { $picked_torrent = " <b>[<font class='classic'>" . $lang_functions['text_classic'] . "</font>]</b>"; } elseif ($row['picktype'] == "recommended") { $picked_torrent = " <b>[<font class='recommended'>" . $lang_functions['text_recommended'] . "</font>]</b>"; } } if ($CURUSER['appendnew'] != 'no' && strtotime($row["added"]) >= $last_browse) { print "<b> (<font class='new'>" . $lang_functions['text_new_uppercase'] . "</font>)</b>"; } $banned_torrent = $row["banned"] == 'yes' ? " <b>(<font class=\"striking\">" . $lang_functions['text_banned'] . "</font>)</b>" : ""; print $banned_torrent . $picked_torrent . $sp_torrent; if ($displaysmalldescr) { //small descr $dissmall_descr = trim($row["small_descr"]); $count_dissmall_descr = mb_strlen($dissmall_descr, "UTF-8"); $max_lenght_of_small_descr = $max_length_of_torrent_name; // maximum length if ($count_dissmall_descr > $max_lenght_of_small_descr) { $dissmall_descr = mb_substr($dissmall_descr, 0, $max_lenght_of_small_descr - 2, "UTF-8") . ".."; } print $dissmall_descr == "" ? "" : "<br />" . htmlspecialchars($dissmall_descr); } print "</td>"; $act = ""; if ($CURUSER["dlicon"] != 'no' && $CURUSER["downloadpos"] != "no") { $act .= "<a href=\"download.php?id=" . $id . "\"><img class=\"download\" src=\"pic/trans.gif\" style='padding-bottom: 2px;' alt=\"download\" title=\"" . $lang_functions['title_download_torrent'] . "\" /></a>"; } if ($CURUSER["bmicon"] == 'yes') { $bookmark = " href=\"javascript: bookmark(" . $id . "," . $counter . ");\""; $act .= ($act ? "<br />" : "") . "<a id=\"bookmark" . $counter . "\" " . $bookmark . " >" . get_torrent_bookmark_state($CURUSER['id'], $id) . "</a>"; } print "<td width=\"20\" class=\"embedded\" style=\"text-align: right; \" valign=\"middle\">" . $act . "</td>\n"; print "</tr></table></td>"; if ($wait) { $elapsed = floor((TIMENOW - strtotime($row["added"])) / 3600); if ($elapsed < $wait) { $color = dechex(floor(127 * ($wait - $elapsed) / 48 + 128) * 65536); print "<td class=\"rowfollow nowrap\"><a href=\"faq.php#id46\"><font color=\"" . $color . "\">" . number_format($wait - $elapsed) . $lang_functions['text_h'] . "</font></a></td>\n"; } else { print "<td class=\"rowfollow nowrap\">" . $lang_functions['text_none'] . "</td>\n"; } } if ($CURUSER['showcomnum'] != 'no') { print "<td class=\"rowfollow\">"; $nl = ""; //comments $nl = "<br />"; if (!$row["comments"]) { print "<a href=\"comment.php?action=add&pid=" . $id . "&type=torrent\" title=\"" . $lang_functions['title_add_comments'] . "\">" . $row["comments"] . "</a>"; } else { if ($enabletooltip_tweak == 'yes' && $CURUSER['showlastcom'] != 'no') { if (!($lastcom = $Cache->get_value('torrent_' . $id . '_last_comment_content'))) { $res2 = sql_query("SELECT user, added, text FROM comments WHERE torrent = {$id} ORDER BY id DESC LIMIT 1"); $lastcom = mysql_fetch_array($res2); $Cache->cache_value('torrent_' . $id . '_last_comment_content', $lastcom, 1855); } $timestamp = strtotime($lastcom["added"]); $hasnewcom = $lastcom['user'] != $CURUSER['id'] && $timestamp >= $last_browse; if ($lastcom) { if ($CURUSER['timetype'] != 'timealive') { $lastcomtime = $lang_functions['text_at_time'] . $lastcom['added']; } else { $lastcomtime = $lang_functions['text_blank'] . gettime($lastcom["added"], true, false, true); } $lastcom_tooltip[$counter]['id'] = "lastcom_" . $counter; $lastcom_tooltip[$counter]['content'] = ($hasnewcom ? "<b>(<font class='new'>" . $lang_functions['text_new_uppercase'] . "</font>)</b> " : "") . $lang_functions['text_last_commented_by'] . get_username($lastcom['user']) . $lastcomtime . "<br />" . format_comment(mb_substr($lastcom['text'], 0, 100, "UTF-8") . (mb_strlen($lastcom['text'], "UTF-8") > 100 ? " ......" : ""), true, false, false, true, 600, false, false); $onmouseover = "onmouseover=\"domTT_activate(this, event, 'content', document.getElementById('" . $lastcom_tooltip[$counter]['id'] . "'), 'trail', false, 'delay', 500,'lifetime',3000,'fade','both','styleClass','niceTitle','fadeMax', 87,'maxWidth', 400);\""; } } else { $hasnewcom = false; $onmouseover = ""; } print "<b><a href=\"details.php?id=" . $id . "&hit=1&cmtpage=1#startcomments\" " . $onmouseover . ">" . ($hasnewcom ? "<font class='new'>" : "") . $row["comments"] . ($hasnewcom ? "</font>" : "") . "</a></b>"; } print "</td>"; } $time = $row["added"]; $time = gettime($time, false, true); print "<td class=\"rowfollow nowrap\">" . $time . "</td>"; //size print "<td class=\"rowfollow\">" . mksize_compact($row["size"]) . "</td>"; if ($row["seeders"]) { $ratio = $row["leechers"] ? $row["seeders"] / $row["leechers"] : 1; $ratiocolor = get_slr_color($ratio); print "<td class=\"rowfollow\" align=\"center\"><b><a href=\"details.php?id=" . $id . "&hit=1&dllist=1#seeders\">" . ($ratiocolor ? "<font color=\"" . $ratiocolor . "\">" . number_format($row["seeders"]) . "</font>" : number_format($row["seeders"])) . "</a></b></td>\n"; } else { print "<td class=\"rowfollow\"><span class=\"" . linkcolor($row["seeders"]) . "\">" . number_format($row["seeders"]) . "</span></td>\n"; } if ($row["leechers"]) { print "<td class=\"rowfollow\"><b><a href=\"details.php?id=" . $id . "&hit=1&dllist=1#leechers\">" . number_format($row["leechers"]) . "</a></b></td>\n"; } else { print "<td class=\"rowfollow\">0</td>\n"; } if ($row["times_completed"] >= 1) { print "<td class=\"rowfollow\"><a href=\"viewsnatches.php?id=" . $row[id] . "\"><b>" . number_format($row["times_completed"]) . "</b></a></td>\n"; } else { print "<td class=\"rowfollow\">" . number_format($row["times_completed"]) . "</td>\n"; } if ($row["anonymous"] == "yes" && get_user_class() >= $torrentmanage_class) { print "<td class=\"rowfollow\" align=\"center\"><i>" . $lang_functions['text_anonymous'] . "</i><br />" . (isset($row["owner"]) ? "(" . get_username($row["owner"]) . ")" : "<i>" . $lang_functions['text_orphaned'] . "</i>") . "</td>\n"; } elseif ($row["anonymous"] == "yes") { print "<td class=\"rowfollow\"><i>" . $lang_functions['text_anonymous'] . "</i></td>\n"; } else { print "<td class=\"rowfollow\">" . (isset($row["owner"]) ? get_username($row["owner"]) : "<i>" . $lang_functions['text_orphaned'] . "</i>") . "</td>\n"; } if (get_user_class() >= $torrentmanage_class) { print "<td class=\"rowfollow\"><a href=\"" . htmlspecialchars("fastdelete.php?id=" . $row[id]) . "\"><img class=\"staff_delete\" src=\"pic/trans.gif\" alt=\"D\" title=\"" . $lang_functions['text_delete'] . "\" /></a>"; print "<br /><a href=\"edit.php?returnto=" . rawurlencode($_SERVER["REQUEST_URI"]) . "&id=" . $row["id"] . "\"><img class=\"staff_edit\" src=\"pic/trans.gif\" alt=\"E\" title=\"" . $lang_functions['text_edit'] . "\" /></a></td>\n"; } print "</tr>\n"; $counter++; } print "</table>"; if ($CURUSER['appendpromotion'] == 'highlight') { print "<p align=\"center\"> " . $lang_functions['text_promoted_torrents_note'] . "</p>\n"; } if ($enabletooltip_tweak == 'yes' && (!isset($CURUSER) || $CURUSER['showlastcom'] == 'yes')) { create_tooltip_container($lastcom_tooltip, 400); } create_tooltip_container($torrent_tooltip, 500); }
} if (isset($copy_row["medium_name"])) { $other_medium_info = $copy_row[medium_name] . ", "; } if (isset($copy_row["codec_name"])) { $other_codec_info = $copy_row[codec_name] . ", "; } if (isset($copy_row["standard_name"])) { $other_standard_info = $copy_row[standard_name] . ", "; } if (isset($copy_row["processing_name"])) { $other_processing_info = $copy_row[processing_name] . ", "; } $sphighlight = get_torrent_bg_color($copy_row['sp_state']); $sp_info = get_torrent_promotion_append($copy_row['sp_state']); $s .= "<tr" . $sphighlight . "><td class=\"rowfollow nowrap\" valign=\"middle\" style='padding: 0px'>" . return_category_image($copy_row["catid"], "torrents.php?allsec=1&") . "</td><td class=\"rowfollow\" align=\"left\"><a href=\"" . htmlspecialchars(get_protocol_prefix() . $BASEURL . "/details.php?id=" . $copy_row["id"] . "&hit=1") . "\">" . $dispname . "</a>" . $sp_info . "</td>" . "<td class=\"rowfollow\" align=\"left\">" . rtrim(trim($other_source_info . $other_medium_info . $other_codec_info . $other_standard_info . $other_processing_info), ",") . "</td>" . "<td class=\"rowfollow\" align=\"center\">" . mksize($copy_row["size"]) . "</td>" . "<td class=\"rowfollow nowrap\" align=\"center\">" . str_replace(" ", "<br />", gettime($copy_row["added"], false)) . "</td>" . "<td class=\"rowfollow\" align=\"center\">" . $copy_row["seeders"] . "</td>" . "<td class=\"rowfollow\" align=\"center\">" . $copy_row["leechers"] . "</td>" . "</tr>\n"; } $s .= "</table>\n"; tr("<a href=\"javascript: klappe_news('othercopy')\"><span class=\"nowrap\"><img class=\"" . ($copies_count > 5 ? "plus" : "minus") . "\" src=\"pic/trans.gif\" alt=\"Show/Hide\" id=\"picothercopy\" title=\"" . $lang_detail['title_show_or_hide'] . "\" /> " . $lang_details['row_other_copies'] . "</span></a>", "<b>" . $copies_count . $lang_details['text_other_copies'] . " </b><br /><div id='kothercopy' style=\"" . ($copies_count > 5 ? "display: none;" : "display: block;") . "\">" . $s . "</div>", 1); } } if ($row["type"] == "multi") { $files_info = "<b>" . $lang_details['text_num_files'] . "</b>" . $row["numfiles"] . $lang_details['text_files'] . "<br />"; $files_info .= "<span id=\"showfl\"><a href=\"javascript: viewfilelist(" . $id . ")\" >" . $lang_details['text_see_full_list'] . "</a></span><span id=\"hidefl\" style=\"display: none;\"><a href=\"javascript: hidefilelist()\">" . $lang_details['text_hide_list'] . "</a></span>"; } function hex_esc($matches) { return sprintf("%02x", ord($matches[0])); } if ($enablenfo_main == 'yes') { tr($lang_details['row_torrent_info'], "<table><tr>" . ($files_info != "" ? "<td class=\"no_border_wide\">" . $files_info . "</td>" : "") . "<td class=\"no_border_wide\"><b>" . $lang_details['row_info_hash'] . ":</b> " . preg_replace_callback('/./s', "hex_esc", hash_pad($row["info_hash"])) . "</td>" . (get_user_class() >= $torrentstructure_class ? "<td class=\"no_border_wide\"><b>" . $lang_details['text_torrent_structure'] . "</b><a href=\"torrent_info.php?id=" . $id . "\">" . $lang_details['text_torrent_info_note'] . "</a></td>" : "") . "</tr></table><span id='filelist'></span>", 1);
function printcat($name, $listarray, $cbname, $wherelistina, $btname, $showimg = false) { global $catpadding, $catsperrow, $lang_torrents, $CURUSER, $CURLANGDIR, $catimgurl; print "<tr><td class=\"embedded\" colspan=\"" . $catsperrow . "\" align=\"left\"><b>" . $name . "</b></td></tr><tr>"; $i = 0; foreach ($listarray as $list) { if ($i && $i % $catsperrow == 0) { print "</tr><tr>"; } print "<td align=\"left\" class=\"bottom\" style=\"padding-bottom: 4px; padding-left: " . $catpadding . "px;\"><input type=\"checkbox\" id=\"" . $cbname . $list[id] . "\" name=\"" . $cbname . $list[id] . "\"" . (in_array($list[id], $wherelistina) ? " checked=\"checked\"" : "") . " value=\"1\" />" . ($showimg ? return_category_image($list[id], "?") : "<a title=\"" . $list[name] . "\" href=\"?" . $cbname . "=" . $list[id] . "\">" . $list[name] . "</a>") . "</td>\n"; $i++; } $checker = "<input name=\"" . $btname . "\" value='" . $lang_torrents['input_check_all'] . "' class=\"btn medium\" type=\"button\" onclick=\"javascript:SetChecked('" . $cbname . "','" . $btname . "','" . $lang_torrents['input_check_all'] . "','" . $lang_torrents['input_uncheck_all'] . "',-1,10)\" />"; print "<td colspan=\"2\" class=\"bottom\" align=\"left\" style=\"padding-left: 15px\">" . $checker . "</td>\n"; print "</tr>"; }
function printcatone($name, $listarray, $cbname, $wherelistina, $btname, $showimg = false) { global $catpadding, $catsperrow, $lang_torrents, $CURUSER, $CURLANGDIR, $catimgurl; //print("<tr><td class=\"embedded\" colspan=\"".$catsperrow."\" align=\"left\"><b>".$name."</b></td></tr><tr bgcolor=#00AA55>"); print "<tr bgcolor=#009955>"; $i = 0; foreach ($listarray as $list) { if ($i && $i % $catsperrow == 0) { print "</tr><tr>"; } print "<td align=\"left\" class=\"bottom\" style=\"padding-bottom: 4px; padding-left: " . $catpadding . "px;\">" . ($showimg ? return_category_image($list[id], "?") : " <a title=\"" . $list[name] . "\" href=\"?" . $cbname . "=" . $list[id] . "\"><b>" . $list[name] . "</b></a> ") . "</td>\n"; $i++; } print "</tr>"; }