$type = $row["external"] == "yes" ? T_("EXTERNAL") : T_("LOCAL"); if ($row["anon"] == "yes" && ($CURUSER["edit_torrents"] == "no" || $CURUSER["id"] != $row["owner"])) { $owner = T_("ANONYMOUS"); } elseif ($row["username"]) { $owner = "<a href='account-details.php?id=" . $row["owner"] . "'>" . $row["username"] . "</a>"; } else { $owner = T_("UNKNOWN_USER"); } ?> <tr> <td class="table_col1" align="center"><a href="torrents-details.php?id=<?php echo $row["id"]; ?> "><?php echo CutName(htmlspecialchars($row["name"]), 40); ?> </a></td> <td class="table_col2" align="center"><?php echo $owner; ?> </td> <td class="table_col1" align="center"><?php echo $type; ?> </td> <td class="table_col2" align="center"><?php echo mksize($row["size"]); ?> </td> <td class="table_col1" align="center"><?php
LEFT JOIN posts AS p ON p.topic_id = t.id RIGHT JOIN users AS u ON u.id = p.user_id WHERE ' . ($CURUSER['class'] < UC_STAFF ? 'p.status = \'ok\' AND t.status = \'ok\' AND' : ($CURUSER['class'] < $min_delete_view_class ? ' t.status != \'deleted\' AND p.status != \'deleted\' AND' : '')) . ' t.forum_id = ' . $forum_id . ' ORDER BY p.id DESC LIMIT 1'); $last_post_arr = mysql_fetch_assoc($last_post_res); //=== only do more if there is a post there... if ($last_post_arr['last_post'] > 0) { $last_post_id = $last_post_arr['last_post']; //=== get the last post read by CURUSER (with Retro's $readpost_expiry thingie) $last_read_post_res = sql_query('SELECT last_post_read FROM read_posts WHERE user_id=' . $CURUSER['id'] . ' AND topic_id=' . $last_post_arr['topic_id']); $last_read_post_arr = mysql_fetch_row($last_read_post_res); $image_to_use = $last_post_arr['added'] > time() - $readpost_expiry ? !$last_read_post_arr or $last_post_id > $last_read_post_arr[0] : 0; $img = $image_to_use ? 'unlockednew' : 'unlocked'; $last_post = '<span style="white-space:nowrap;">Last Post by: ' . print_user_stuff($last_post_arr) . ' <span style="font-size: x-small;"> [ ' . get_user_class_name($last_post_arr['class']) . ' ] </span><br /> in ► <a class="altlink" href="forums.php?action=view_topic&topic_id=' . $last_post_arr['topic_id'] . '&page=p' . $last_post_id . '#' . $last_post_id . '" title="' . htmlentities($last_post_arr['topic_name'], ENT_QUOTES) . '"> <span style="font-weight: bold;">' . CutName(htmlentities($last_post_arr['topic_name'], ENT_QUOTES), 30) . '</span></a><br /> ' . get_date($last_post_arr['added'], '') . '<br /></span>'; //=== get child boards if any $child_boards_res = sql_query('SELECT name, id FROM forums WHERE parent_forum = ' . $arr_forums['real_forum_id'] . ' AND min_class_read <= ' . $CURUSER['class'] . ' ORDER BY sort ASC'); $child_boards = ''; while ($child_boards_arr = mysql_fetch_assoc($child_boards_res)) { if ($child_boards !== '') { $child_boards .= ', '; } $child_boards .= '<a href="forums.php?action=view_forum&forum_id=' . $child_boards_arr['id'] . '" title="click to view!" class="altlink">' . htmlentities($child_boards_arr['name'], ENT_QUOTES) . '</a>'; } if ($child_boards !== '') { $child_boards = '<hr /><span style="font-size: xx-small;">child boards:</span> ' . $child_boards; } /* find the fukin bug lol //=== now_viewing
function torrenttable($res, $variant = "index") { global $INSTALLER09, $CURUSER, $lang, $free, $mc1; require_once INCL_DIR . 'bbcode_functions.php'; $htmlout = $prevdate = $free_slot = $free_color = $slots_check = $double_slot = $private = $newgenre = $oldlink = $char = $description = $type = $sort = $row = $youtube = ''; $count_get = 0; /** ALL FREE/DOUBLE **/ foreach ($free as $fl) { switch ($fl['modifier']) { case 1: $free_display = '[Free]'; break; case 2: $free_display = '[Double]'; break; case 3: $free_display = '[Free and Double]'; break; case 4: $free_display = '[Silver]'; break; } $slot = make_freeslots($CURUSER['id'], 'fllslot_'); $book = make_bookmarks($CURUSER['id'], 'bookmm_'); $all_free_tag = $fl['modifier'] != 0 && ($fl['expires'] > TIME_NOW || $fl['expires'] == 1) ? ' <a class="info" href="#"> <b>' . $free_display . '</b> <span>' . ($fl['expires'] != 1 ? ' Expires: ' . get_date($fl['expires'], 'DATE') . '<br /> (' . mkprettytime($fl['expires'] - TIME_NOW) . ' to go)</span></a><br />' : 'Unlimited</span></a><br />') : ''; } $oldlink = array(); foreach ($_GET as $key => $var) { if (in_array($key, array('sort', 'type'))) { continue; } if (is_array($var)) { foreach ($var as $s_var) { $oldlink[] = sprintf('%s=%s', urlencode($key) . '%5B%5D', urlencode($s_var)); } } else { $oldlink[] = sprintf('%s=%s', urlencode($key), urlencode($var)); } } $oldlink = !empty($oldlink) ? join('&', array_map('htmlsafechars', $oldlink)) . '&' : ''; $links = array('link1', 'link2', 'link3', 'link4', 'link5', 'link6', 'link7', 'link8', 'link9'); $i = 1; foreach ($links as $link) { if (isset($_GET['sort']) && $_GET['sort'] == $i) { ${$link} = isset($_GET['type']) && $_GET['type'] == 'desc' ? 'asc' : 'desc'; } else { ${$link} = 'desc'; } $i++; } $htmlout .= "<!--<div class='global_icon'><img src='images/global.design/torrents.png' alt='' title='Categorys' class='global_image' width='25'/></div>\n <div class='global_head'>Torrents</div><br />\n <div class='global_text'><br />-->\n <table border='1' cellspacing='0' cellpadding='5'>\n <tr>\n <td class='colhead' align='center'>{$lang["torrenttable_type"]}</td>\n <td class='colhead' align='left'><a href='{$_SERVER["PHP_SELF"]}?{$oldlink}sort=1&type={$link1}'>{$lang["torrenttable_name"]}</a></td>\n <td class='colhead' align='left'><img src='{$INSTALLER09['pic_base_url']}zip.gif' border='0' alt='Download' title='Download' /></td>"; $htmlout .= $variant == 'index' ? "<td class='colhead' align='center'><a href='{$INSTALLER09['baseurl']}/bookmarks.php'><img src='{$INSTALLER09['pic_base_url']}bookmarks.png' border='0' alt='Bookmark' title='Go To My Bookmarks' /></a></td>" : ''; if ($variant == "mytorrents") { $htmlout .= "<td class='colhead' align='center'>{$lang["torrenttable_edit"]}</td>\n"; $htmlout .= "<td class='colhead' align='center'>{$lang["torrenttable_visible"]}</td>\n"; } $htmlout .= "<td class='colhead' align='right'><a href='{$_SERVER["PHP_SELF"]}?{$oldlink}sort=2&type={$link2}'>{$lang["torrenttable_files"]}</a></td>\n <td class='colhead' align='right'><a href='{$_SERVER["PHP_SELF"]}?{$oldlink}sort=3&type={$link3}'>{$lang["torrenttable_comments"]}</a></td>\n <td class='colhead' align='center'><a href='{$_SERVER["PHP_SELF"]}?{$oldlink}sort=4&type={$link4}'>{$lang["torrenttable_added"]}</a></td>\n <td class='colhead' align='center'><a href='{$_SERVER["PHP_SELF"]}?{$oldlink}sort=5&type={$link5}'>{$lang["torrenttable_size"]}</a></td>\n <td class='colhead' align='center'><a href='{$_SERVER["PHP_SELF"]}?{$oldlink}sort=6&type={$link6}'>{$lang["torrenttable_snatched"]}</a></td>\n <td class='colhead' align='right'><a href='{$_SERVER["PHP_SELF"]}?{$oldlink}sort=7&type={$link7}'>{$lang["torrenttable_seeders"]}</a></td>\n <td class='colhead' align='right'><a href='{$_SERVER["PHP_SELF"]}?{$oldlink}sort=8&type={$link8}'>{$lang["torrenttable_leechers"]}</a></td>"; if ($variant == 'index') { $htmlout .= "<td class='colhead' align='center'><a href='{$_SERVER["PHP_SELF"]}?{$oldlink}sort=9&type={$link9}'>{$lang["torrenttable_uppedby"]}</a></td>\n"; } $htmlout .= "</tr>\n"; $categories = genrelist(); foreach ($categories as $key => $value) { $change[$value['id']] = array('id' => $value['id'], 'name' => $value['name'], 'image' => $value['image']); } while ($row = mysqli_fetch_assoc($res)) { //== @author StarionTurbo @copyright 2007 @modname Show torrents by day @version v1.0 if ($CURUSER['split'] == 'yes') { if (get_date($row['added'], 'DATE') == $prevdate) { $cleandate = ''; } else { $htmlout .= "<tr><td colspan='12' class='colhead' align='left'><b>{$lang['torrenttable_upped']} " . get_date($row['added'], 'DATE') . "</b></td></tr>"; } $prevdate = get_date($row['added'], 'DATE'); } $row['cat_name'] = htmlsafechars($change[$row['category']]['name']); $row['cat_pic'] = htmlsafechars($change[$row['category']]['image']); /** Freeslot/doubleslot in Use **/ $id = $row["id"]; foreach ($slot as $sl) { $slots_check = ($sl['torrentid'] == $id && $sl['free'] == 'yes' or $sl['doubleup'] == 'yes'); } if ($row["sticky"] == "yes") { $htmlout .= "<tr class='highlight'>\n"; } else { $htmlout .= '<tr class="' . ($free_color && $all_free_tag != '' || $row['free'] != 0 || $slots_check ? 'freeleech_color' : 'browse_color') . '">'; } $htmlout .= "<td align='center' style='padding: 0px'>"; if (isset($row["cat_name"])) { $htmlout .= "<a href='browse.php?cat=" . (int) $row['category'] . "'>"; if (isset($row["cat_pic"]) && $row["cat_pic"] != "") { $htmlout .= "<img border='0' src='{$INSTALLER09['pic_base_url']}caticons/{$CURUSER['categorie_icon']}/{$row['cat_pic']}' alt='{$row['cat_name']}' />"; } else { $htmlout .= htmlsafechars($row["cat_name"]); } $htmlout .= "</a>"; } else { $htmlout .= "-"; } $htmlout .= "</td>\n"; $dispname = htmlsafechars($row["name"]); $smalldescr = !empty($row['description']) ? "<i>[" . htmlsafechars($row['description']) . "]</i>" : ""; $checked = !empty($row['checked_by']) && $CURUSER['class'] >= UC_USER ? " <img src='{$INSTALLER09['pic_base_url']}mod.gif' width='15' border='0' alt='Checked - by " . htmlsafechars($row['checked_by']) . "' title='Checked - by " . htmlsafechars($row['checked_by']) . "' />" : ""; $poster = empty($row["poster"]) ? "<img src=\\'{$INSTALLER09['pic_base_url']}noposter.png\\' width=\\'150\\' height=\\'220\\' border=\\'0\\' alt=\\'Poster\\' title=\\'poster\\' />" : "<img src=\\'" . htmlsafechars($row['poster']) . "\\' width=\\'150\\' height=\\'220\\' border=\\'0\\' alt=\\'Poster\\' title=\\'poster\\' />"; //$rating = empty($row["rating"]) ? "No votes yet":"".ratingpic($row["rating"]).""; $youtube = !empty($row['youtube']) ? "<a href='" . htmlsafechars($row['youtube']) . "' target='_blank'><img src='{$INSTALLER09['pic_base_url']}youtube.png' width='14' height='14' border='0' alt='Youtube Trailer' title='Youtube Trailer' /></a>" : ""; if (isset($row["descr"])) { $descr = str_replace("\"", """, readMore($row["descr"], 350, "details.php?id=" . (int) $row["id"] . "&hit=1")); } $descr = str_replace('&', '&', $descr); $htmlout .= "<td align='left'><a href='details.php?"; if ($variant == "mytorrents") { $htmlout .= "returnto=" . urlencode($_SERVER["REQUEST_URI"]) . "&"; } $htmlout .= "id={$id}"; if ($variant == "index") { $htmlout .= "&hit=1"; } $newgenre = ''; if (!empty($row['newgenre'])) { $newgenre = array(); $row['newgenre'] = explode(',', $row['newgenre']); foreach ($row['newgenre'] as $foo) { $newgenre[] = '<a href="browse.php?search=' . trim(strtolower($foo)) . '&searchin=genre">' . $foo . '</a>'; } $newgenre = '<i>' . join(', ', $newgenre) . '</i>'; } $sticky = $row['sticky'] == "yes" ? "<img src='{$INSTALLER09['pic_base_url']}sticky.gif' style='border:none' alt='Sticky' title='Sticky !' />" : ""; $nuked = $row["nuked"] == "yes" ? "<img src='{$INSTALLER09['pic_base_url']}nuked.gif' style='border:none' alt='Nuked' align='right' title='Reason :" . htmlsafechars($row["nukereason"]) . "' />" : ""; $release_group = $row['release_group'] == "scene" ? " <img src='{$INSTALLER09['pic_base_url']}scene.gif' title='Scene' alt='Scene' style='border:none' />" : ($row['release_group'] == "p2p" ? " <img src='{$INSTALLER09['pic_base_url']}p2p.gif' title='P2P' alt='P2P' />" : ""); $viponly = $row["vip"] == "1" ? "<img src='{$INSTALLER09['pic_base_url']}star.png' border='0' alt='Vip Torrent' title='Vip Torrent' />" : ""; $bump = $row['bump'] == "yes" ? "<img src='{$INSTALLER09['pic_base_url']}up.gif' width='12px' alt='Re-Animated torrent' title='This torrent was ReAnimated!' />" : ""; /** FREE Torrent **/ $free_tag = $row['free'] != 0 ? ' <a class="info" href="#"><b>[FREE]</b> <span>' . ($row['free'] > 1 ? 'Expires: ' . get_date($row['free'], 'DATE') . '<br />(' . mkprettytime($row['free'] - TIME_NOW) . ' to go)<br />' : 'Unlimited<br />') . '</span></a>' : $all_free_tag; /** Silver Torrent **/ $silver_tag = $row['silver'] != 0 ? ' <a class="info" href="#"><b>[SILVER]</b> <span>' . ($row['silver'] > 1 ? 'Expires: ' . get_date($row['silver'], 'DATE') . '<br />(' . mkprettytime($row['silver'] - TIME_NOW) . ' to go)<br />' : 'Unlimited<br />') . '</span></a>' : ''; if (!empty($slot)) { foreach ($slot as $sl) { if ($sl['torrentid'] == $id && $sl['free'] == 'yes') { $free_slot = 1; } if ($sl['torrentid'] == $id && $sl['doubleup'] == 'yes') { $double_slot = 1; } if ($free_slot && $double_slot) { break; } } } $free_slot = $free_slot == 1 ? ' <img src="' . $INSTALLER09['pic_base_url'] . 'freedownload.gif" width="12px" alt="Free Slot" title="Free Slot in Use" /> <small>Free Slot</small>' : ''; $double_slot = $double_slot == 1 ? ' <img src="' . $INSTALLER09['pic_base_url'] . 'doubleseed.gif" width="12px" alt="Double Upload Slot" title="Double Upload Slot in Use" /> <small>Double Slot</small>' : ''; //== $Subs = ''; if (in_array($row["category"], $INSTALLER09['movie_cats']) && !empty($row["subs"])) { $subs_array = explode(",", $row["subs"]); require_once CACHE_DIR . 'subs.php'; foreach ($subs_array as $k => $sid) { foreach ($subs as $sub) { if ($sub["id"] == $sid) { $Subs = "<img border=\\'0\\' width=\\'16px\\' style=\\'padding:3px;\\' src=\\'{$sub["pic"]}\\' alt=\\'{$sub["name"]}\\' title=\\'{$sub["name"]}\\' />"; } } } } else { $Subs = "---"; } $htmlout .= "' onmouseover=\"Tip('<b>" . CutName($dispname, 80) . "</b><br /><b>Added: " . get_date($row['added'], 'DATE', 0, 1) . "</b><br /><b>Size: " . mksize(htmlsafechars($row["size"])) . "</b><br /><b>Subtitle: {$Subs}</b><br /><b>Seeders: " . htmlsafechars($row["seeders"]) . "</b><br /><b>Leechers: " . htmlsafechars($row["leechers"]) . "</b><br />{$poster}');\" onmouseout=\"UnTip();\"><b>" . CutName($dispname, 45) . "</b></a> <a href=\"javascript:klappe_descr('descr" . (int) $row["id"] . "');\" ><img src=\"{$INSTALLER09['pic_base_url']}plus.png\" border=\"0\" alt=\"Show torrent info in this page\" title=\"Show torrent info in this page\" /></a> {$youtube} {$viponly} {$release_group} {$sticky} " . ($row['added'] >= $CURUSER['last_browse'] ? " <img src='{$INSTALLER09['pic_base_url']}newb.png' border='0' alt='New !' title='New !' />" : "") . " {$checked} {$free_tag} {$silver_tag} {$nuked}<br />{$free_slot} {$double_slot} {$newgenre} {$bump} {$smalldescr}</td>\n"; if ($variant == "mytorrents") { $htmlout .= "<td align='center'><a href=\"download.php?torrent={$id}" . ($CURUSER['ssluse'] == 3 ? "&ssl=1" : "") . "\"><img src='{$INSTALLER09['pic_base_url']}zip.gif' border='0' alt='Download This Torrent!' title='Download This Torrent!' /></a></td>\n"; } if ($variant == "mytorrents") { $htmlout .= "<td align='center'><a href='edit.php?id=" . (int) $row['id'] . "amp;returnto=" . urlencode($_SERVER["REQUEST_URI"]) . "'>{$lang["torrenttable_edit"]}</a></td>\n"; } $htmlout .= $variant == "index" ? "<td align='center'><a href=\"download.php?torrent={$id}" . ($CURUSER['ssluse'] == 3 ? "&ssl=1" : "") . "\"><img src='{$INSTALLER09['pic_base_url']}zip.gif' border='0' alt='Download This Torrent!' title='Download This Torrent!' /></a></td>" : ""; if ($variant == "mytorrents") { $htmlout .= "<td align='right'>"; if ($row["visible"] == "no") { $htmlout .= "<b>{$lang["torrenttable_not_visible"]}</b>"; } else { $htmlout .= "{$lang["torrenttable_visible"]}"; } $htmlout .= "</td>\n"; } /** pdq bookmarks **/ $booked = ''; if (!empty($book)) { foreach ($book as $bk) { if ($bk['torrentid'] == $id) { $booked = 1; } } } $rm_status = !$booked ? ' style="display:none;"' : ' style="display:inline;"'; $bm_status = $booked ? ' style="display:none;"' : ' style="display:inline;"'; $bookmark = '<span id="bookmark' . $id . '"' . $bm_status . '> <a href="bookmark.php?torrent=' . $id . '&action=add" class="bookmark" name="' . $id . '"> <span title="Bookmark it!" class="add_bookmark_b"> <img src="' . $INSTALLER09['pic_base_url'] . 'aff_tick.gif" align="top" width="14px" alt="Bookmark it!" title="Bookmark it!" /> </span> </a> </span> <span id="remove' . $id . '"' . $rm_status . '> <a href="bookmark.php?torrent=' . $id . '&action=delete" class="remove" name="' . $id . '"> <span class="remove_bookmark_b"> <img src="' . $INSTALLER09['pic_base_url'] . 'aff_cross.gif" align="top" width="14px" alt="Delete Bookmark!" title="Delete Bookmark!" /> </span> </a> </span>'; if ($variant == "index") { $htmlout .= "<td align='right'>{$bookmark}</td>"; } if ($row["type"] == "single") { $htmlout .= "<td align='right'>" . (int) $row["numfiles"] . "</td>\n"; } else { if ($variant == "index") { $htmlout .= "<td align='right'><b><a href='filelist.php?id={$id}'>" . (int) $row["numfiles"] . "</a></b></td>\n"; } else { $htmlout .= "<td align='right'><b><a href='filelist.php?id={$id}'>" . (int) $row["numfiles"] . "</a></b></td>\n"; } } if (!$row["comments"]) { $htmlout .= "<td align='right'>" . (int) $row["comments"] . "</td>\n"; } else { if ($variant == "index") { $htmlout .= "<td align='right'><b><a href='details.php?id={$id}&hit=1&tocomm=1'>" . (int) $row["comments"] . "</a></b></td>\n"; } else { $htmlout .= "<td align='right'><b><a href='details.php?id={$id}&page=0#startcomments'>" . (int) $row["comments"] . "</a></b></td>\n"; } } $htmlout .= "<td align='center'><span style='white-space: nowrap;'>" . str_replace(",", "<br />", get_date($row['added'], '')) . "</span></td>\n"; $htmlout .= "<td align='center'>" . str_replace(" ", "<br />", mksize($row["size"])) . "</td>\n"; if ($row["times_completed"] != 1) { $_s = "" . $lang["torrenttable_time_plural"] . ""; } else { $_s = "" . $lang["torrenttable_time_singular"] . ""; } $htmlout .= "<td align='center'><a href='snatches.php?id={$id}'>" . number_format($row["times_completed"]) . "<br />{$_s}</a></td>\n"; if ($row["seeders"]) { if ($variant == "index") { if ($row["leechers"]) { $ratio = $row["seeders"] / $row["leechers"]; } else { $ratio = 1; } $htmlout .= "<td align='right'><b><a href='peerlist.php?id={$id}#seeders'><font color='" . get_slr_color($ratio) . "'>" . (int) $row["seeders"] . "</font></a></b></td>\n"; } else { $htmlout .= "<td align='right'><b><a class='" . linkcolor($row["seeders"]) . "' href='peerlist.php?id={$id}#seeders'>" . (int) $row["seeders"] . "</a></b></td>\n"; } } else { $htmlout .= "<td align='right'><span class='" . linkcolor($row["seeders"]) . "'>" . (int) $row["seeders"] . "</span></td>\n"; } if ($row["leechers"]) { if ($variant == "index") { $htmlout .= "<td align='right'><b><a href='peerlist.php?id={$id}#leechers'>" . number_format($row["leechers"]) . "</a></b></td>\n"; } else { $htmlout .= "<td align='right'><b><a class='" . linkcolor($row["leechers"]) . "' href='peerlist.php?id={$id}#leechers'>" . (int) $row["leechers"] . "</a></b></td>\n"; } } else { $htmlout .= "<td align='right'>0</td>\n"; } if ($variant == "index") { $htmlout .= "<td align='center'>" . (isset($row["username"]) ? $row["anonymous"] == "yes" && $CURUSER['class'] < UC_STAFF && $row['owner'] != $CURUSER['id'] ? "<i>" . $lang['torrenttable_anon'] . "</i>" : "<a href='userdetails.php?id=" . (int) $row["owner"] . "'><b>" . htmlsafechars($row["username"]) . "</b></a>" : "<i>(" . $lang["torrenttable_unknown_uploader"] . ")</i>") . "</td>\n"; } $htmlout .= "</tr>\n"; $htmlout .= "<tr id=\"kdescr" . (int) $row["id"] . "\" style=\"display:none;\"><td width=\"100%\" colspan=\"12\">" . format_comment($descr, false) . "</td></tr>\n"; } $htmlout .= "</table><!--</div>-->\n"; return $htmlout; }
//=== get the last post read by CURUSER (with Retro's $readpost_expiry thingie) - cached \0/ if (($last_read_post_arr = $mc1->get_value('last_read_post_' . $last_post_arr['topic_id'] . '_' . $CURUSER['id'])) === false) { $last_read_post_arr = mysqli_fetch_row(sql_query('SELECT last_post_read FROM read_posts WHERE user_id=' . sqlesc($CURUSER['id']) . ' AND topic_id=' . sqlesc($last_post_arr['topic_id']))); $mc1->cache_value('last_read_post_' . $last_post_arr['topic_id'] . '_' . $CURUSER['id'], $last_read_post_arr, $INSTALLER09['expires']['last_read_post']); } $image_to_use = $last_post_arr['added'] > TIME_NOW - $readpost_expiry ? !$last_read_post_arr or $last_post_id > $last_read_post_arr[0] : 0; $img = $image_to_use ? 'unlockednew' : 'unlocked'; //== Anonymous -> if ($last_post_arr["tan"] == "yes") { if ($CURUSER['class'] < UC_STAFF && $last_post_arr["user_id"] != $CURUSER["id"]) { $last_post = '<span style="white-space:nowrap;">' . $lang['fe_last_post_by'] . ': <i>' . $lang['fe_anonymous'] . '</i> in ► <a class="altlink" href="' . $INSTALLER09['baseurl'] . '/forums.php?action=view_topic&topic_id=' . (int) $last_post_arr['topic_id'] . '&page=' . $last_post_id . '#' . $last_post_id . '" title="' . htmlsafechars($last_post_arr['topic_name'], ENT_QUOTES) . '"><span style="font-weight: bold;">' . CutName(htmlsafechars($last_post_arr['topic_name'], ENT_QUOTES), 30) . '</span></a><br />' . get_date($last_post_arr['added'], '') . '<br /></span>'; } else { $last_post = '<span style="white-space:nowrap;">' . $lang['fe_last_post_by'] . ': <i>' . $lang['fe_anonymous'] . '</i> [' . ($last_post_arr['username'] !== '' ? print_user_stuff($last_post_arr) : '' . $lang['fe_lost'] . '') . '] <span style="font-size: x-small;"> [ ' . get_user_class_name($last_post_arr['class']) . ' ] </span><br />in ► <a class="altlink" href="' . $INSTALLER09['baseurl'] . '/forums.php?action=view_topic&topic_id=' . (int) $last_post_arr['topic_id'] . '&page=' . $last_post_id . '#' . $last_post_id . '" title="' . htmlsafechars($last_post_arr['topic_name'], ENT_QUOTES) . '"><span style="font-weight: bold;">' . CutName(htmlsafechars($last_post_arr['topic_name'], ENT_QUOTES), 30) . '</span></a><br />' . get_date($last_post_arr['added'], '') . '<br /></span>'; } } else { $last_post = '<span style="white-space:nowrap;">' . $lang['fe_last_post_by'] . ': ' . ($last_post_arr['username'] !== '' ? print_user_stuff($last_post_arr) : '' . $lang['fe_lost'] . '') . ' <span style="font-size: x-small;"> [ ' . get_user_class_name($last_post_arr['class']) . ' ] </span><br />in ► <a class="altlink" href="' . $INSTALLER09['baseurl'] . '/forums.php?action=view_topic&topic_id=' . (int) $last_post_arr['topic_id'] . '&page=' . $last_post_id . '#' . $last_post_id . '" title="' . htmlsafechars($last_post_arr['topic_name'], ENT_QUOTES) . '"><span style="font-weight: bold;">' . CutName(htmlsafechars($last_post_arr['topic_name'], ENT_QUOTES), 30) . '</span></a><br />' . get_date($last_post_arr['added'], '') . '<br /></span>'; } //== //=== get child boards if any - cached \0/ $keys['child_boards'] = 'child_boards_' . $last_post_id . '_' . $CURUSER['class']; if (($child_boards_cache = $mc1->get_value($keys['child_boards'])) === false) { $child_boards = ''; $child_boards_cache = array(); $res = sql_query('SELECT name, id FROM forums WHERE parent_forum = ' . sqlesc($arr_forums['real_forum_id']) . ' AND min_class_read <= ' . sqlesc($CURUSER['class']) . ' ORDER BY sort ASC') or sqlerr(__FILE__, __LINE__); while ($arr = mysqli_fetch_assoc($res)) { if ($child_boards) { $child_boards .= ', '; } $child_boards .= '<a href="' . $INSTALLER09['baseurl'] . '/forums.php?action=view_forum&forum_id=' . (int) $arr['id'] . '" title="' . $lang['fm_click_to_view'] . '!" class="altlink">' . htmlsafechars($arr['name'], ENT_QUOTES) . '</a>'; } $child_boards_cache['child_boards'] = $child_boards;
public static function display($params) { $cururl = Url::curRequestURL(); # Actor de caché y el cine Film_Model::CacheActorSeatch(); # Restablecer Vistas Film_Model::ResetViewed(); # Get info url $geturl = explode('/', $cururl); $mode = $geturl[1]; // Film and cinema if (in_array($mode, array('phim', 'xem-phim'))) { $id = $geturl[2]; $id = explode('-', $id); $id = $id[0]; if ($mode == 'phim') { $arr = MySql::dbselect('tb_film.id,tb_film.title,tb_film.thumb,tb_film.year,tb_film.big_image,tb_film_other.content,tb_film.title_en,tb_film_other.keywords', 'film JOIN tb_film_other ON (tb_film_other.filmid = tb_film.id)', "id = '{$id}'"); //TITULO PRINCIPAL DE TODA LA WEB $site_title = 'Pelicula ' . $arr[0][1] . ' | ' . $arr[0][6] . ' full HD'; $site_description = str_replace('"', '', CutName(RemoveHtml(UnHtmlChars($arr[0][5])), 200)); $site_keywords = FixTags($arr[0][7]); $filmid = intval($arr[0][0]); $epwatch = MySql::dbselect('id', 'episode', "filmid = '{$filmid}' order by id asc limit 1"); $epwatch = $epwatch[0][0]; } else { if ($mode == 'xem-phim') { $epid = MySql::dbselect('id,name,filmid,url,subtitle', 'episode', "id = '{$id}'"); $filmid = intval($epid[0][2]); MySql::dbupdate('film', "viewed = viewed+100, viewed_day = viewed_day+1, viewed_week = viewed_week+1, viewed_month = viewed_month+1", "id = '{$filmid}'"); $arr = MySql::dbselect('tb_film.id,tb_film.title,tb_film.thumb,tb_film.year,tb_film.big_image,tb_film_other.content,tb_film.title_en,tb_film_other.keywords', 'film JOIN tb_film_other ON (tb_film_other.filmid = tb_film.id)', "id = '{$filmid}'"); $site_title = 'Pelicula ' . $arr[0][1] . ' Tập ' . $epid[0][1] . ' - Pelicula ' . $arr[0][6]; $site_description = 'Pelicula ' . $arr[0][1] . ' Tập ' . $epid[0][1] . ' | ' . $arr[0][6] . ' Ep ' . $epid[0][1] . '. Pelicula ' . $arr[0][1] . ' Tập ' . $epid[0][1] . ' Calidad HD.'; $site_keywords = FixTags('Pelicula ' . $arr[0][1] . ' Tập ' . $epid[0][1] . ', ' . $arr[0][1] . ' Tập ' . $epid[0][1] . ', ' . $arr[0][6] . ' Ep ' . $epid[0][1] . ', ' . $arr[0][7]); } } if (!$arr) { header('Location: ' . s404_URL); } $other_meta = '<meta property="og:image" content="' . $arr[0][2] . '">'; $other_meta2 = '<link href="' . SITE_URL . $cururl . '" rel="canonical">'; include View::TemplateView('film'); } else { if (in_array($mode, array('danh-sach', 'the-loai', 'quoc-gia', 'search', 'tag'))) { if ($mode == 'the-loai') { $id = $geturl[2]; $arr = MySql::dbselect('id,name', 'category', "name_seo = '{$id}'"); $id = $arr[0][0]; $catid = $id; $name = $arr[0][1]; $url_page = Url::get(0, $name, 'Thể loại'); $site_title = head_site($name, 'category_title'); $site_description = head_site($name, 'category_description'); $site_keywords = head_site($name, 'category_keywords'); $sql = "tb_film.category like '%,{$id},%'"; } else { if ($mode == 'quoc-gia') { $id = $geturl[2]; $arr = MySql::dbselect('id,name', 'country', "name_seo = '{$id}'"); $id = $arr[0][0]; $couid = $id; $name = $arr[0][1]; $url_page = Url::get(0, $name, 'Pais'); $site_title = head_site($name, 'country_title'); $site_description = head_site($name, 'country_description'); $site_keywords = head_site($name, 'country_keywords'); $sql = "tb_film.country = '{$id}'"; } else { if (in_array($mode, array('search', 'tag'))) { $id = str_replace('-', ' ', urldecode($geturl[2])); $name = $id; $url_page = Url::get(0, $name, 'Search'); $site_title = head_site($name, 'search_title'); $site_description = head_site($name, 'search_description'); $site_keywords = head_site($name, 'search_keywords'); $sql = "tb_film.title like '%{$id}%' OR tb_film.title_en like '%{$id}%' OR tb_film_other.searchs like '%{$id}%' OR tb_film_other.keywords like '%{$id}%' OR tb_film.actor like '%{$id}%' OR tb_film.director like '%{$id}%'"; } else { if ($mode == 'danh-sach') { $id = $geturl[2]; if ($id == 'phim-moi') { $name = 'Nuevas Películas'; $url_page = Url::get(0, $name, 'Danh sách'); $sql = "id != '0'"; $site_title = "Nuevas Películas y 2014, lista nueva géneros cinematográficos"; $site_description = "Lista de Cine Última actualización continua, consulte delicia y un número ilimitado de películas."; $site_keywords = "Nuevas películas , una nueva película o, seleccionada nuevas películas"; } else { if ($id == 'phim-de-cu') { $name = 'Peliculas Nominadas'; $url_page = Url::get(0, $name, 'Danh sách'); $sql = "decu = '1'"; $site_title = "Película con alta calidad"; $site_description = "Las películas nominadas para el más caliente o 2014, se seleccionaron y evaluaron la más alta calidad."; $site_keywords = "películas calientes, mejores películas, películas o 2014"; } else { if ($id == 'phim-le') { $filmlb = $id; $name = 'Movie'; $url_page = Url::get(0, $name, 'Danh sách'); $sql = "filmlb = '0'"; $site_title = "Película con alta calidad"; $site_description = "Lista de los géneros cinematográficos individuales o múltiples, la selección constantemente actualizada de nuevas películas y la más atractiva al por menor"; $site_keywords = "Películas o películas seleccionadas impares, películas la nueva película de venta"; } else { if ($id == 'phim-bo') { $filmlb = $id; $name = 'Drama'; $url_page = Url::get(0, $name, 'Danh sách'); $sql = "filmlb IN (1,2)"; $site_title = "Película con alta calidad"; $site_description = "Lista de sistemas de la película o actualizada de forma continua y nueva selección de películas y más atractivo."; $site_keywords = "Drama o, las películas seleccionadas, la nueva película, la película"; } else { if (preg_match("#phim-nam-([0-9]+)#", $id, $yearurl)) { $getyear = $yearurl[1]; $name = 'Año ' . $getyear; $url_page = Url::get(0, 'Phim ' . $name, 'Danh sách'); $sql = "year = '{$getyear}'"; $site_title = "Peliculas {$name} mới nhất, Pelicula {$name} , Pelicula {$name} de Estreno"; $site_description = "Danh sách phim {$name} mới nhất, phim {$name} hay chọn lọc, phim {$name}."; $site_keywords = "Pelicula {$name}, Pelicula {$name}, Estrenos {$name}, descarga Pelicula {$getyear}"; } } } } } } } } } include View::TemplateView('list'); } else { if ($mode == 'thanh-vien') { $userid = $geturl[2]; $userid = explode('-', $userid); $userid = intval($userid[0]); if ($geturl[2] == 'dang-ky') { $site_title = 'Miembros Registrados'; } else { if ($geturl[2] == 'dang-nhap') { $site_title = 'Ingresar'; } else { if ($geturl[2] == 'quen-mat-khau') { $site_title = '¿Olvidaste tu contraseña?'; } else { $site_title = 'Perfil'; } } } $site_description = Config_Model::ConfigName('site_description'); $site_keywords = Config_Model::ConfigName('site_keywords'); if (IS_LOGIN && !$userid) { header('Location: ' . SITE_URL); } include View::TemplateView('member'); } else { if ($mode == 'bang-xep-hang') { $site_title = 'Top películas o ver la calidad de alta definición rápido'; $site_description = "Película o una selección de alta calidad, busque gratuitas nuevas películas ilimitadas"; $site_keywords = Config_Model::ConfigName('site_keywords'); include View::TemplateView('rank'); } else { if ($mode == 'video' || $mode == 'xem-video') { $id = $geturl[2]; $id = explode('-', $id); $id = intval($id[0]); if (!$id) { $site_title = 'Videos Youtube'; $site_description = "\tÚltimas Reclutamiento video divertido, mejores clips de comedia, ver chistes vídeos de humor, clip exclusivo divertido CALIENTE "; $site_keywords = "divertida risa videoclip, videos graciosos, videos divertidos"; include View::TemplateView('listvideo'); } else { $arr = MySql::dbselect('name,url,duration,thumb', 'media', "id = '{$id}'"); if ($arr) { MySql::dbupdate('media', "viewed = viewed+1", "id = '{$id}'"); } $name = $arr[0][0]; $url = $arr[0][1]; $duration = $arr[0][2]; $thumb = $arr[0][3]; $site_title = "{$name}"; $site_description = Config_Model::ConfigName('site_description'); $site_keywords = Config_Model::ConfigName('site_keywords'); $urlvideo = SITE_URL . $cururl; $other_meta = '<meta property="og:image" content="' . $thumb . '">'; $other_meta2 = '<link href="' . $urlvideo . '" rel="canonical">'; include View::TemplateView('video'); } } else { if ($mode == 'tin-tuc') { $seotitle = $geturl[2]; $arr = MySql::dbselect('id,title,content', 'news', "seotitle = '{$seotitle}'"); $id = $arr[0][0]; $title = $arr[0][1]; $content = $arr[0][2]; $site_title = "{$title}"; $site_description = Config_Model::ConfigName('site_description'); $site_keywords = Config_Model::ConfigName('site_keywords'); include View::TemplateView('post'); } else { if ($mode == 'live-tv') { parse_str(parse_url(Url::curRequestURL(), PHP_URL_QUERY), $data); $key = $data['k']; $id = $geturl[2]; $id = explode('-', $id); $id = $id[0]; if ($key) { $site_title = 'Buscar canales: ' . $key; $sql = "symbol like '%{$key}%' OR name like '%{$key}%'"; } else { if ($id) { $livetv = MySql::dbselect('id,symbol,name,quality,speed,viewed,content,linktv,thumb,lang', 'tv', "id = '{$id}'"); if ($livetv) { MySql::dbupdate('tv', "viewed = viewed+1", "id = '{$id}'"); } $symbol = $livetv[0][1]; $site_title = "{$symbol} - Ver la televisión en línea, el canal de televisión en línea"; $type = '1'; $other_meta = '<meta property="og:image" content="' . $livetv[0][8] . '">'; $other_meta2 = '<link href="' . SITE_URL . $cururl . '" rel="canonical">'; } else { $site_title = 'Lista de canales de TV'; $sql = 'id != 0'; } } $site_description = Config_Model::ConfigName('site_description'); $site_keywords = Config_Model::ConfigName('site_keywords'); include View::TemplateView('tv'); } else { if ($mode == ADMINCP_NAME) { include View::AdminView('admin'); } else { if (!$mode) { $site_title = Config_Model::ConfigName('site_name'); $site_description = Config_Model::ConfigName('site_description'); $site_keywords = Config_Model::ConfigName('site_keywords'); include View::TemplateView('home'); } else { $site_title = 'ERROR 404'; $site_description = Config_Model::ConfigName('site_description'); $site_keywords = Config_Model::ConfigName('site_keywords'); include View::TemplateView('404'); } } } } } } } } } }
$rows[] = $row; } $TTCache->Set("seedwanted_block", $rows, $expires); } if (!$rows) { ?> <p class="text-center"><?php echo T_("NOTHING_FOUND"); ?> </p> <?php } else { foreach ($rows as $row) { $char1 = 20; //cut length $smallname = htmlspecialchars(CutName($row["name"], $char1)); ?> <div class="pull-left"><a href="torrents-details.php?id=<?php echo $row["id"]; ?> " title="<?php echo htmlspecialchars($row["name"]); ?> "><?php echo $smallname; ?> </a></div> <div class="pull-right"><span class="label label-waring"><?php echo T_("LEECHERS"); ?>
$browser = "<img src='pic/referrers/opera.png' alt='Opera' title='Opera' width='25' height='25' border='0' /> Opera"; } else { if (strstr($http_agent, "Konqueror")) { $browser = "<img src='pic/referrers/konqueror.png' alt='konqueror' title='konqueror' width='25' height='25' border='0' /> konqueror"; } else { if (strstr($http_agent, "MSIE")) { $browser = "<img src='pic/referrers/ie.png' alt='IE' title='IE' width='25' height='25' border='0' /> IE"; } else { if (strstr($http_agent, "Chrome")) { $browser = "<img src='pic/referrers/chrome.png' alt='Chrome' title='Chrome' width='25' height='25' border='0' /> Chrome"; } else { if (strstr($http_agent, "Nav") || strstr($http_agent, "Gold") || strstr($http_agent, "X11") || strstr($http_agent, "Mozilla") || strstr($http_agent, "Netscape")) { $browser = "<img src='pic/referrers/firefox.png' alt='FireFox' title='FireFox' width='25' height='25' border='0' /> Mozilla"; } else { $browser = $lang['ref_unknow']; } } } } } $HTMLOUT .= "\n\t\t<tr>\n\t\t\t<td>" . $i . "</td>\n\t\t\t<td>" . get_date($data['date'], '') . "</td>\n\t\t\t<td>" . $browser . "</td>\n\t\t\t<td>" . htmlsafechars($data['ip']) . "</td>\n\t\t\t<td>" . htmlsafechars($data['ip']) . " " . ((int) $data['uid'] ? "<a href='{$INSTALLER09['baseurl']}/userdetails.php?id=" . (int) $data['uid'] . "'>" : "") . "" . (htmlsafechars($data['username']) ? " [" . htmlsafechars($data['username']) . "]</a>" : "{$lang['ref_guest']}") . "\n</td><td><a href='" . htmlsafechars($data['referer']) . "'>" . CutName($data['referer'], '50') . "</a></td><!--<td><a href='" . htmlsafechars($data['page']) . "'>{$lang['ref_view']}</a></td>--></tr>"; $browser = ''; } } $HTMLOUT .= "</table>"; $HTMLOUT .= $pager['pagerbottom']; } else { $HTMLOUT .= $lang['ref_nothing']; } ////////////////////////// HTML OUTPUT ////////////////////////// echo stdhead($lang['ref_stdhead']) . $HTMLOUT . stdfoot();
function get_video($sql, $limit, $type = '') { $arr = MySql::dbselect('id,name,url,duration,thumb,viewed', 'media', "{$sql} order by id desc limit {$limit}"); if ($type == 'rand') { for ($i = 0; $i < count($arr); $i++) { $name = $arr[$i][1]; $thumb = $arr[$i][4]; $mediaid = $arr[$i][0]; $duration = $arr[$i][3]; $viewed = $arr[$i][5]; $url = get_url($mediaid, $name, 'Xem Video'); $html .= "\n\t\t\t<li class=\"play-hover\">\n\t\t\t\t<a class=\"img\" href=\"{$url}\" title=\"{$name}\">\n\t\t\t\t\t<span class=\"over_play\"></span>\n\t\t\t\t\t<img src=\"{$thumb}\" alt=\"{$name}\">\n\t\t\t\t</a><span class=\"des-video\">{$duration}</span>\n\t\t\t\t<p class=\"title\">\n\t\t\t\t\t<a href=\"{$url}\" title=\"{$name}\">" . CutName($name, 20) . "</a>\n\t\t\t\t</p>\n\t\t\t\t</li>"; } } else { for ($i = 0; $i < count($arr); $i++) { $name = $arr[$i][1]; $thumb = $arr[$i][4]; $mediaid = $arr[$i][0]; $duration = $arr[$i][3]; $viewed = $arr[$i][5]; $url = get_url($mediaid, $name, 'Xem Video'); $html .= "\n\t\t\t<li style=\"float:left;height:400px\">\n\t\t\t<div class=\"hvideo clearfix\">\n\t\t\t\t<div class=\"video\">\n\t\t\t\t\t<img src=\"{$thumb}\" title=\"{$name}\" alt=\"{$name}\"/><a href=\"{$url}\"><span class=\"vdicon\"></span></a>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"info\">\n\t\t\t\t\t<h1>{$name}</h1>\n\t\t\t\t\t<span class=\"content\"><strong>Thời lượng</strong>: {$duration}</span>\n\t\t\t\t\t<span class=\"content\"><strong>Lượt xem</strong>: {$viewed}</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t</li>\n\t\t\t"; } } return $html; }
<span class="vtime"><?php echo $duration; ?> </span> <span class="over_play"></span> </a> <a href="<?php echo $url; ?> " title="<?php echo $name; ?> "> <span class="name"> <span class="vname"><?php echo CutName($name, 30); ?> </span> </span> </a> </li> <?php } ?> </ul> <div class="clear"></div> <?php echo $allpage_site; ?> </div> </div>
stdfoot(); die; } else { mysql_query("UPDATE snatched SET sl_warned='no' WHERE torrentid='" . $tid . "' AND userid='" . $uid . "'") or sqlerr(__FILE__, __LINE__); echo "<b><font color=red size=3>Successfully removed from the List</b></font>"; } } //$scp = 172800; $scp = 86400; $cpdt = sqlesc(get_date_time(gmtime() - $scp)); if ($_GET["done"] == "yes") { $add = "AND snatched.sl_warned='yes'"; } elseif ($_GET["done"] == "no") { $add = "AND snatched.sl_warned='no'"; } else { $add = ""; } $res = mysql_query("SELECT snatched.userid, snatched.torrentid, snatched.uploaded, snatched.downloaded, snatched.last_action, snatched.seedtime, snatched.sl_warned, users.username, users.immun, torrents.size, torrents.name FROM snatched JOIN users ON snatched.userid = users.id JOIN torrents ON torrents.id = snatched.torrentid WHERE snatched.finished='yes' AND snatched.seedtime < 43200 AND snatched.uploaded < (torrents.size / 2) AND snatched.seeder='no' AND users.enabled='yes' AND snatched.complete_date < {$cpdt} AND users.immun='no' {$add} AND users.class < " . UC_CODER . " ORDER BY users.id") or sqlerr(__FILE__, __LINE__); echo "<table><tr><h1>Users are not seeding and have not reached Fileratio/Minimum site seedtime :</h1></tr>"; echo "" . ($_GET["done"] == "no" ? "<table><tr style=\"border:none;\"><td style=\"border:none;\"><a href=\"" . $_SERVER['PHP_SELF'] . "?done=yes\">already h&r warned members</a></td></tr></table><br />" : "<table><tr style=\"border:none;\"><td style=\"border:none;\"><a href=\"" . $_SERVER['PHP_SELF'] . "?done=no\">not warned h&r users</a></td></tr></table><br />") . ""; if (mysql_num_rows($res) == 0) { echo "<table><tr><td class=colhead><font size=3>Cant believe,the list is empty!</font></td></tr></table>"; } else { echo "<table><tr><td class=colhead>Member</td><td class=colhead>Torrent</td><td class=colhead>Fileratio</td><td class=colhead>Seedtime</td><td class=colhead>last active</td><td class=colhead>Status</td></tr>"; while ($row = mysql_fetch_assoc($res)) { echo "<tr><td><a href=\"javascript:ajaxpage('inpageuser.php?id=" . $row["userid"] . "&tid=" . $row["torrentid"] . "', 'contentarea');\">" . $row["username"] . "</a><td><a href=details.php?id=" . $row["torrentid"] . ">" . CutName($row["name"], 45) . "</td><td>" . number_format($row["uploaded"] / $row["size"], 3) . "</td><td>" . mkprettytime($row["seedtime"]) . "</td><td>" . date("d.m.Y H:i:s", strtotime($row["last_action"])) . "</td><td>" . ($row["sl_warned"] == "no" ? "<a href=\"" . $_SERVER['PHP_SELF'] . "?addsl=1&tid=" . $row["torrentid"] . "&userid=" . $row["userid"] . "&done=no\">Warn</a>" : "Warn <a href=\"" . $_SERVER['PHP_SELF'] . "?remsl=1&tid=" . $row["torrentid"] . "&userid=" . $row["userid"] . "\">[R]</a>") . "</td></tr>"; } echo "</table>"; echo "<div id=\"contentarea\"></div>"; } stdfoot();
function torrenttable($res) { global $site_config, $CURUSER, $THEME, $LANGUAGE; //Define globals if ($site_config["MEMBERSONLY_WAIT"] && $site_config["MEMBERSONLY"] && in_array($CURUSER["class"], explode(",", $site_config["WAIT_CLASS"]))) { $gigs = $CURUSER["uploaded"] / (1024 * 1024 * 1024); $ratio = $CURUSER["downloaded"] > 0 ? $CURUSER["uploaded"] / $CURUSER["downloaded"] : 0; if ($ratio < 0 || $gigs < 0) { $wait = $site_config["WAITA"]; } elseif ($ratio < $site_config["RATIOA"] || $gigs < $site_config["GIGSA"]) { $wait = $site_config["WAITA"]; } elseif ($ratio < $site_config["RATIOB"] || $gigs < $site_config["GIGSB"]) { $wait = $site_config["WAITB"]; } elseif ($ratio < $site_config["RATIOC"] || $gigs < $site_config["GIGSC"]) { $wait = $site_config["WAITC"]; } elseif ($ratio < $site_config["RATIOD"] || $gigs < $site_config["GIGSD"]) { $wait = $site_config["WAITD"]; } else { $wait = 0; } } // Columns $cols = explode(",", $site_config["torrenttable_columns"]); $cols = array_map("strtolower", $cols); $cols = array_map("trim", $cols); $colspan = count($cols); // End // Expanding Area $expandrows = array(); if (!empty($site_config["torrenttable_expand"])) { $expandrows = explode(",", $site_config["torrenttable_expand"]); $expandrows = array_map("strtolower", $expandrows); $expandrows = array_map("trim", $expandrows); } // End echo '<table align="center" class="ttable_headinner" width="100%"><thead><tr class="ttable_head">'; foreach ($cols as $col) { switch ($col) { case 'category': echo "<th>" . T_("TYPE") . "</th>"; break; case 'name': echo "<th>" . T_("NAME") . "</th>"; break; case 'dl': echo "<th>" . T_("DL") . "</th>"; break; case 'uploader': echo "<th>" . T_("UPLOADER") . "</th>"; break; case 'comments': echo "<th>" . T_("COMM") . "</th>"; break; case 'nfo': echo "<th>" . T_("NFO") . "</th>"; break; case 'size': echo "<th>" . T_("SIZE") . "</th>"; break; case 'completed': echo "<th>" . T_("C") . "</th>"; break; case 'seeders': echo "<th>" . T_("S") . "</th>"; break; case 'leechers': echo "<th>" . T_("L") . "</th>"; break; case 'health': echo "<th>" . T_("HEALTH") . "</th>"; break; case 'external': if ($site_config["ALLOWEXTERNAL"]) { echo "<th>" . T_("L/E") . "</th>"; } break; case 'added': echo "<th>" . T_("ADDED") . "</th>"; break; case 'speed': echo "<th>" . T_("SPEED") . "</th>"; break; case 'wait': if ($wait) { echo "<th>" . T_("WAIT") . "</th>"; } break; case 'rating': echo "<th>" . T_("RATINGS") . "</th>"; break; } } if ($wait && !in_array("wait", $cols)) { echo "<th>" . T_("WAIT") . "</th>"; } echo "</tr></thead>"; while ($row = mysql_fetch_assoc($res)) { $id = $row["id"]; print "<tr class='t-row'>\n"; $x = 1; foreach ($cols as $col) { switch ($col) { case 'category': print "<td class='ttable_col{$x}' align='center' valign='middle'>"; if (!empty($row["cat_name"])) { print "<a href=\"torrents.php?cat=" . $row["category"] . "\">"; if (!empty($row["cat_pic"]) && $row["cat_pic"] != "") { print "<img border=\"0\"src=\"" . $site_config['SITEURL'] . "/images/categories/" . $row["cat_pic"] . "\" alt=\"" . $row["cat_name"] . "\" />"; } else { print $row["cat_parent"] . ": " . $row["cat_name"]; } print "</a>"; } else { print "-"; } print "</td>\n"; break; case 'name': $char1 = 35; //cut name length $smallname = htmlspecialchars(CutName($row["name"], $char1)); $dispname = "<b>" . $smallname . "</b>"; $last_access = $CURUSER["last_browse"]; $time_now = gmtime(); if ($last_access > $time_now || !is_numeric($last_access)) { $last_access = $time_now; } if (sql_timestamp_to_unix_timestamp($row["added"]) >= $last_access) { $dispname .= "<b><font color='#ff0000'> - (" . T_("NEW") . "!)</font></b>"; } if ($row["freeleech"] == 1) { $dispname .= " <img src='images/free.gif' border='0' alt='' />"; } print "<td class='ttable_col{$x}' nowrap='nowrap'>" . (count($expandrows) ? "<a href=\"javascript: klappe_torrent('t" . $row['id'] . "')\"><img border=\"0\" src=\"" . $site_config["SITEURL"] . "/images/plus.gif\" id=\"pict" . $row['id'] . "\" alt=\"Show/Hide\" class=\"showthecross\" /></a>" : "") . " <a title=\"" . $row["name"] . "\" href=\"torrents-details.php?id={$id}&hit=1\">{$dispname}</a></td>"; break; case 'dl': print "<td class='ttable_col{$x}' align='center'><a href=\"download.php?id={$id}&name=" . rawurlencode($row["filename"]) . "\"><img src='" . $site_config['SITEURL'] . "/images/icon_download.gif' border='0' alt=\"Download .torrent\" /></a></td>"; break; case 'uploader': echo "<td class='ttable_col{$x}' align='center'>"; if (($row["anon"] == "yes" || $row["privacy"] == "strong") && $CURUSER["id"] != $row["owner"] && $CURUSER["edit_torrents"] != "yes") { echo "Anonymous"; } elseif ($row["username"]) { echo "<a href='account-details.php?id={$row['owner']}'>{$row['username']}</a>"; } else { echo "Unknown"; } echo "</td>"; break; case 'comments': print "<td class='ttable_col{$x}' align='center'><font size='1' face='verdana'><a href='comments.php?type=torrent&id={$id}'>" . number_format($row["comments"]) . "</a></font></td>\n"; break; case 'nfo': if ($row["nfo"] == "yes") { print "<td class='ttable_col{$x}' align='center'><a href='nfo-view.php?id={$row['id']}'><img src='" . $site_config['SITEURL'] . "/images/icon_nfo.gif' border='0' alt='View NFO' /></a></td>"; } else { print "<td class='ttable_col{$x}' align='center'>-</td>"; } break; case 'size': print "<td class='ttable_col{$x}' align='center'>" . mksize($row["size"]) . "</td>\n"; break; case 'completed': print "<td class='ttable_col{$x}' align='center'><font color='orange'><b>" . number_format($row["times_completed"]) . "</b></font></td>"; break; case 'seeders': print "<td class='ttable_col{$x}' align='center'><font color='green'><b>" . number_format($row["seeders"]) . "</b></font></td>\n"; break; case 'leechers': print "<td class='ttable_col{$x}' align='center'><font color='#ff0000'><b>" . number_format($row["leechers"]) . "</b></font></td>\n"; break; case 'health': print "<td class='ttable_col{$x}' align='center'><img src='" . $site_config["SITEURL"] . "/images/health/health_" . health($row["leechers"], $row["seeders"]) . ".gif' alt='' /></td>\n"; break; case 'external': if ($site_config["ALLOWEXTERNAL"]) { if ($row["external"] == 'yes') { print "<td class='ttable_col{$x}' align='center'>" . T_("E") . "</td>\n"; } else { print "<td class='ttable_col{$x}' align='center'>" . T_("L") . "</td>\n"; } } break; case 'added': print "<td class='ttable_col{$x}' align='center'>" . date("d-m-Y H:i:s", utc_to_tz_time($row['added'])) . "</td>"; break; case 'speed': if ($row["external"] != "yes" && $row["leechers"] >= 1) { $speedQ = SQL_Query_exec("SELECT (SUM(downloaded)) / (UNIX_TIMESTAMP('" . get_date_time() . "') - UNIX_TIMESTAMP(started)) AS totalspeed FROM peers WHERE seeder = 'no' AND torrent = '{$id}' ORDER BY started ASC"); $a = mysql_fetch_assoc($speedQ); $totalspeed = mksize($a["totalspeed"]) . "/s"; } else { $totalspeed = "--"; } print "<td class='ttable_col{$x}' align='center'>{$totalspeed}</td>"; break; case 'wait': if ($wait) { $elapsed = floor((gmtime() - strtotime($row["added"])) / 3600); if ($elapsed < $wait && $row["external"] != "yes") { $color = dechex(floor(127 * ($wait - $elapsed) / 48 + 128) * 65536); print "<td class='ttable_col{$x}' align='center'><a href=\"faq.php#section46\"><font color=\"{$color}\">" . number_format($wait - $elapsed) . " h</font></a></td>\n"; } else { print "<td class='ttable_col{$x}' align='center'>--</td>\n"; } } break; case 'rating': if (!$row["rating"]) { $rating = "--"; } else { $rating = "<a title='{$row['rating']}/5'>" . ratingpic($row["rating"]) . "</a>"; } //$rating = ratingpic($row["rating"]); //$srating .= "$rpic (" . $row["rating"] . " out of 5) " . $row["numratings"] . " users have rated this torrent"; print "<td class='ttable_col{$x}' align='center'>{$rating}</td>"; break; } if ($x == 2) { $x--; } else { $x++; } } //Wait Time Check if ($wait && !in_array("wait", $cols)) { $elapsed = floor((gmtime() - strtotime($row["added"])) / 3600); if ($elapsed < $wait && $row["external"] != "yes") { $color = dechex(floor(127 * ($wait - $elapsed) / 48 + 128) * 65536); print "<td class='ttable_col{$x}' align='center'><a href=\"faq.php\"><font color=\"{$color}\">" . number_format($wait - $elapsed) . " h</font></a></td>\n"; } else { print "<td class='ttable_col{$x}' align='center'>--</td>\n"; } $colspan++; if ($x == 2) { $x--; } else { $x++; } } print "</tr>\n"; //Expanding area if (count($expandrows)) { print "<tr class='t-row'><td class='ttable_col{$x}' colspan='{$colspan}'><div id=\"kt" . $row['id'] . "\" style=\"margin-left: 2px; display: none;\">"; print "<table width='100%' border='0' cellspacing='0' cellpadding='0'>"; foreach ($expandrows as $expandrow) { switch ($expandrow) { case 'size': print "<tr><td><b>" . T_("SIZE") . "</b>: " . mksize($row['size']) . "</td></tr>"; break; case 'speed': if ($row["external"] != "yes" && $row["leechers"] >= 1) { $speedQ = SQL_Query_exec("SELECT (SUM(downloaded)) / (UNIX_TIMESTAMP('" . get_date_time() . "') - UNIX_TIMESTAMP(started)) AS totalspeed FROM peers WHERE seeder = 'no' AND torrent = '{$id}' ORDER BY started ASC"); $a = mysql_fetch_assoc($speedQ); $totalspeed = mksize($a["totalspeed"]) . "/s"; print "<tr><td><b>" . T_("SPEED") . ":</b> {$totalspeed}</td></tr>"; } break; case 'added': print "<tr><td><b>" . T_("ADDED") . ":</b> " . date("d-m-Y \\a\\t H:i:s", utc_to_tz_time($row['added'])) . "</td></tr>"; break; case 'tracker': if ($row["external"] == "yes") { print "<tr><td><b>" . T_("TRACKER") . ":</b> " . htmlspecialchars($row["announce"]) . "</td></tr>"; } break; case 'completed': print "<tr><td><b>" . T_("COMPLETED") . "</b>: " . number_format($row['times_completed']) . "</td></tr>"; break; } } print "</table></div></td></tr>\n"; } //End Expanding Area } print "</table><br />\n"; }
function torrenttable($records, $variant = "index") { global $pic_base_url, $DEFAULTBASEURL, $config, $php_file, $page_find, $lang_off, $language, $CURUSER, $ss_uri, $waiton, $wait1, $wait2, $wait3, $wait4, $oldtorrents, $progress, $cat_ico_uri; $q = sql_query("select count(id) as num, YEAR(added) as year, MONTH(added) as month , DAY(added) as day FROM torrents group by year,month,day ORDER BY day,month,year DESC") or print "error"; while ($a = mysql_fetch_assoc($q)) { $split[$a["year"] . $a["month"] . $a["day"]] = $a["num"]; } if ((bool) $waiton) { if ($CURUSER["class"] < UC_VIP) { $gigs = $CURUSER["uploaded"] / (1024 * 1024 * 1024); $ratio = $CURUSER["downloaded"] > 0 ? $CURUSER["uploaded"] / $CURUSER["downloaded"] : 0; if ($ratio < 0.5 || $gigs < 5) { $wait = $wait1; } elseif ($ratio < 0.65 || $gigs < 6.5) { $wait = $wait2; } elseif ($ratio < 0.8 || $gigs < 8) { $wait = $wait3; } elseif ($ratio < 0.95 || $gigs < 9.5) { $wait = $wait4; } else { $wait = 0; } } } if (get_user_class() >= UC_MODERATOR) { echo "<form method=post action=deltorrent.php?mode=delete>"; } ?> <table border="1" cellspacing=0 cellpadding=5 onMouseover="changeto(event, '#1E1E2A')" onMouseout="changeback(event, 'black')"> <tr> <?php // sorting by MarkoStamcar // modified by xuzo :)) $oldlink = ''; $count_get = 0; $char = ''; if (!isset($wait)) { $wait = 0; } $description = ''; $preres = ''; $type = ''; $sort = ''; $row = ''; 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 (isset($_GET["sort"]) && $_GET["sort"] == "1") { if (isset($_GET["type"]) && $_GET["type"] == "desc") { $link1 = "asc"; } else { $link1 = "desc"; } } if (isset($_GET["sort"]) && $_GET["sort"] == "2") { if (isset($_GET["type"]) && $_GET["type"] == "desc") { $link2 = "asc"; } else { $link2 = "desc"; } } if (isset($_GET["sort"]) && $_GET["sort"] == "3") { if (isset($_GET["type"]) && $_GET["type"] == "desc") { $link3 = "asc"; } else { $link3 = "desc"; } } if (isset($_GET["sort"]) && $_GET["sort"] == "4") { if (isset($_GET["type"]) && $_GET["type"] == "desc") { $link4 = "asc"; } else { $link4 = "desc"; } } if (isset($_GET["sort"]) && $_GET["sort"] == "5") { if (isset($_GET["type"]) && $_GET["type"] == "desc") { $link5 = "asc"; } else { $link5 = "desc"; } } if (isset($_GET["sort"]) && $_GET["sort"] == "6") { if (isset($_GET["type"]) && $_GET["type"] == "desc") { $link6 = "asc"; } else { $link6 = "desc"; } } if (isset($_GET["sort"]) && $_GET["sort"] == "7") { if (isset($_GET["type"]) && $_GET["type"] == "desc") { $link7 = "asc"; } else { $link7 = "desc"; } } if (isset($_GET["sort"]) && $_GET["sort"] == "8") { if (isset($_GET["type"]) && $_GET["type"] == "desc") { $link8 = "asc"; } else { $link8 = "desc"; } } if (isset($_GET["sort"]) && $_GET["sort"] == "9") { if (isset($_GET["type"]) && $_GET["type"] == "desc") { $link9 = "asc"; } else { $link9 = "desc"; } } if (isset($_GET["sort"]) && $_GET["sort"] == "10") { if (isset($_GET["type"]) && $_GET["type"] == "desc") { $link10 = "asc"; } else { $link10 = "desc"; } } if (empty($link1)) { $link1 = "asc"; } // for torrent name if (empty($link2)) { $link2 = "desc"; } if (empty($link3)) { $link3 = "desc"; } if (empty($link4)) { $link4 = "desc"; } if (empty($link5)) { $link5 = "desc"; } if (empty($link6)) { $link6 = "desc"; } if (empty($link7)) { $link7 = "desc"; } if (empty($link8)) { $link8 = "desc"; } if (empty($link9)) { $link9 = "desc"; } if (empty($link10)) { $link10 = "desc"; } ?> <td class="colhead" align="center"><?php echo $language['type']; ?> </td> <td class="colhead" align="left"><a href="browse.php?<?php echo $oldlink; ?> sort=1&type=<?php echo $link1; ?> "><?php echo $language['name']; ?> </a></td> <td class="colhead" align="left"><?php echo $language['subs']; ?> </td> <?php echo $variant == 'index' ? '<td class=colhead align=center><a href="bookmarks.php"><img src="' . $pic_base_url . 'bookmark.gif" border="0" alt="Bookmark" title="Bookmark" /></a></td>' : ''; if ((bool) $waiton) { print "<td class=\"colhead\" align=\"center\">" . $language['wait'] . "</td>\n"; } if ($oldtorrents) { ?> <td class="colhead" align="center"><a href="browse.php?<?php echo $oldlink; ?> sort=4&type=<?php echo $link4; ?> "> <img src=pic/added.gif border=0 alt=TTL /></a></td> <?php } ?> <td class="colhead" align="left"><a href="browse.php?<?php echo $oldlink; ?> sort=2&type=<?php echo $link2; ?> "> <img src=pic/files.gif border=0 alt=Files /></a></td> <td class="colhead" align="left"><a href="browse.php?<?php echo $oldlink; ?> sort=3&type=<?php echo $link3; ?> "><img src=pic/comments.gif border=0 alt=Comments /></a></td> <td class="colhead" align="center"><img src="pic/download.gif" border=0 alt=download /></td> <td class="colhead" align="center"><?php echo $language['prog']; ?> </td> <td class="colhead" align="center"><a href="browse.php?<?php echo $oldlink; ?> sort=6&type=<?php echo $link6; ?> "><?php echo $language['size']; ?> </a></td> <td class="colhead" align="center"><a href="browse.php?<?php echo $oldlink; ?> sort=7&type=<?php echo $link7; ?> "> <img src=pic/top2.gif border=0 alt=Snatched /></a></td> <td class="colhead" align="center"><a href="browse.php?<?php echo $oldlink; ?> sort=8&type=<?php echo $link8; ?> "> <img src=pic/arrowup2.gif border="0" alt=Seeders /> </a></td> <td class="colhead" align="center"><a href="browse.php?<?php echo $oldlink; ?> sort=9&type=<?php echo $link9; ?> "> <img src=pic/arrowdown2.gif border="0" alt=Leechers /> </a></td> <?php if ($variant == "index") { echo "<td class=\"colhead\" align=\"center\"><a href=\"browse.php?{$oldlink}sort=9&type={$link9}\"><img border=0 src=\"/pic/upper.gif\" alt=\"Upped By\" /></a></td>\n"; } if (get_user_class() >= UC_MODERATOR) { echo "<td class=\"colhead\" align=center>" . $language['delete'] . "</td>\n"; } echo "</tr>\n"; foreach ($records as $row) { // while ($row = mysql_fetch_assoc($res)) { if ($CURUSER['split'] == "yes" && $_SERVER["REQUEST_URI"] == "/browse.php" && !isset($_GET["page"])) { /** * * @author StarionTurbo * @copyright 2007 * @modname Show torrents by day * @version v1.0 */ /** * * Make some date varibles * */ $day_added = $row['added']; $day_show = strtotime($day_added); $thisdate = date('Y-m-d', $day_show); $thisdate2 = date("Ynj", $day_show); /** * * If date already exist, disable $cleandate varible * */ // if($thisdate==$prevdate){ if (isset($prevdate) && $thisdate == $prevdate) { $cleandate = ''; /** * * If date does not exist, make some varibles * */ } else { $num = isset($split[$thisdate2]) ? $split[$thisdate2] : 0; $day_added = 'Upped on ' . date('l, j. M', strtotime($row['added'])); // You can change this to something else $cleandate = "<tr><td colspan=\"15\"><b>{$day_added} (" . $num . " torrent" . ($num > 1 ? "s" : "") . ")</b></td></tr>\n"; // This also... } /** * * Prevent that "torrents added..." wont appear again with the same date * */ $prevdate = $thisdate; $man = array('Jan' => 'January', 'Feb' => 'February', 'Mar' => 'March', 'Apr' => 'April', 'May' => 'May', 'Jun' => 'June', 'Jul' => 'July', 'Aug' => 'August', 'Sep' => 'September', 'Oct' => 'October', 'Nov' => 'November', 'Dec' => 'December'); foreach ($man as $eng => $ger) { $cleandate = str_replace($eng, $ger, $cleandate); } $dag = array('Mon' => 'Monday', 'Tues' => 'Tuesday', 'Wednes' => 'Wednesday', 'Thurs' => 'Thursday', 'Fri' => 'Friday', 'Satur' => 'Saturday', 'Sun' => 'Sunday'); foreach ($dag as $eng => $ger) { $cleandate = str_replace($eng . 'day', $ger . '', $cleandate); } /** * * If torrents not listed by added date * */ if ($row["sticky"] == "no") { // delete this line if you dont have sticky torrents or you want to display the addate for them also if (!isset($_GET['sort']) && !isset($_GET['d'])) { echo $cleandate . "\n"; } } } //ends the condition // ///standard sticky torrent hlight//////// /* $id = $row["id"]; if ($row["sticky"] == "yes"){ echo("<tr class=highlight>\n"); } else { echo("<tr>\n"); }*/ // ////End Sticky only highlight///////////////// // /////highlight torrenttable//////////////// $id = $row['id']; if ($CURUSER["ttablehl"] != "yes") { echo '<tr>'; } else { $countstatsclr = ($CURUSER['stylesheet'] == "1" ? "teal" : "") . ($CURUSER['stylesheet'] == "2" ? "teal" : "") . ($CURUSER['stylesheet'] == "3" ? "teal" : "") . ($CURUSER['stylesheet'] == "4" ? "teal" : "") . ($CURUSER['stylesheet'] == "5" ? "teal" : "") . ($CURUSER['stylesheet'] == "6" ? "teal" : "") . ($CURUSER['stylesheet'] == "7" ? "teal" : ""); $nukedclr = ($CURUSER['stylesheet'] == "1" ? "red" : "") . ($CURUSER['stylesheet'] == "2" ? "red" : "") . ($CURUSER['stylesheet'] == "3" ? "red" : "") . ($CURUSER['stylesheet'] == "4" ? "red" : "") . ($CURUSER['stylesheet'] == "5" ? "red" : "") . ($CURUSER['stylesheet'] == "6" ? "red" : "") . ($CURUSER['stylesheet'] == "7" ? "red" : ""); $sceneclr = ($CURUSER['stylesheet'] == "1" ? "orange" : "") . ($CURUSER['stylesheet'] == "2" ? "orange" : "") . ($CURUSER['stylesheet'] == "3" ? "orange" : "") . ($CURUSER['stylesheet'] == "4" ? "orange" : "") . ($CURUSER['stylesheet'] == "5" ? "orange" : "") . ($CURUSER['stylesheet'] == "6" ? "orange" : "") . ($CURUSER['stylesheet'] == "7" ? "orange" : ""); $requestclr = ($CURUSER['stylesheet'] == "1" ? "#777777" : "") . ($CURUSER['stylesheet'] == "2" ? "#777777" : "") . ($CURUSER['stylesheet'] == "3" ? "#777777" : "") . ($CURUSER['stylesheet'] == "4" ? "#777777" : "") . ($CURUSER['stylesheet'] == "5" ? "#777777" : "") . ($CURUSER['stylesheet'] == "6" ? "#777777" : "") . ($CURUSER['stylesheet'] == "7" ? "#777777" : ""); $stickyclr = ($CURUSER['stylesheet'] == "1" ? "gold" : "") . ($CURUSER['stylesheet'] == "2" ? "gold" : "") . ($CURUSER['stylesheet'] == "3" ? "gold" : "") . ($CURUSER['stylesheet'] == "4" ? "gold" : "") . ($CURUSER['stylesheet'] == "5" ? "gold" : "") . ($CURUSER['stylesheet'] == "6" ? "gold" : "") . ($CURUSER['stylesheet'] == "7" ? "gold" : ""); $hl = ($row['countstats'] == "no" && $row['nuked'] == "no" ? $countstatsclr : "") . ($row['scene'] == "yes" && $row['request'] == "no" && $row['nuked'] == "no" ? $sceneclr : "") . ($row['request'] == "yes" && $row['scene'] == "no" && $row['nuked'] == "no" ? $requestclr : "") . ($row['sticky'] == "yes" ? $stickyclr : "") . ($row['nuked'] == "yes" ? $nukedclr : ""); // //comment out to use gif indicate for seeding/leeching lower////// $req = sql_query("SELECT torrent, seeder FROM peers WHERE userid={$CURUSER['id']} AND torrent={$id}") or sqlerr(); if (mysql_num_rows($req) > 0) { $peerid = mysql_fetch_assoc($req); } if ($peerid['seeder'] == 'yes' && $peerid['torrent'] == $id) { $hl = '#00AB3F'; } if ($peerid['seeder'] == 'no' && $peerid['torrent'] == $id) { $hl = '#b22222 '; } $bgc = "bgcolor=" . $hl . ""; echo '<tr ' . $bgc . '>'; } // //////////////////end highlight torrenttable - comment out to use standard or gif indicator code lower///////// echo "<td align=center style='padding: 0px'>"; // cached category icons include 'include/cache/categories.php'; foreach ($categories as $cat) { if ($cat["id"] == $row["category"]) { echo "<a href=\"browse.php?cat=" . $cat["id"] . "\"><img src=\"pic/caticons/{$cat_ico_uri}/" . $cat["image"] . "\" border=\"0\" title=\"category " . $cat["name"] . "\" /></a>"; } } echo "</td>\n"; // end cat icon cache // ///////added under torrent name - uncomment out to use//// //$added = "$row[added] (" . get_elapsed_time(sql_timestamp_to_unix_timestamp($row["added"])) . " ago)"; // ////////////////////////////////////end added/////////// $genre = safeChar($row["newgenre"]); $nukereason = safeChar($row["nukereason"]); $scene = $row["scene"] == "yes" ? " <img src='pic/scene.gif' border=0 title='Scene' alt='Scene'/>" : ""; $request = $row["request"] == "yes" ? " <img src='pic/request.gif' border=0 title='Request' alt='Request'/>" : ""; $nuked = $row["nuked"] == "yes" ? " <img src='pic/nuked.gif' border=0 title='nuked' alt='Nuked'/>" : ""; $newtag = sql_timestamp_to_unix_timestamp($row['added']) >= $_SESSION['browsetime'] ? ' <img src=' . $pic_base_url . 'new.gif alt=NEW!>' : ''; $viponly = $row["vip"] == "yes" ? "<img src='pic/star.gif' border=0 title='Vip Torrent' />" : ""; // ///////freeslot in use on browse////////// $freeimg = '<img src="/pic/freedownload.gif" border=0"/>'; $doubleimg = '<img src="/pic/doubleseed.gif" border=0"/>'; $isdlfree = $row['doubleslot'] == 'yes' ? ' ' . $doubleimg . ' slot in use' : ''; $isdouble = $row['freeslot'] == 'yes' ? ' ' . $freeimg . ' slot in use' : ''; $uclass = ''; // torrent name $dispname = $CURUSER["view_uclass"] == 'no' ? safeChar($row["name"]) : "<font color=\"#" . get_user_class_color($row["uclass"]) . "\">" . safeChar($row["name"]) . "</font>"; // checked mod by pdq $checked = !empty($row['checked_by']) && $CURUSER['class'] >= UC_MODERATOR ? " <img src='" . $pic_base_url . "mod.gif' width='15' border='0' title='Checked - by " . safeChar($row['checked_by']) . "' />" : ""; $sticky = $row["sticky"] == "yes" ? "<img src='pic/sticky.gif' border='0' alt='sticky' title='Sticky'>" : ""; $countstats = $row["countstats"] == "no" ? "<img src='pic/freedownload.gif' border='0' alt='Free' title='Free Torrent'>" : ""; $half = $row["half"] == "yes" ? "<img src='pic/halfdownload.png' border='0' alt='Half Leech' title='Half Leech'>" : ""; // /// ///////////small description if (!empty($row['description'])) { $description = "(" . safeChar($row["description"]) . ")"; } else { $description = ""; } // //////////////////////////////////////////////////////////////////////// // //////////////////////////////////////////////////////////////////////// if ($row["poster"]) { $poster = "<img src=" . $row["poster"] . " width=150 border=0 />"; } if ($row["descr"]) { $descr = ereg_replace("\"", """, readMore($row["descr"], 350, "details.php?id=" . $row["id"] . "&hit=1")); } // userclass color mod ==end $dispname = ereg_replace('\\.', ' ', $dispname); echo "<td align=left><a href=details.php?id={$id} onmouseover=\"Tip('{$poster}');\" onmouseout=\"UnTip();\"><b>" . CutName($dispname, $char) . "</b></a> <a href=\"javascript:klappe_descr('descr" . $row["id"] . "');\" ><img src=\"/pic/plus.gif\" border=\"0\" title=\"Show torrent info in this page\"/></a> {$sticky} {$request} {$scene} {$nuked}<br />{$nukereason} {$newtag} {$viponly} {$countstats} {$half} {$description}\n"; // //////////multiplicator/// if ($row["multiplicator"] == "2") { $multiplicator = " <img src=\"pic/multi2.gif\" title=\"X2 Upload\"> "; } elseif ($row["multiplicator"] == "3") { $multiplicator = " <img src=\"pic/multi3.gif\" title=\"X3 Upload\"> "; } elseif ($row["multiplicator"] == "4") { $multiplicator = " <img src=\"pic/multi4.gif\" title=\"X4 Upload\"> "; } elseif ($row["multiplicator"] == "5") { $multiplicator = " <img src=\"pic/multi5.gif\" title=\"X5 Upload\"> "; } if ($row["multiplicator"] != "0") { echo "" . $multiplicator . ""; } if ($row["pweb"] > 0) { echo "<img border=0 src=pic/seeder.gif onmouseover=\"Tip('web seeded by " . $row["pweb"] . " users');\" onmouseout=\"UnTip();\"/>"; } // ////torrent added/genre/checked//// //echo ($added); echo $genre; echo $checked; echo $isdlfree . '' . $isdouble; /////////////////subtitles $movie_cat = array("3", "5", "10", "11"); //add here your movie category print "<td align=\"center\" nowrap=\"nowrap\" >\n"; if (in_array($row["category"], $movie_cat) && !empty($row["subs"])) { $subs_array = explode(",", $row["subs"]); include 'cache/subs.php'; foreach ($subs_array as $k => $sid) { foreach ($subs as $sub) { if ($sub["id"] == $sid) { print "<img border=\"0\" width=\"16px\" style=\"padding:3px;\"src=\"" . $sub["pic"] . "\" alt=\"" . $sub["name"] . "\" title=\"" . $sub["name"] . "\" />"; } } } } else { echo "---"; } echo "</td>"; ///////////////////end subs///////// //////////////////bookmarks///////// $bookmarked = !isset($row["bookmark"]) ? '<a href=\'bookmark.php?torrent=' . $id . '&action=add\'><img src=\'' . $pic_base_url . 'bookmark.gif\' border=\'0\' alt=\'Bookmark it!\' title=\'Bookmark it!\' /></a>' : '<a href="bookmark.php?torrent=' . $id . '&action=delete"><img src=\'' . $pic_base_url . 'plus2.gif\' border=\'0\' alt=\'Delete Bookmark!\' title=\'Delete Bookmark!\' /></a>'; echo $variant == 'index' ? '<td align=right>' . $bookmarked . '</td>' : ''; // == wait times on/off from admincp if ((bool) $waiton) { if ((int) $wait > 0) { $elapsed = floor((gmtime() - strtotime($row["added"])) / 3600); if ($elapsed < $wait) { $color = dechex(floor(127 * ($wait - $elapsed) / 48 + 128) * 65536); print "<td align=center nowrap=\"nowrap\"><a href=\"faq.php#dl8\"><font color=\"{$color}\">" . number_format($wait - $elapsed) . " h</font></a></td>\n"; } else { print "<td align=center>None</td>\n"; } } else { print "<td align=center>None</td>\n"; } } /////////////////ttl on/off from admincp if ($oldtorrents) { $ttl = 28 * 24 - floor((gmtime() - sql_timestamp_to_unix_timestamp($row["added"])) / 3600); if ($ttl == 1) { $ttl .= "<br />hour"; } else { $ttl .= "<br />hours"; } echo '<td align=center>' . $ttl . '</td>'; } ///////////////////////////////// if (isset($row['type']) && $row['type'] == "single") { // if ($row["type"] == "single") echo "<td align=\"right\">" . $row["numfiles"] . "</td>\n"; } else { if ($variant == "index") { echo "<td align=\"right\"><b><a href=\"details.php?id={$id}&hit=1\">" . $row["numfiles"] . "</a></b></td>\n"; } } ////////////////////////////////////////// if (!$row["comments"]) { echo "<td align=\"right\">" . $row["comments"] . "</td>\n"; } else { if ($variant == "index") { echo "<td align=\"right\"><b><a href=\"details.php?id={$id}&hit=1&tocomm=1\">" . $row["comments"] . "</a></b></td>\n"; } else { echo "<td align=\"right\"><b><a href=\"details.php?id={$id}&page=0#startcomments\">" . $row["comments"] . "</a></b></td>\n"; } } // ////Hide the quick download if download disabled///// if ($CURUSER["downloadpos"] == 'no') { echo "<td class=embedded><img src=" . $pic_base_url . "downloadpos.gif alt='no download' style='margin-left: 4pt' /></td>\n"; } else { if ($CURUSER["downloadpos"] == 'yes') { echo "<td align=\"center\"><a href=\"/download.php/{$id}/" . rawurlencode($row["filename"]) . "\"><img src=pic/download.gif border=0 alt=Download /></a></td>\n"; } } // Progressbar Mod // /comment out to remove indicator on browse////// $seedersProgressbar = array(); $leechersProgressbar = array(); $progressPerTorrent = 0; $iProgressbar = 0; if (isset($progress[$row["id"]])) { foreach ($progress[$row["id"]] as $rowProgressbar) { $progressPerTorrent += sprintf("%.2f", 100 * (1 - $rowProgressbar["to_go"] / $rowProgressbar["size"])); $iProgressbar++; } } if ($iProgressbar == 0) { $iProgressbar = 1; } $progressTotal = sprintf("%.2f", $progressPerTorrent / $iProgressbar); $picProgress = get_percent_completed_image(floor($progressTotal)) . "<br/>(" . round($progressTotal) . "%)"; echo "<td align=center>{$picProgress}</td>\n"; // End Progress Bar mod////////////////////////// echo "<td align=center>" . str_replace(" ", "<br/>", prefixed($row["size"])) . "</td>\n"; $_s = ""; if ($row["times_completed"] != 1) { $_s = "s"; } if (get_user_class() >= UC_MODERATOR) { echo "<td align=center>" . ($row["times_completed"] > 0 ? "<a href=snatches.php?id={$id}>" . safeChar(number_format($row["times_completed"])) . "<br/>time{$_s}</a>" : "0 times") . "</td>\n"; } else { echo "<td align=center>" . ($row["times_completed"] > 0 ? "" . safeChar(number_format($row["times_completed"])) . "<br/>time{$_s}</a>" : "0 times") . "</td>\n"; } if ($row["seeders"]) { if ($variant == "index") { if ($row["leechers"]) { $ratio = $row["seeders"] / $row["leechers"]; } else { $ratio = 1; } echo "<td align=right><b><a href=details.php?id={$id}&hit=1#seeders><font color=" . get_slr_color($ratio) . ">" . $row["seeders"] . "</font></a></b></td>\n"; } else { echo "<td align=\"right\"><b><a class=\"" . linkcolor($row["seeders"]) . "\" href=\"details.php?id={$id}#seeders\">" . $row["seeders"] . "</a></b></td>\n"; } } else { echo "<td align=\"right\"><span class=\"" . linkcolor($row["seeders"]) . "\">" . $row["seeders"] . "</span></td>\n"; } $peerlink = ''; if ($row["leechers"]) { if ($variant == "index") { echo "<td align=right><b><a href=details.php?id={$id}&hit=1&#leechers>" . number_format($row["leechers"]) . ($peerlink ? "</a>" : "") . "</b></td>\n"; } else { echo "<td align=\"right\"><b><a class=\"" . linkcolor($row["leechers"]) . "\" href=\"details.php?id={$id}#leechers\">" . $row["leechers"] . "</a></b></td>\n"; } } else { echo "<td align=\"right\">0</td>\n"; } // //Anonymous and delete torrent begin if ($variant == "index") { if ($row["anonymous"] == "yes") { echo "<td align=center><i>Anonymous</i></td>\n"; if (get_user_class() >= UC_MODERATOR) { echo "<td align=\"center\" bgcolor=\"#FF0000\"><input type=\"checkbox\" name=\"delete[]\" value=\"" . safeChar($id) . "\" /></td>\n"; } } else { if ($variant == "index") { if ($CURUSER["view_uclass"] == 'yes') { echo "<td align=center>" . (isset($row["username"]) ? "<a href=userdetails.php?id=" . $row["owner"] . "><font color=\"#" . get_user_class_color($row["uclass"]) . "\">" . safeChar($row["username"]) . "</font></a>" : "<i>(unknown)</i>") . "</td>\n"; } else { echo "<td align=center>" . (isset($row["username"]) ? "<a href=userdetails.php?id=" . $row["owner"] . "><b>" . safechar($row["username"]) . "</b></a>" : "<i>(unknown)</i>") . "</td>\n"; } } // ///////modified Delete torrent with anonymous uploader if (get_user_class() >= UC_MODERATOR) { echo "<td align=\"center\" bgcolor=\"#FF0000\"><input type=\"checkbox\" name=\"delete[]\" value=\"" . safeChar($id) . "\" /></td>\n"; } } } echo "</tr>\n"; echo "<tr id=\"kdescr" . $row["id"] . "\"style=\"display:none;\"><td width=\"90%\" colspan=\"" . (get_user_class() >= UC_MODERATOR ? "15" : "13") . "\">" . $descr . "</td></tr>\n"; } if (get_user_class() >= UC_MODERATOR) { echo "<tr ><td align=\"center\" colspan=16><input type=submit value=Delete /></td></tr>\n"; } echo "</table></form>\n"; }
<th class="table_head" align="left">Torrent Name</th> <th class="table_head" align="left">Size</th> <th class="table_head">Added</th> <th class="table_head"><img src="images/down.png" border="0" title="Download"></th> <th class="table_head"><img src="images/comment.png" border="0" title="Comments"></th> <th class="table_head"><img src="images/seed.gif" border="0" title="Seeders"></th> <th class="table_head"><img src="images/leech.gif" border="0" title="Leechers"></th> <th class="table_head"><img src="images/check.png" border="0" title="Completed"></th> <th class="table_head">L/E</th> <th class="table_head"><img src="images/trash.png" title="Delete Bookmarks" border="0"></th> </tr> <?php while ($row = mysql_fetch_assoc($query)) { $length = 40; //===| Cut name length $smallname = htmlspecialchars(CutName($row["name"], $length)); $dispname = "<b>" . $smallname . "</b>"; if ($row["freeleech"] == 1) { $freeleech = "<img src='images/free.gif' border='0' title='Free Leech'>"; } else { $freeleech = ""; } echo "<tr>"; print "<td class='table_col1' width='1%' align='center' valign='middle'>"; if (!empty($row["cat_name"])) { print "<a href=\"torrents.php?cat=" . $row["category"] . "\">"; if (!empty($row["cat_pic"]) && $row["cat_pic"] != "") { print "<img border=\"0\" src=\"" . $site_config['SITEURL'] . "/images/categories/" . $row["cat_pic"] . "\" title=\"" . $row["cat_parent"] . ": " . $row["cat_name"] . "\" />"; } else { print $row["cat_parent"] . ": " . $row["cat_name"]; }
// / Mod by dokty - tbdev.net $blasd = sql_query("SELECT points FROM coins WHERE torrentid={$id} AND userid=" . unsafeChar($CURUSER["id"])); $sdsa = mysql_fetch_assoc($blasd) or $sdsa["points"] = 0; tr("Points", "<b>In total " . safeChar($row["points"]) . " Points given to this torrent of which " . safeChar($sdsa["points"]) . " from you.<br /><br />By clicking on the coins you can give points to the uploader of this torrent.</b><br /><br /><a href=coins.php?id={$id}&points=10><img src=pic/10coin.jpg border=0></a> <a href=coins.php?id={$id}&points=20><img src=pic/20coin.jpg border=0></a> <a href=coins.php?id={$id}&points=50><img src=pic/50coin.jpg border=0></a> <a href=coins.php?id={$id}&points=100><img src=pic/100coin.jpg border=0></a> <a href=coins.php?id={$id}&points=200><img src=pic/200coin.gif border=0></a> <a href=coins.php?id={$id}&points=500><img src=pic/500coin.gif border=0></a> <a href=coins.php?id={$id}&points=1000><img src=pic/1000coin.gif border=0></a>", 1); // //////////end modified bonus points for uploader/////// function hex_esc($matches) { return sprintf("%02x", ord($matches[0])); } tr("Info hash", preg_replace_callback('/./s', "hex_esc", hash_pad($row["info_hash"]))); } else { tr("Download", "You are not allowed to download"); } //////////////////poster mod if (!empty($row["poster"])) { tr("" . $language['pos'] . "", "<a href=\"javascript: klappe_news('a3')\"><img border=\"0\" src=\"pic/plus.gif\" id=\"pica3" . $array['id'] . "\" alt=\"[Hide/Show]\"></a><div id=\"ka3\" style=\"display: none;\"><br><a href='" . safeChar($row["poster"]) . "' rel='lightbox' title='" . CutName(safeChar($row["name"]), 35) . "'><img src='" . safeChar($row["poster"]) . "' border=0 width=150></a></div>", 1); } else { tr("" . $language['pos'] . "", "<a href=\"javascript: klappe_news('a3')\"><img border=\"0\" src=\"pic/plus.gif\" id=\"pica3" . $array['id'] . "\" alt=\"[Hide/Show]\"></a><div id=\"ka3\" style=\"display: none;\"><br>Poster Not Available</div>", 1); } ///////////////youtube sample////////////// if (!empty($row["tube"])) { tr("" . $language['sam'] . "", "<a href=\"javascript: klappe_news('a2')\"><img border=\"0\" src=\"pic/plus.gif\" id=\"pica2" . $array['id'] . "\" alt=\"[Hide/Show]\"></a><div id=\"ka2\" style=\"display: none;\"><br><embed src='" . str_replace("watch?v=", "v/", htmlspecialchars($row["tube"])) . "' type=\"application/x-shockwave-flash\" width=\"500\" height=\"410\"></embed></div>", 1); } else { tr("" . $language['sam'] . "", "<a href=\"javascript: klappe_news('a2')\"><img border=\"0\" src=\"pic/plus.gif\" id=\"pica2" . $array['id'] . "\" alt=\"[Hide/Show]\"></a><div id=\"ka2\" style=\"display: none;\"><br>Sample Not Available</div>", 1); } //////////////////description//////////////// if ($dtype) { tr("" . $language['desc'] . "", "<a href=\"javascript: klappe_news('a1')\"><img border=\"0\" src=\"pic/plus.gif\" id=\"pica1" . $array['id'] . "\" alt=\"[Hide/Show]\"></a><div id=\"ka1\" style=\"display: none;\"><br>" . format_comment($row["descr"]) . "</div>", 1); } else { tr("" . $language['desc'] . "", "<a href=\"javascript: klappe_news('a1')\"><img border=\"0\" src=\"pic/plus.gif\" id=\"pica1" . $array['id'] . "\" alt=\"[Hide/Show]\"></a><div id=\"ka1\" style=\"display: none;\"><br>" . format_urls($row["descr"]) . "</div>", 1); }
} } ?> <tr> <td class="table_col1" align="center" width="10%"><a href="account-details.php?id=<?php echo $row['addedby']; ?> "><?php echo $row['username']; ?> </a></td> <td class="table_col2" align="center" width="15%"><a href="<?php echo $link; ?> "><?php echo CutName($r[0], 40); ?> </a></td> <td class="table_col1" align="center" width="10%"><?php echo $row['type']; ?> </td> <td class="table_col2" align="center" width="50%"><?php echo htmlspecialchars($row['reason']); ?> </td> <td class="table_col1" align="center" width="10%"><?php echo $dealtwith; ?> </td> <td class="table_col2" align="center" width="5%"><input type="checkbox" name="reports[]" value="<?php
// Get last post info $post_res = SQL_Query_exec("SELECT added,topicid,userid FROM forum_posts WHERE id={$lastpostid}"); if (mysql_num_rows($post_res) == 1) { $post_arr = mysql_fetch_assoc($post_res) or showerror(T_("ERROR"), "Bad forum last_post"); $lastposterid = $post_arr["userid"]; $lastpostdate = utc_to_tz($post_arr["added"]); $lasttopicid = $post_arr["topicid"]; $user_res = SQL_Query_exec("SELECT username FROM users WHERE id={$lastposterid}"); $user_arr = mysql_fetch_assoc($user_res); $lastposter = htmlspecialchars($user_arr['username']); $topic_res = SQL_Query_exec("SELECT subject FROM forum_topics WHERE id={$lasttopicid}"); $topic_arr = mysql_fetch_assoc($topic_res); $lasttopic = stripslashes(htmlspecialchars($topic_arr['subject'])); //cut last topic $latestleng = 10; $lastpost = "<small><a href='../community/?action=viewtopic&topicid={$lasttopicid}&page=last#last'>" . CutName($lasttopic, $latestleng) . "</a> by <a href='../user/?id={$lastposterid}'>{$lastposter}</a><br />{$lastpostdate}</small>"; if ($CURUSER) { $r = SQL_Query_exec("SELECT lastpostread FROM forum_readposts WHERE userid={$CURUSER['id']} AND topicid={$lasttopicid}"); $a = mysql_fetch_row($r); } //define the images for new posts or not on index if ($a && $a[0] == $lastpostid) { $img = "folder"; } else { $img = "folder_new"; } } else { $lastpost = "<span class='small'>No Posts</span>"; $img = "folder"; } //following line is each forums display
$topic_status = $post_arr['topic_status']; switch ($topic_status) { case 'ok': $topic_status_image = ''; break; case 'recycled': $topic_status_image = ' <img src="pic/forums/recycle_bin.gif" alt="Recycled" title="this topic is currently in the recycle-bin" />'; break; case 'deleted': $topic_status_image = ' <img src="pic/forums/delete_icon.gif" alt="Deleted" title="this topic is currently deleted" />'; break; } $last_post = '<span style="white-space:nowrap;">Last Post by: ' . print_user_stuff($post_arr) . ' <span style="font-size: x-small;"> [ ' . get_user_class_name($post_arr['class']) . ' ] </span><br /> in ► <a class="altlink" href="forums.php?action=view_topic&topic_id=' . $last_topic_id . '&page=' . $last_post_id . '#' . $last_post_id . '" title="' . htmlentities($post_arr['topic_name'], ENT_QUOTES) . '"> <span style="font-weight: bold;">' . CutName(htmlentities($post_arr['topic_name'], ENT_QUOTES), 30) . '</span></a>' . $topic_status_image . '<br /> ' . get_date($post_arr['added'], '') . '<br /></span>'; //=== last post read in topic $last_unread_post_res = sql_query('SELECT last_post_read FROM read_posts WHERE user_id=' . $CURUSER['id'] . ' AND topic_id=' . $last_post_id); $last_unread_post_arr = mysql_fetch_row($last_unread_post_res); $last_unread_post_id = $last_unread_post_arr[0] >= 0 ? $last_unread_post_arr[0] : $first_post_arr['first_post_id']; $image_to_use = $post_arr['added'] > time() - $readpost_expiry ? !$last_unread_post_arr || $last_post_id > $last_unread_post_arr[0] : 0; $img = $image_to_use ? 'unlockednew' : 'unlocked'; } else { $last_post = 'N/A'; $img = 'unlocked'; } $sub_forums_stuff .= '<tr> <td align="left" class="' . $class . '"><table border="0" cellspacing="0" cellpadding="0"> <tr> <td class="' . $class . '" style="padding-right: 5px"><img src="pic/forums/' . $img . '.gif" alt="' . $img . '" title="' . $img . '" /></td>
</th> <th><?php echo T_("ADDED"); ?> </th> <th><?php echo T_("EDIT"); ?> </th> </tr> <?php while ($row = mysql_fetch_assoc($query)) { $char1 = 35; //cut length $smallname = CutName(htmlspecialchars($row["name"]), $char1); echo "<tr><td class='table_col2' align='center'>{$row['cat_parent']}: {$row['cat_name']}</td><td class='table_col1' align='left'><a href='torrents-details.php?id={$row['id']}'>{$smallname}</a></td><td class='table_col2' align='center'><a href='comments.php?type=torrent&id={$row['id']}'>" . number_format($row["comments"]) . "</a></td><td class='table_col1' align='center'>" . number_format($row["hits"]) . "</td><td class='table_col2' align='center'>" . number_format($row["seeders"]) . "</td><td class='table_col1' align='center'>" . number_format($row["leechers"]) . "</td><td class='table_col2' align='center'>" . number_format($row["times_completed"]) . "</td><td class='table_col1' align='center'>" . get_elapsed_time(sql_timestamp_to_unix_timestamp($row["added"])) . "</td><td class='table_col2'><a href='torrents-edit.php?id={$row['id']}'>EDIT</a></td></tr>\n"; } echo "</table><br />"; print "<p align='center'>{$pagemenu}<br />{$browsemenu}</p>"; } end_frame(); } /////////////////////// EDIT SETTINGS //////////////// if ($action == "edit_settings") { if ($do == "edit") { begin_frame(T_("EDIT_ACCOUNT_SETTINGS")); navmenu(); ?> <form enctype="multipart/form-data" method="post" action="account.php">
$catdropdown .= "</select>\n"; //END CATDROPDOWN //UPDATE TORRENTLANG DROPDOWN $langdropdown = "<select name=\"language\"><option value='0'>Unknown</option>\n"; $lang = langlist(); foreach ($lang as $lang) { $langdropdown .= "<option value=\"" . $lang["id"] . "\""; if ($lang["id"] == $row["torrentlang"]) { $langdropdown .= " selected=\"selected\""; } $langdropdown .= ">" . htmlspecialchars($lang["name"]) . "</option>\n"; } $langdropdown .= "</select>\n"; //END TORRENTLANG $char1 = 55; $shortname = CutName(htmlspecialchars($row["name"]), $char1); if ($_GET["edited"]) { show_error_msg("Edited OK", T_("TORRENT_EDITED_OK"), 1); } stdhead(T_("EDIT_TORRENT") . " \"{$shortname}\""); begin_frame(T_("EDIT_TORRENT") . " \"{$shortname}\""); print "<br /><br /><form method='post' name=\"bbform\" enctype=\"multipart/form-data\" action=\"torrents-edit.php?action=doedit\">\n"; print "<input type=\"hidden\" name=\"id\" value=\"{$id}\" />\n"; if (isset($_GET["returnto"])) { print "<input type=\"hidden\" name=\"returnto\" value=\"" . htmlspecialchars($_GET["returnto"]) . "\" />\n"; } print "<table class='table_table' cellspacing='0' cellpadding='4' width='586' align='center'>\n"; echo "<tr><td class='table_col1' align='right' width='60'><b>" . T_("NAME") . ": </b></td><td class='table_col2' ><input type=\"text\" name=\"name\" value=\"" . htmlspecialchars($row["name"]) . "\" size=\"60\" /></td></tr>"; echo "<tr><td class='table_col1' align='right'><b>" . T_("IMAGE") . ": </b></td><td class='table_col2'><b>" . T_("IMAGE") . " 1:</b> <input type='radio' name='img1action' value='keep' checked='checked' />" . T_("KEEP_IMAGE") . " " . "<input type='radio' name='img1action' value='delete' />" . T_("DELETE_IMAGE") . " " . "<input type='radio' name='img1action' value='update' />" . T_("UPDATE_IMAGE") . "<br /><input type='file' name='image0' size='60' /> <br /><br /> <b>" . T_("IMAGE") . " 2:</b> <input type='radio' name='img2action' value='keep' checked='checked' />" . T_("KEEP_IMAGE") . " " . "<input type='radio' name='img2action' value='delete' />" . T_("DELETE_IMAGE") . " " . "<input type='radio' name='img2action' value='update' />" . T_("UPDATE_IMAGE") . "<br /><input type='file' name='image1' size='60' /></td></tr>"; echo "<tr><td class='table_col1' align='right'><b>" . T_("NFO") . ": </b><br /></td><td class='table_col2' ><input type='radio' name='nfoaction' value='keep' checked='checked' />Keep NFO <input type='radio' name='nfoaction' value='update' />Update NFO:"; if ($row["nfo"] == "yes") {
$query = "SELECT STRAIGHT_JOIN tr.rlsname, tr.grp, tr.section, tr.time, tr.files, tr.size, tr.genre, " . "nfo.id AS nfoid, sfv.id AS sfvid, m3u.id AS m3uid, jpg.id AS jpgid, cover.id AS coverid, mp3info.rel_info AS mp3info, " . "videoinfo.rel_info AS videoinfo, url.rel_url AS url, nukelog.reason , nukelog.network, nukelog.status, spam.id AS spamid " . "FROM temp_releases AS tr " . "LEFT JOIN nukelog ON tr.rlsname = nukelog.rlsname " . "LEFT JOIN spam ON tr.rlsname = spam.rlsname " . "LEFT JOIN nfo ON tr.rlsname = nfo.rel_name " . "LEFT JOIN sfv ON tr.rlsname = sfv.rel_name " . "LEFT JOIN m3u ON tr.rlsname = m3u.rel_name " . "LEFT JOIN jpg ON tr.rlsname = jpg.rel_name " . "LEFT JOIN cover ON tr.rlsname = cover.rel_name " . "LEFT JOIN mp3info ON tr.rlsname = mp3info.rel_name " . "LEFT JOIN videoinfo ON tr.rlsname = videoinfo.rel_name " . "LEFT JOIN url ON tr.rlsname = url.rel_name " . "ORDER BY tr.time DESC LIMIT 0, 100"; $res = mysql_query($query) or die(mysql_error()); $svar = $q != '' ? $count == 100 ? "<p>Displaying {$count} Search Results found for {$q}. Limited to 100 results re-define your search.</p>" : "<p>Displaying {$count} Search Results found for {$q}.</p>" : ''; echo "<section>{$svar}\n\t\t<table class='zebra-striped'>\n\t\t\t<thead>\n\t\t\t <tr>\n\t\t\t\t<th>Section</th>\n\t\t\t\t<th>Added</th>\n\t\t\t\t<th>Release Name</th>\n\t\t\t\t<th>Info</th>\n\t\t\t </tr>\n\t\t\t</thead>\n\t\t\t<tbody>"; while ($row = mysql_fetch_assoc($res)) { $nuked = $row['reason'] != '' && $row['status'] == '1' ? "<a href='#' title={$row['reason']}><span class='label important'>NUKED</span></a> " : ''; $modnuked = $row['reason'] != '' && $row['status'] == '2' ? "<a href='#' title={$row['reason']}><span class='label important'>MODNUKED</span></a> " : ''; $unnuked = $row['reason'] != '' && $row['status'] == '3' ? "<a href='#' title={$row['reason']}><span class='label success'>UNNUKED</span></a> " : ''; $delpre = $undelpre = ''; //$delpre = ($row['dreason'] != '' && $row['undel'] == 'N') ? "<a href='#' title={$row['dreason']}><span class='label important'>DELETED</span></a> " : ''; //$undelpre = ($row['undel'] == 'Y') ? "<a href='#' title={$row['dreason']}><span class='label success'>UNDELETED</span></a> " : ''; $nfo = $row['nfoid'] != '' ? "<a href='get.php?type=nfo&id={$row['nfoid']}' rel='tooltip' title='View NFO'><span class='label warning'>NFO</span></a> " : ''; $sfv = $row['sfvid'] != '' ? "<a href='get.php?type=sfv&id={$row['sfvid']}' rel='tooltip' title='View SFV'><span class='label notice'>SFV</span></a> " : ''; $m3u = $row['m3uid'] != '' ? "<a href='get.php?type=m3u&id={$row['m3uid']}' rel='tooltip' title='View M3U'><span class='label'>M3U</span></a> " : ''; $jpg = $row['jpgid'] != '' ? "<a href='image.php?type=jpg&id={$row['jpgid']}' rel='tooltip' title='View JPG'><span class='label'>JPG</span></a> " : ''; $cover = $row['coverid'] != '' ? "<a href='image.php?type=cover&id={$row['coverid']}' rel='tooltip' title='View Cover'><span class='label'>COVER</span></a> " : ''; $mp3info = $row['mp3info'] != '' ? "<a href='#' rel='tooltip' title='{$row['mp3info']}'><span class='label'>MP3</span></a> " : ''; $videoinfo = $row['videoinfo'] != '' ? "<a href='#' rel='tooltip' title='{$row['videoinfo']}'><span class='label'>ViDEO</span></a> " : ''; $url = $row['url'] != '' ? "<a href='http://anonym.to/{$row['url']}' target='_blank' rel='tooltip' title='{$row['url']}'><span class='label'>URL</span></a> " : ''; $genre = $row['genre'] == '' ? '' : "Genre: " . $row['genre']; echo "<tr>"; echo "<td>{$row['section']}</td>"; echo "<td><a href='#' title='Pred " . gettime($row['time']) . " ago' rel='tooltip'>" . get_date_time($row['time']) . "</a></td>"; echo "<td><a href='#' title='" . $row['rlsname'] . "' rel='tooltip'>" . CutName($row['rlsname']) . "</a> " . $nuked . $modnuked . $unnuked . $delpre . $undelpre . "<br />" . $nfo . $sfv . $m3u . $jpg . $cover . $mp3info . $videoinfo . $url . $genre . "</td>"; echo "<td><b>{$row['files']}</b>F in <b>{$row['size']}</b>MB</td>"; echo "</tr>"; } echo "</tbody></table></section>"; } mysql_query("TRUNCATE TABLE temp_releases") or die(mysql_error()); echo stdfoot();
} } $id = (int) $_GET["id"]; $res = SQL_Query_exec("SELECT name, external, banned FROM torrents WHERE id = {$id}"); $row = mysql_fetch_assoc($res); if (!$row || $row["banned"] == "yes" && $CURUSER["edit_torrents"] == "no") { show_error_msg(T_("ERROR"), T_("TORRENT_NOT_FOUND"), 1); } if ($row["external"] == "yes") { show_error_msg(T_("ERROR"), T_("THIS_TORRENT_IS_EXTERNALLY_TRACKED"), 1); } $res = SQL_Query_exec("SELECT users.id, users.username, users.uploaded, users.downloaded, users.privacy, completed.date FROM users LEFT JOIN completed ON users.id = completed.userid WHERE users.enabled = 'yes' AND completed.torrentid = '{$id}'"); if (mysql_num_rows($res) == 0) { show_error_msg(T_("ERROR"), T_("NO_DOWNLOADS_YET"), 1); } $title = sprintf(T_("COMPLETED_DOWNLOADS"), CutName($row["name"], 40)); stdhead($title); begin_frame($title); ?> <table cellpadding="3" cellspacing="0" align="center" class="table_table"> <tr> <th class="table_head"><?php echo T_("USERNAME"); ?> </th> <th class="table_head"><?php echo T_("CURRENTLY_SEEDING"); ?> </th> <th class="table_head"><?php
// Get last post info $post_res = SQL_Query_exec("SELECT added,topicid,userid FROM forum_posts WHERE id={$lastpostid}"); if (mysql_num_rows($post_res) == 1) { $post_arr = mysql_fetch_assoc($post_res) or showerror(T_("ERROR"), "Bad forum last_post"); $lastposterid = $post_arr["userid"]; $lastpostdate = utc_to_tz($post_arr["added"]); $lasttopicid = $post_arr["topicid"]; $user_res = SQL_Query_exec("SELECT username FROM users WHERE id={$lastposterid}"); $user_arr = mysql_fetch_assoc($user_res); $lastposter = htmlspecialchars($user_arr['username']); $topic_res = SQL_Query_exec("SELECT subject FROM forum_topics WHERE id={$lasttopicid}"); $topic_arr = mysql_fetch_assoc($topic_res); $lasttopic = stripslashes(htmlspecialchars($topic_arr['subject'])); //cut last topic $latestleng = 10; $lastpost = "<small><a href='forums.php?action=viewtopic&topicid={$lasttopicid}&page=last#last'>" . CutName($lasttopic, $latestleng) . "</a> by <a href='account-details.php?id={$lastposterid}'>{$lastposter}</a><br />{$lastpostdate}</small>"; if ($CURUSER) { $r = SQL_Query_exec("SELECT lastpostread FROM forum_readposts WHERE userid={$CURUSER['id']} AND topicid={$lasttopicid}"); $a = mysql_fetch_row($r); } //define the images for new posts or not on index if ($a && $a[0] == $lastpostid) { $img = "folder"; } else { $img = "folder_new"; } } else { $lastpost = "<span class='small'>No Posts</span>"; $img = "folder"; } //following line is each forums display
function torrenttable($res, $variant = "index") { global $TBDEV, $CURUSER, $lang, $free; $htmlout = ''; /** ALL FREE/DOUBLE **/ foreach ($free as $fl) { switch ($fl['modifier']) { case 1: $free_display = '[Free]'; break; case 2: $free_display = '[Double]'; break; case 3: $free_display = '[Free and Double]'; break; } $all_free_tag = $fl['modifier'] != 0 && ($fl['expires'] > TIME_NOW || $fl['expires'] == 1) ? ' <a class="info" href="#"> <b>' . $free_display . '</b> <span>' . ($fl['expires'] != 1 ? ' Expires: ' . get_date($fl['expires'], 'DATE') . '<br /> (' . mkprettytime($fl['expires'] - time()) . ' to go)</span></a><br />' : 'Unlimited</span></a><br />') : ''; } $prevdate = ""; $count_get = 0; $oldlink = $char = $description = $type = $sort = $row = ''; foreach ($_GET as $get_name => $get_value) { $get_name = strip_tags(str_replace(array("\"", "'"), array("", ""), $get_name)); $get_value = 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 . "&"; } $links = array('link1', 'link2', 'link3', 'link4', 'link5', 'link6', 'link7', 'link8', 'link9'); $i = 1; foreach ($links as $link) { if (isset($_GET['sort']) && $_GET['sort'] == $i) { ${$link} = isset($_GET['type']) && $_GET['type'] == 'desc' ? 'asc' : 'desc'; } else { ${$link} = 'desc'; } $i++; } $htmlout .= "<table border='1' cellspacing='0' cellpadding='5'>\r\n <tr>\r\n <td class='colhead' align='center'>{$lang["torrenttable_type"]}</td>\r\n <td class='colhead' align='left'><a href='{$TBDEV['baseurl']}/browse.php?{$oldlink}sort=1&type={$link1}'>{$lang["torrenttable_name"]}</a></td>\r\n <td class='colhead' align='left'><img src='" . $TBDEV['pic_base_url'] . "zip.gif' border='0' alt='Download' title='Download' /></td>"; $htmlout .= $variant == 'index' ? "<td class='colhead' align='center'><a href='" . $TBDEV['baseurl'] . "/bookmarks.php'><img src='" . $TBDEV['pic_base_url'] . "bookmark.gif' border='0' alt='Bookmark' title='Go To My Bookmarks' /></a></td>" : ''; if ($variant == "mytorrents") { $htmlout .= "<td class='colhead' align='center'>{$lang["torrenttable_edit"]}</td>\n"; $htmlout .= "<td class='colhead' align='center'>{$lang["torrenttable_visible"]}</td>\n"; } $htmlout .= "<td class='colhead' align='right'><a href='{$TBDEV['baseurl']}/browse.php?{$oldlink}sort=2&type={$link2}'>{$lang["torrenttable_files"]}</a></td>\r\n <td class='colhead' align='right'><a href='{$TBDEV['baseurl']}/browse.php?{$oldlink}sort=3&type={$link3}'>{$lang["torrenttable_comments"]}</a></td>\r\n <td class='colhead' align='center'><a href='{$TBDEV['baseurl']}/browse.php?{$oldlink}sort=4&type={$link4}'>{$lang["torrenttable_added"]}</a></td>\r\n <td class='colhead' align='center'><a href='{$TBDEV['baseurl']}/browse.php?{$oldlink}sort=5&type={$link5}'>{$lang["torrenttable_size"]}</a></td>\r\n <td class='colhead' align='center'><a href='{$TBDEV['baseurl']}/browse.php?{$oldlink}sort=6&type={$link6}'>{$lang["torrenttable_snatched"]}</a></td>\r\n <td class='colhead' align='right'><a href='{$TBDEV['baseurl']}/browse.php?{$oldlink}sort=7&type={$link7}'>{$lang["torrenttable_seeders"]}</a></td>\r\n <td class='colhead' align='right'><a href='{$TBDEV['baseurl']}/browse.php?{$oldlink}sort=8&type={$link8}'>{$lang["torrenttable_leechers"]}</a></td>"; if ($variant == 'index') { $htmlout .= "<td class='colhead' align='center'><a href='{$TBDEV['baseurl']}/browse.php?{$oldlink}sort=9&type={$link9}'>{$lang["torrenttable_uppedby"]}</a></td>\n"; } $htmlout .= "</tr>\n"; while ($row = mysql_fetch_assoc($res)) { $id = $row["id"]; if ($row["sticky"] == "yes") { $htmlout .= "<tr class='highlight'>\n"; } else { $htmlout .= "<tr>\n"; } $htmlout .= "<td align='center' style='padding: 0px'>"; if (isset($row["cat_name"])) { $htmlout .= "<a href='browse.php?cat={$row['category']}'>"; if (isset($row["cat_pic"]) && $row["cat_pic"] != "") { $htmlout .= "<img border='0' src='{$TBDEV['pic_base_url']}caticons/{$row['cat_pic']}' alt='{$row['cat_name']}' />"; } else { $htmlout .= $row["cat_name"]; } $htmlout .= "</a>"; } else { $htmlout .= "-"; } $htmlout .= "</td>\n"; $dispname = htmlspecialchars($row["name"]); $checked = !empty($row['checked_by']) && $CURUSER['class'] >= UC_USER ? " <img src='{$TBDEV['pic_base_url']}mod.gif' width='15' border='0' alt='Checked - by " . htmlspecialchars($row['checked_by']) . "' title='Checked - by " . htmlspecialchars($row['checked_by']) . "' />" : ""; $poster = empty($row["poster"]) ? "<img src=\\'{$TBDEV['pic_base_url']}noposter.png\\' width=\\'150\\' height=\\'220\\' border=\\'0\\' alt=\\'Poster\\' title=\\'poster\\' />" : "<img src=\\'" . htmlspecialchars($row['poster']) . "\\' width=\\'150\\' height=\\'220\\' border=\\'0\\' alt=\\'Poster\\' title=\\'poster\\' />"; if ($row["descr"]) { $descr = str_replace("\"", """, readMore($row["descr"], 350, "details.php?id=" . $row["id"] . "&hit=1")); } $htmlout .= "<td align='left'><a href='details.php?"; $htmlout .= "<td align='left'><a href='details.php?"; if ($variant == "mytorrents") { $htmlout .= "returnto=" . urlencode($_SERVER["REQUEST_URI"]) . "&"; } $htmlout .= "id={$id}"; if ($variant == "index") { $htmlout .= "&hit=1"; } $sticky = $row['sticky'] == "yes" ? "<img src='{$TBDEV['pic_base_url']}sticky.gif' border='0' alt='Sticky' title='Sticky !' />" : ""; $nuked = $row["nuked"] == "yes" ? "<img src='{$TBDEV['pic_base_url']}nuked.gif' style='border:none' alt='Nuked' align='right' title='Reason :" . htmlspecialchars($row["nukereason"]) . "' />" : ""; /** FREE Torrent **/ $free_tag = $row['free'] != 0 ? ' <a class="info" href="#"><b>[FREE]</b> <span>' . ($row['free'] > 1 ? 'Expires: ' . get_date($row['free'], 'DATE') . '<br />(' . mkprettytime($row['free'] - TIME_NOW) . ' to go)<br />' : 'Unlimited<br />') . '</span></a>' : $all_free_tag; /** Freeslot Slot in Use **/ $isdlfree = $row['tid'] == $id && $row['uid'] == $CURUSER['id'] && $row['freeslot'] != 0 ? '<a class="info" href="#"><img src="' . $TBDEV['baseurl'] . '/pic/freedownload.gif" alt="" /><span>Freeleech slot in use<br />' . ($row['freeslot'] != 0 ? $row['freeslot'] > 1 ? 'Expires: ' . get_date($row['freeslot'], 'DATE') . '<br />(' . mkprettytime($row['freeslot'] - TIME_NOW) . ' to go)<br />' : 'Unlimited<br />' : '') . '</span></a>' : ''; /** Double Upload Slot in Use **/ $isdouble = $row['tid'] == $id && $row['uid'] == $CURUSER['id'] && $row['doubleup'] != 0 ? ' <a class="info" href="#"><img src="' . $TBDEV['baseurl'] . '/pic/doubleseed.gif" alt="" /><span>Double Upload slot in use<br />' . ($row['doubleup'] != 0 ? $row['doubleup'] > 1 ? 'Expires: ' . get_date($row['doubleup'], 'DATE') . '<br />(' . mkprettytime($row['doubleup'] - TIME_NOW) . ' to go)<br />' : 'Unlimited<br />' : '') . '</span></a>' : ''; $htmlout .= "' onmouseover=\"Tip('<b>" . CutName($dispname, 80) . "</b><br /><b>Added: " . get_date($row['added'], 'DATE', 0, 1) . "</b><br /><b>Size: " . mksize(htmlspecialchars($row["size"])) . "</b><br /><b>Seeders: " . htmlspecialchars($row["seeders"]) . "</b><br /><b>Leechers: " . htmlspecialchars($row["leechers"]) . "</b><br />{$poster}');\" onmouseout=\"UnTip();\"><b>" . CutName($dispname, 45) . "</b></a> <a href=\"javascript:klappe_descr('descr" . $row["id"] . "');\" ><img src=\"/pic/plus.gif\" border=\"0\" alt=\"Show torrent info in this page\" title=\"Show torrent info in this page\" /></a> {$sticky} " . ($row['added'] >= $CURUSER['last_browse'] ? " <img src='{$TBDEV['pic_base_url']}newb.png' border='0' alt='New !' title='New !' />" : "") . " {$checked} {$free_tag} {$nuked}<br />\n" . $isdlfree . $isdouble . "</td>\n"; if ($variant == "mytorrents") { $htmlout .= "<td align='center'><a href=\"download.php?torrent=" . $id . "\"><img src='" . $TBDEV['pic_base_url'] . "zip.gif' border='0' alt='Download This Torrent!' title='Download This Torrent!' /></a></td>\n"; } if ($variant == "mytorrents") { $htmlout .= "<td align='center'><a href='edit.php?returnto=" . urlencode($_SERVER["REQUEST_URI"]) . "&id={$row['id']}'>" . $lang["torrenttable_edit"] . "</a></td>\n"; } $htmlout .= $variant == "index" ? "<td align='center'><a href=\"download.php?torrent=" . $id . "\"><img src='" . $TBDEV['pic_base_url'] . "zip.gif' border='0' alt='Download This Torrent!' title='Download This Torrent!' /></a></td>" : ""; if ($variant == "mytorrents") { $htmlout .= "<td align='right'>"; if ($row["visible"] == "no") { $htmlout .= "<b>" . $lang["torrenttable_not_visible"] . "</b>"; } else { $htmlout .= "" . $lang["torrenttable_visible"] . ""; } $htmlout .= "</td>\n"; } $bookmarked = !isset($row["bookmark"]) ? "<a href='bookmark.php?torrent=" . $id . "&action=add'><img src='" . $TBDEV['pic_base_url'] . "bookmark.gif' border='0' alt='Bookmark it!' title='Bookmark it!' /></a>" : "<a href='bookmark.php?torrent=" . $id . "&action=delete'><img src='" . $TBDEV['pic_base_url'] . "plus2.gif' border='0' alt='Delete Bookmark!' title='Delete Bookmark!' /></a>"; if ($variant == "index") { $htmlout .= "<td align='right'>{$bookmarked}</td>"; } if ($row["type"] == "single") { $htmlout .= "<td align='right'>{$row["numfiles"]}</td>\n"; } else { if ($variant == "index") { $htmlout .= "<td align='right'><b><a href='filelist.php?id={$id}'>" . $row["numfiles"] . "</a></b></td>\n"; } else { $htmlout .= "<td align='right'><b><a href='filelist.php?id={$id}'>" . $row["numfiles"] . "</a></b></td>\n"; } } if (!$row["comments"]) { $htmlout .= "<td align='right'>{$row["comments"]}</td>\n"; } else { if ($variant == "index") { $htmlout .= "<td align='right'><b><a href='details.php?id={$id}&hit=1&tocomm=1'>" . $row["comments"] . "</a></b></td>\n"; } else { $htmlout .= "<td align='right'><b><a href='details.php?id={$id}&page=0#startcomments'>" . $row["comments"] . "</a></b></td>\n"; } } $htmlout .= "<td align='center'><span style='white-space: nowrap;'>" . str_replace(",", "<br />", get_date($row['added'], '')) . "</span></td>\n"; $htmlout .= "<td align='center'>" . str_replace(" ", "<br />", mksize($row["size"])) . "</td>\n"; if ($row["times_completed"] != 1) { $_s = "" . $lang["torrenttable_time_plural"] . ""; } else { $_s = "" . $lang["torrenttable_time_singular"] . ""; } $htmlout .= "<td align='center'><a href='snatches.php?id={$id}'>" . number_format($row["times_completed"]) . "<br />{$_s}</a></td>\n"; if ($row["seeders"]) { if ($variant == "index") { if ($row["leechers"]) { $ratio = $row["seeders"] / $row["leechers"]; } else { $ratio = 1; } $htmlout .= "<td align='right'><b><a href='peerlist.php?id={$id}#seeders'>\r\n <font color='" . get_slr_color($ratio) . "'>{$row["seeders"]}</font></a></b></td>\n"; } else { $htmlout .= "<td align='right'><b><a class='" . linkcolor($row["seeders"]) . "' href='peerlist.php?id={$id}#seeders'>{$row["seeders"]}</a></b></td>\n"; } } else { $htmlout .= "<td align='right'><span class='" . linkcolor($row["seeders"]) . "'>" . $row["seeders"] . "</span></td>\n"; } if ($row["leechers"]) { if ($variant == "index") { $htmlout .= "<td align='right'><b><a href='peerlist.php?id={$id}#leechers'>" . number_format($row["leechers"]) . "</a></b></td>\n"; } else { $htmlout .= "<td align='right'><b><a class='" . linkcolor($row["leechers"]) . "' href='peerlist.php?id={$id}#leechers'>{$row["leechers"]}</a></b></td>\n"; } } else { $htmlout .= "<td align='right'>0</td>\n"; } if ($variant == "index") { if ($row["anonymous"] == "yes") { $htmlout .= "<td align='center'><i>Anonymous</i></td>\n"; } else { $htmlout .= "<td align='center'>" . (isset($row["username"]) ? "<a href='{$TBDEV['baseurl']}/userdetails.php?id=" . $row["owner"] . "'><b>" . htmlspecialchars($row["username"]) . "</b></a>" : "<i>(" . $lang["torrenttable_unknown_uploader"] . ")</i>") . "</td>\n"; } } $htmlout .= "</tr>\n"; } $htmlout .= "</table>\n"; return $htmlout; }
echo '<form method="get" action="" class="well form-search"> <input class="input-medium search-query" type="text" placeholder="Search Query" name="search" value="' . $q . '"> <button class="btn primary" type="submit">Search</button> </form>'; if ($count == '0') { echo "<section>No results found for {$q}</section>"; } else { $query = "SELECT STRAIGHT_JOIN temp_predb.rel_name, temp_predb.rel_section, temp_predb.rel_time, temp_predb.rel_size, temp_predb.rel_files, " . "temp_predb.rel_genre, nfo.id AS nfoid, sfv.id AS sfvid, m3u.id AS m3uid, nukes.n_reason AS nreason , unnukes.un_reason AS unreason, " . "delpre.d_reason AS dreason, delpre.readded AS undel " . "FROM temp_predb " . "LEFT JOIN nukes ON temp_predb.rel_id = nukes.rel_id " . "LEFT JOIN unnukes ON temp_predb.rel_id = unnukes.rel_id " . "LEFT JOIN delpre ON temp_predb.rel_id = delpre.rel_id " . "LEFT JOIN nfo ON temp_predb.rel_name = nfo.rel_name " . "LEFT JOIN sfv ON temp_predb.rel_name = sfv.rel_name " . "LEFT JOIN m3u ON temp_predb.rel_name = m3u.rel_name " . "ORDER BY temp_predb.rel_time DESC LIMIT 0, 100"; $res = mysql_query($query) or die(mysql_error()); $svar = $q != '' ? $count == 100 ? "<p>Displaying {$count} Search Results found for {$q}. Limited to 100 results re-define your search.</p>" : "<p>Displaying {$count} Search Results found for {$q}.</p>" : ''; echo "<section>{$svar}\n\t\t<table class='zebra-striped'>\n\t\t\t<thead>\n\t\t\t <tr>\n\t\t\t\t<th>Section</th>\n\t\t\t\t<th>Added</th>\n\t\t\t\t<th>Release Name</th>\n\t\t\t\t<th>Info</th>\n\t\t\t </tr>\n\t\t\t</thead>\n\t\t\t<tbody>"; while ($row = mysql_fetch_assoc($res)) { $nuked = $row['nreason'] != '' ? "<a href='#' title={$row['nreason']}><span class='label important'>NUKED</span></a> " : ''; $unnuked = $row['unreason'] != '' ? "<a href='#' title={$row['unreason']}><span class='label success'>UNNUKED</span></a> " : ''; $delpre = $row['dreason'] != '' && $row['undel'] == 'N' ? "<a href='#' title={$row['dreason']}><span class='label important'>DELETED</span></a> " : ''; $undelpre = $row['undel'] == 'Y' ? "<a href='#' title={$row['dreason']}><span class='label success'>UNDELETED</span></a> " : ''; $nfo = $row['nfoid'] != '' ? "<a href='get.php?type=nfo&id={$row['nfoid']}' title='Download NFO'><span class='label warning'>NFO</span></a> " : ''; $sfv = $row['sfvid'] != '' ? "<a href='get.php?type=sfv&id={$row['sfvid']}' title='Download SFV'><span class='label notice'>SFV</span></a> " : ''; $m3u = $row['m3uid'] != '' ? "<a href='get.php?type=m3u&id={$row['m3uid']}' title='Download M3U'><span class='label'>M3U</span></a> " : ''; $genre = $row['rel_genre'] == '' ? '' : "Genre: " . $row['rel_genre']; echo "<tr>"; echo "<td>{$row['rel_section']}</td>"; echo "<td><a href='#' title='Pred " . gettime($row['rel_time']) . " ago' rel='tooltip'>" . get_date_time($row['rel_time']) . "</a></td>"; echo "<td><a href='#' title='" . $row['rel_name'] . "' rel='tooltip'>" . CutName($row['rel_name']) . "</a> " . $nuked . $unnuked . $delpre . $undelpre . "<br />" . $nfo . $sfv . $m3u . $genre . "</td>"; echo "<td><b>{$row['rel_files']}</b>F in <b>{$row['rel_size']}</b>MB</td>"; echo "</tr>"; } echo "</tbody></table></section>"; } mysql_query("TRUNCATE TABLE temp_predb") or die(mysql_error()); echo stdfoot();
$query2 = str_replace(".", " ", sqlesc("%" . $searchname . "%")); if (($sim_torrents = $mc1->get_value('similiar_tor_' . $id)) === false) { $r = sql_query("SELECT id, name, size, added, seeders, leechers, category FROM torrents WHERE name LIKE {$query1} AND id <> " . sqlesc($id) . " OR name LIKE {$query2} AND id <> " . sqlesc($id) . " ORDER BY name") or sqlerr(__FILE__, __LINE__); while ($sim_torrent = mysqli_fetch_assoc($r)) { $sim_torrents[] = $sim_torrent; } $mc1->cache_value('similiar_tor_' . $id, $sim_torrents, 86400); } if (count($sim_torrents) > 0) { $sim_torrent = "<table class='table table-bordered'>\n" . "\n\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<th>Type</th>\n\t\t\t\t<th>Name</th>\n\t\t\t\t<th>Size</th>\n\t\t\t\t<th>Added</th>\n\t\t\t\t<th>Seeders</th>\n\t\t\t\t<th>Leechers</th>\n\t\t\t</tr>\n\t\t</thead>\n"; if ($sim_torrents) { foreach ($sim_torrents as $a) { $sim_tor['cat_name'] = htmlsafechars($change[$a['category']]['name']); $sim_tor['cat_pic'] = htmlsafechars($change[$a['category']]['image']); $cat = "<img src=\"pic/caticons/{$CURUSER['categorie_icon']}/{$sim_tor['cat_pic']}\" alt=\"{$sim_tor['cat_name']}\" title=\"{$sim_tor['cat_name']}\" />"; $name = htmlsafechars(CutName($a["name"])); $seeders = (int) $a["seeders"]; $leechers = (int) $a["leechers"]; $added = get_date($a["added"], 'DATE', 0, 1); $sim_torrent .= "<tr>\n\t\t\t\t<td class='one' style='padding: 0px; border: none' width='40px'>{$cat}</td>\n\t\t\t\t<td class='one'><a href='details.php?id=" . (int) $a["id"] . "&hit=1'><b>{$name}</b></a></td>\n\t\t\t\t<td class='one' style='padding: 1px' align='center'>" . mksize($a['size']) . "</td>\n\t\t\t\t<td class='one' style='padding: 1px' align='center'>{$added}</td>\n\t\t\t\t<td class='one' style='padding: 1px' align='center'>{$seeders}</td>\n\t\t\t\t<td class='one' style='padding: 1px' align='center'>{$leechers}</td>\n\t\t\t</tr>\n"; } $sim_torrent .= "\n\t</table>"; $HTMLOUT .= "<table class='table table-bordered'><tr><td align='right' class='heading'>{$lang['details_similiar']}<a href=\"javascript: klappe_news('a5')\"><img border=\"0\" src=\"pic/plus.png\" id=\"pica5" . (int) $a['id'] . "\" alt=\"[Hide/Show]\" title=\"[Hide/Show]\" /></a><div id=\"ka5\" style=\"display: none;\"><br />{$sim_torrent}</div></td></tr></table></div></div>"; } else { if (empty($sim_torrents)) { $HTMLOUT .= "\n\t\t<table class='table table-bordered'>\n\n\t\t\t\t<tr>\n\t\t\t\t<td colspan='2'>Nothing similiar to " . htmlsafechars($torrents["name"]) . " found.</td>\n\t\t\t\t</tr>\t\n\t\t</table>\n\t\t</div>\n\t\t</div>"; } } } $HTMLOUT .= "\n<div class='row-fluid'>\n<table align='center' class='table table-bordered span3'>\n"; //==subs by putyn
$peers = (int) $arr['seeders'] . " seeder" . ((int) $arr['seeders'] > 1 ? "s" : "") . ", " . (int) $arr['leechers'] . " leecher" . ((int) $arr['leechers'] > 1 ? "s" : ""); $HTMLOUT .= "<tr><td><a href='{$INSTALLER09['baseurl']}/userdetails.php?id=" . (int) $What_User_ID . "'>" . htmlsafechars($arr['username']) . "</a> (" . member_ratio($arr['uploaded'], $arr['downloaded']) . ")</td><td><a href='{$INSTALLER09['baseurl']}/details.php?id=" . (int) $What_ID . "' title='{$torrname}'>{$torrname}</a></td><td>{$cat}</td><td>{$peers}</td></tr>\n"; } $HTMLOUT .= "</table>\n"; } else { $HTMLOUT .= "{$lang['needseed_noleech']}\n"; } $HTMLOUT .= end_frame(); $HTMLOUT .= end_main_frame(); echo stdhead("{$lang['needseed_lin']}") . $HTMLOUT . stdfoot(); } else { $HTMLOUT .= begin_main_frame(); $HTMLOUT .= begin_frame("[<a href='?needed=leechers' class='altlink'>{$lang['needseed_sin']}</a>] - {$lang['needseed_tns']}"); $res = sql_query("SELECT id, name, seeders, leechers, added, category FROM torrents WHERE leechers >= 0 AND seeders = 0 ORDER BY leechers DESC LIMIT 20") or sqlerr(__FILE__, __LINE__); if (mysqli_num_rows($res) > 0) { $HTMLOUT .= "<table align='center' class='main' border='1' cellspacing='0' cellpadding='5'>\n <tr><td class='colhead'>{$lang['needseed_cat']}</td><td class='colhead'>{$lang['needseed_tor']}</td><td class='colhead'>{$lang['needseed_seed']}</td><td class='colhead'>{$lang['needseed_leech']}</td></tr>\n"; while ($arr = mysqli_fetch_assoc($res)) { $needseed['cat_name'] = htmlsafechars($change[$arr['category']]['name']); $needseed['cat_pic'] = htmlsafechars($change[$arr['category']]['image']); $cat = "<img src=\"pic/caticons/{$CURUSER['categorie_icon']}/{$needseed['cat_pic']}\" alt=\"{$needseed['cat_name']}\" title=\"{$needseed['cat_name']}\" />"; $torrname = htmlsafechars(CutName($arr['name'], 80)); $HTMLOUT .= "<tr><td>{$cat}</td><td><a href='{$INSTALLER09['baseurl']}/details.php?id=" . (int) $arr['id'] . "&hit=1' title='{$torrname}'>{$torrname}</a></td><td align='center'><span style='color: red'>" . (int) $arr['seeders'] . "</span></td><td align='center'>" . (int) $arr['leechers'] . "</td></tr>\n"; } $HTMLOUT .= "</table>\n"; } else { $HTMLOUT .= "{$lang['needseed_noseed']}\n"; } $HTMLOUT .= end_frame(); $HTMLOUT .= end_main_frame(); echo stdhead("{$lang['needseed_sin']}") . $HTMLOUT . stdfoot(); }
echo $title . ' - ' . $title_en; ?> "><?php echo CutName($title, 20); ?> </a> <?php echo $year; ?> (<?php echo $quality; ?> ) </p> <p> <?php echo CutName($title_en, 20); ?> </p> </div> </div> <span class="gradient_thumb"></span></li> <?php } ?> </ul> <?php echo $allpage_site; ?> </div> <?php include View::TemplateView('footer');
//Begin displaying the table $HTMLOUT .= "<table width='80%' cellpadding='10' cellspacing='1' border='1'>\n <tr>\n <td align='center' class='colhead'>{$lang['credits_name']}</td>\n <td align='center' class='colhead'>{$lang['credits_category']}</td>\n <td align='center' class='colhead'>{$lang['credits_status']}</td>\n <td align='center' class='colhead'>{$lang['credits_credits']}</td>\n </tr>"; if ($row = mysqli_fetch_array($res)) { do { $id = $row["id"]; $name = $row["name"]; $category = $row["category"]; if ($row["status"] == "In-Progress") { $status = "[b][color=#ff0000]" . $row["status"] . "[/color][/b]"; } else { $status = "[b][color=#018316]" . $row["status"] . "[/color][/b]"; } $link = $row["u232lnk"]; $credit = $row["credit"]; $descr = $row["description"]; $HTMLOUT .= "<tr><td><a target='_blank' class='altlink' href='" . $link . "'>" . htmlsafechars(CutName($name, 60)) . "</a>"; if ($CURUSER['class'] >= UC_ADMINISTRATOR) { $HTMLOUT .= " <a class='altlink_blue' href='?action=edit&id=" . $id . "'>{$lang['credits_edit']}</a> <a class='altlink_blue' href=\"javascript:confirm_delete(" . $id . ");\">{$lang['credits_delete']}</a>"; } $HTMLOUT .= "<br /><font class='small'>" . htmlsafechars($descr) . "</font></td>"; $HTMLOUT .= "<td><b>" . htmlsafechars($category) . "</b></td>"; $HTMLOUT .= "<td><b>" . format_comment($status) . "</b></td>"; $HTMLOUT .= "<td>" . htmlsafechars($credit) . "</td></tr>"; } while ($row = mysqli_fetch_array($res)); } else { $HTMLOUT .= "<tr><td colspan='4'>{$lang['credits_nosofar']}</td></tr>"; } $HTMLOUT .= "</table>"; if ($CURUSER['class'] >= UC_SYSOP) { $HTMLOUT .= "<br/>\n\t <form method='post' action='" . $_SERVER['PHP_SELF'] . "'>\n\t <table width='80%' cellpadding='8' border='1' cellspacing='0'>\n <tr>\n\t\t<td colspan='2' class='colhead'>\n {$lang['credits_add']}\n\t\t<input type='hidden' name='action' value='add' /></td>\n\t </tr>\n \t\n \t<tr>\n\t\t<td>{$lang['credits_name1']}</td>\n\t\t<td><input name='name' type='text' size='120' /></td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td>{$lang['credits_description1']}</td><td><input name='description' type='text' size='120' maxlength='120' /></td>\n\t\t</tr>\n\t\t\t\t\n\t\t<tr>\n\t\t<td>{$lang['credits_category1']}</td><td>\n\t\t\n <select name='category'>\n <option value='Addon'>{$lang['credits_addon']}</option>\n <option value='Forum'>{$lang['credits_forum']}</option>\n <option value='Message/Email'>{$lang['credits_mes']}</option>\n <option value='Display/Style'>{$lang['credits_disp']}</option>\n <option value='Staff/Tools'>{$lang['credits_staff']}</option>\n <option value='Browse/Torrent/Details'>{$lang['credits_btd']}</option>\n <option value='Misc'>{$lang['credits_misc']}</option>\n </select>\n \n\t </td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td>{$lang['credits_link1']}</td><td><input name='link' type='text' size='50' /></td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td>{$lang['credits_status1']}</td><td>\n\t\t<select name='status'>\n <option value='In-Progress'>{$lang['credits_progress']}</option>\n <option value='Complete'>{$lang['credits_complete']}</option>\n </select>\n\t\t\n\t\t</td>\n\t\t</tr>\n\t <tr>\n\t <td>{$lang['credits_credits1']}</td><td><input name='credit' type='text' size='120' maxlength='120' /><br /><font class='small'>{$lang['credits_val']}</font></td>\n\t </tr>\n\t <tr>\n\t\t<td colspan='2'>\n\t\t<input type='submit' value='{$lang['credits_addc']}' />\n\t\t</td>\n\t </tr>\n\t </table></form>"; }
if (!empty($_POST["desact"])) { sql_query("UPDATE users SET enabled = 'no' WHERE id IN (" . implode(", ", array_map("sqlesc", $_POST["desact"])) . ")") or sqlerr(__FILE__, __LINE__); } } $HTMLOUT .= "<div class='row'><div class='col-md-12'>"; $HTMLOUT .= "<h2>{$lang['cheaters_users']}</h2>"; $res = sql_query("SELECT COUNT(*) FROM cheaters") or sqlerr(__FILE__, __LINE__); $row = mysqli_fetch_array($res); $count = $row[0]; $perpage = 15; $pager = pager($perpage, $count, "staffpanel.php?tool=cheaters&action=cheaters&"); $HTMLOUT .= "<form action='staffpanel.php?tool=cheaters&action=cheaters' method='post'>\n<script type='text/javascript'>\n/*<![CDATA[*/\nfunction klappe(id)\n{var klappText=document.getElementById('k'+id);var klappBild=document.getElementById('pic'+id);if(klappText.style.display=='none'){klappText.style.display='block';}\nelse{klappText.style.display='none';}}\nfunction klappe_news(id)\n{var klappText=document.getElementById('k'+id);var klappBild=document.getElementById('pic'+id);if(klappText.style.display=='none'){klappText.style.display='block';klappBild.src='{$INSTALLER09['pic_base_url']}minus.gif';}\nelse{klappText.style.display='none';klappBild.src='{$INSTALLER09['pic_base_url']}plus.gif';}}\t\n</script>\n<script type='text/javascript'>\nvar checkflag = 'false';\nfunction check(field) {\nif (checkflag == 'false') {\nfor (i = 0; i < field.length; i++) {\nfield[i].checked = true;}\ncheckflag = 'true';\nreturn 'Uncheck All Disable'; }\nelse {\nfor (i = 0; i < field.length; i++) {\nfield[i].checked = false; }\ncheckflag = 'false';\nreturn 'Check All Disable'; }\n}\nfunction check2(field) {\nif (checkflag == 'false') {\nfor (i = 0; i < field.length; i++) {\nfield[i].checked = true;}\ncheckflag = 'true';\nreturn 'Uncheck All Remove'; }\nelse {\nfor (i = 0; i < field.length; i++) {\nfield[i].checked = false; }\ncheckflag = 'false';\nreturn 'Check All Remove'; }\n}\n/*]]>*/\n</script>"; if ($count > $perpage) { $HTMLOUT .= $pager['pagertop']; } $HTMLOUT .= "<table class='table table-bordered'>\n<tr>\n<td>#</td>\n<td>{$lang['cheaters_uname']}</td>\n<td>{$lang['cheaters_d']}</td>\n<td>{$lang['cheaters_r']}</td></tr>\n"; $res = sql_query("SELECT c.id as cid, c.added, c.userid, c.torrentid, c.client, c.rate, c.beforeup, c.upthis, c.timediff, c.userip, u.id, u.username, u.class, u.downloaded, u.uploaded, u.chatpost, u.leechwarn, u.warned, u.pirate, u.king, u.donor, u.enabled, t.id AS tid, t.name AS tname FROM cheaters AS c LEFT JOIN users AS u ON u.id=c.userid LEFT JOIN torrents AS t ON t.id=c.torrentid ORDER BY added DESC " . $pager['limit']) or sqlerr(__FILE__, __LINE__); while ($arr = mysqli_fetch_assoc($res)) { $torrname = htmlsafechars(CutName($arr["tname"], 80)); $users = $arr; $users['id'] = (int) $arr['userid']; $cheater = "<b><a href='{$INSTALLER09['baseurl']}/userdetails.php?id=" . (int) $arr['id'] . "'>" . format_username($users) . "</a></b>{$lang['cheaters_hbcc']}<br />\n <b>{$lang['cheaters_torrent']} <a href='{$INSTALLER09['baseurl']}/details.php?id=" . (int) $arr['tid'] . "' title='{$torrname}'>{$torrname}</a></b>\n<br />{$lang['cheaters_upped']} <b>" . mksize((int) $arr['upthis']) . "</b><br />{$lang['cheaters_speed']} <b>" . mksize((int) $arr['rate']) . "/s</b><br />{$lang['cheaters_within']} <b>" . (int) $arr['timediff'] . " {$lang['cheaters_sec']}</b><br />{$lang['cheaters_uc']} <b>" . htmlsafechars($arr['client']) . "</b><br />{$lang['cheaters_ipa']} <b>" . htmlsafechars($arr['userip']) . "</b>"; $HTMLOUT .= "<tr><td>" . (int) $arr['cid'] . "</td>\n <td>" . format_username($users) . "<a href=\"javascript:klappe('a1" . (int) $arr['cid'] . "')\"> {$lang['cheaters_added']}" . get_date($arr['added'], 'DATE') . "</a>\n <div id=\"ka1" . (int) $arr['cid'] . "\" style=\"display: none;\"><font color=\"black\">{$cheater}</font></div></td>\n <td><input type=\"checkbox\" name=\"desact[]\" value=\"" . (int) $arr["id"] . "\"/></td>\n <td><input type=\"checkbox\" name=\"remove[]\" value=\"" . (int) $arr["cid"] . "\"/></td></tr>"; } $HTMLOUT .= "<tr>\n<td>\n<input type=\"button\" value=\"{$lang['cheaters_cad']}\" onclick=\"this.value=check(this.form.elements['desact[]'])\"/> <input type=\"button\" value=\"{$lang['cheaters_car']}\" onclick=\"this.value=check(this.form.elements['remove[]'])\"/> <input type=\"hidden\" name=\"nowarned\" value=\"nowarned\" /><input type=\"submit\" name=\"submit\" value=\"{$lang['cheaters_ac']}\" />\n</td>\n</tr>\n</table></form>"; if ($count > $perpage) { $HTMLOUT .= $pager['pagerbottom']; } $HTMLOUT .= "</div></div>"; echo stdhead($lang['cheaters_stdhead']) . $HTMLOUT . stdfoot(); die;
$quality = $arr[$i][7]; $year = $arr[$i][8]; $thumb = $arr[$i][3]; $duration = $arr[$i][10]; $content = $arr[$i][6]; $director = $arr[$i][11]; $actor = $arr[$i][12]; $country = one_data('name', 'country', "id = '" . $arr[$i][13] . "'"); $category = $arr[$i][14]; $category = substr($category, 1); $category = substr($category, 0, -1); $cat = MySql::dbselect('name', 'category', "id IN ({$category})"); for ($x = 0; $x < count($cat); $x++) { $catx .= $cat[$x][0] . ', '; } $category = substr($catx, 0, -2); $m_time = date('D, d M Y H:i:s', $arr[$i][9]); $url = Url::get($arr[$i][0], $title, 'Phim'); $rss .= "<item>\r\n"; $rss .= "<title>" . clean_feed($title . ' - ' . $title_en) . "</title>\r\n"; $rss .= "<description><![CDATA[<table><tr><td><img src=\"" . $thumb . "\" width=\"200\" height=\"270\" alt=\"" . clean_feed($title . ' - ' . $title_en) . "\" /></td><td><a href=\"{$url}\" title=\"" . clean_feed($title . ' - ' . $title_en) . "\" target=\"_blank\"><h1 />" . clean_feed($title . ' - ' . $title_en) . "</h1></a><br />Diễn viên: " . CheckName($actor) . "<br />Đạo diễn: " . CheckName($director) . "<br />Quốc gia: " . RemoveHtml($country) . "<br />Thể loại: " . RemoveHtml($category) . " <br />Thời lượng: " . $duration . "</td></tr></table><hr />" . CutName(RemoveHtml(UnHtmlChars($content)), 250) . "]]></description>\r\n"; $rss .= "<link>" . $url . "</link>\r\n"; $rss .= "<pubDate>" . $m_time . " GMT</pubDate>\r\n"; $rss .= "</item>\r\n\r\n"; } $rss .= "</channel>\r\n"; $rss .= "</rss>\r\n"; Cache::END_CACHE($rss, $file); } echo $rss; exit;