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('&amp;', array_map('htmlsafechars', $oldlink)) . '&amp;' : '';
    $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&amp;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&amp;type={$link2}'>{$lang["torrenttable_files"]}</a></td>\n   <td class='colhead' align='right'><a href='{$_SERVER["PHP_SELF"]}?{$oldlink}sort=3&amp;type={$link3}'>{$lang["torrenttable_comments"]}</a></td>\n   <td class='colhead' align='center'><a href='{$_SERVER["PHP_SELF"]}?{$oldlink}sort=4&amp;type={$link4}'>{$lang["torrenttable_added"]}</a></td>\n   <td class='colhead' align='center'><a href='{$_SERVER["PHP_SELF"]}?{$oldlink}sort=5&amp;type={$link5}'>{$lang["torrenttable_size"]}</a></td>\n   <td class='colhead' align='center'><a href='{$_SERVER["PHP_SELF"]}?{$oldlink}sort=6&amp;type={$link6}'>{$lang["torrenttable_snatched"]}</a></td>\n   <td class='colhead' align='right'><a href='{$_SERVER["PHP_SELF"]}?{$oldlink}sort=7&amp;type={$link7}'>{$lang["torrenttable_seeders"]}</a></td>\n   <td class='colhead' align='right'><a href='{$_SERVER["PHP_SELF"]}?{$oldlink}sort=8&amp;type={$link8}'>{$lang["torrenttable_leechers"]}</a></td>";
    if ($variant == 'index') {
        $htmlout .= "<td class='colhead' align='center'><a href='{$_SERVER["PHP_SELF"]}?{$oldlink}sort=9&amp;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 ? "&nbsp;<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("\"", "&quot;", readMore($row["descr"], 350, "details.php?id=" . (int) $row["id"] . "&amp;hit=1"));
        }
        $descr = str_replace('&', '&amp;', $descr);
        $htmlout .= "<td align='left'><a href='details.php?";
        if ($variant == "mytorrents") {
            $htmlout .= "returnto=" . urlencode($_SERVER["REQUEST_URI"]) . "&amp;";
        }
        $htmlout .= "id={$id}";
        if ($variant == "index") {
            $htmlout .= "&amp;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)) . '&amp;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" ? "&nbsp;<img src='{$INSTALLER09['pic_base_url']}scene.gif' title='Scene' alt='Scene' style='border:none' />" : ($row['release_group'] == "p2p" ? "&nbsp;<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 ? '&nbsp;<img src="' . $INSTALLER09['pic_base_url'] . 'freedownload.gif" width="12px" alt="Free Slot" title="Free Slot in Use" />&nbsp;<small>Free Slot</small>' : '';
        $double_slot = $double_slot == 1 ? '&nbsp;<img src="' . $INSTALLER09['pic_base_url'] . 'doubleseed.gif" width="12px" alt="Double Upload Slot" title="Double Upload Slot in Use" />&nbsp;<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:&nbsp;" . get_date($row['added'], 'DATE', 0, 1) . "</b><br /><b>Size:&nbsp;" . mksize(htmlsafechars($row["size"])) . "</b><br /><b>Subtitle:&nbsp;{$Subs}</b><br /><b>Seeders:&nbsp;" . htmlsafechars($row["seeders"]) . "</b><br /><b>Leechers:&nbsp;" . htmlsafechars($row["leechers"]) . "</b><br />{$poster}');\" onmouseout=\"UnTip();\"><b>" . CutName($dispname, 45) . "</b></a>&nbsp;&nbsp;<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>&nbsp;&nbsp;{$youtube}&nbsp;{$viponly}&nbsp;{$release_group}&nbsp;{$sticky}&nbsp;" . ($row['added'] >= $CURUSER['last_browse'] ? " <img src='{$INSTALLER09['pic_base_url']}newb.png' border='0' alt='New !' title='New !' />" : "") . "&nbsp;{$checked}&nbsp;{$free_tag}&nbsp;{$silver_tag}&nbsp;{$nuked}<br />{$free_slot}&nbsp;{$double_slot}&nbsp;{$newgenre}&nbsp;{$bump}&nbsp;{$smalldescr}</td>\n";
        if ($variant == "mytorrents") {
            $htmlout .= "<td align='center'><a href=\"download.php?torrent={$id}" . ($CURUSER['ssluse'] == 3 ? "&amp;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 ? "&amp;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 . '&amp;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 . '&amp;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}&amp;hit=1&amp;tocomm=1'>" . (int) $row["comments"] . "</a></b></td>\n";
            } else {
                $htmlout .= "<td align='right'><b><a href='details.php?id={$id}&amp;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;
}
Esempio n. 2
0
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 . "&amp;" . $get_name . "=" . $get_value;
            } else {
                $oldlink = $oldlink . $get_name . "=" . $get_value;
            }
            $count_get++;
        }
    }
    if ($count_get > 0) {
        $oldlink = $oldlink . "&amp;";
    }
    $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&amp;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&amp;type={$link2}'>{$lang["torrenttable_files"]}</a></td>\r\n   <td class='colhead' align='right'><a href='{$TBDEV['baseurl']}/browse.php?{$oldlink}sort=3&amp;type={$link3}'>{$lang["torrenttable_comments"]}</a></td>\r\n   <td class='colhead' align='center'><a href='{$TBDEV['baseurl']}/browse.php?{$oldlink}sort=4&amp;type={$link4}'>{$lang["torrenttable_added"]}</a></td>\r\n   <td class='colhead' align='center'><a href='{$TBDEV['baseurl']}/browse.php?{$oldlink}sort=5&amp;type={$link5}'>{$lang["torrenttable_size"]}</a></td>\r\n   <td class='colhead' align='center'><a href='{$TBDEV['baseurl']}/browse.php?{$oldlink}sort=6&amp;type={$link6}'>{$lang["torrenttable_snatched"]}</a></td>\r\n   <td class='colhead' align='right'><a href='{$TBDEV['baseurl']}/browse.php?{$oldlink}sort=7&amp;type={$link7}'>{$lang["torrenttable_seeders"]}</a></td>\r\n   <td class='colhead' align='right'><a href='{$TBDEV['baseurl']}/browse.php?{$oldlink}sort=8&amp;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&amp;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 ? "&nbsp;<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("\"", "&quot;", readMore($row["descr"], 350, "details.php?id=" . $row["id"] . "&amp;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"]) . "&amp;";
        }
        $htmlout .= "id={$id}";
        if ($variant == "index") {
            $htmlout .= "&amp;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:&nbsp;" . get_date($row['added'], 'DATE', 0, 1) . "</b><br /><b>Size:&nbsp;" . mksize(htmlspecialchars($row["size"])) . "</b><br /><b>Seeders:&nbsp;" . htmlspecialchars($row["seeders"]) . "</b><br /><b>Leechers:&nbsp;" . htmlspecialchars($row["leechers"]) . "</b><br />{$poster}');\" onmouseout=\"UnTip();\"><b>" . CutName($dispname, 45) . "</b></a>&nbsp;&nbsp;<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>&nbsp;&nbsp;{$sticky}&nbsp;" . ($row['added'] >= $CURUSER['last_browse'] ? " <img src='{$TBDEV['pic_base_url']}newb.png' border='0' alt='New !' title='New !' />" : "") . "&nbsp;{$checked}&nbsp;{$free_tag}&nbsp;{$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"]) . "&amp;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 . "&amp;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 . "&amp;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}&amp;hit=1&amp;tocomm=1'>" . $row["comments"] . "</a></b></td>\n";
            } else {
                $htmlout .= "<td align='right'><b><a href='details.php?id={$id}&amp;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;
}
    $tid[] = (int) $ta["id"];
}
if (isset($tids) && count($tids)) {
    $p = sql_query("SELECT p.id,p.torrent as tid,p.seeder, p.finishedat, p.downloadoffset, p.uploadoffset, p.ip, p.port, p.uploaded, p.downloaded, p.started AS started, p.last_action AS last_action, u.id as p_uid , u.username as p_user FROM peers AS p LEFT JOIN users as u on u.id=p.userid WHERE p.torrent IN (" . join(",", $tid) . ") AND p.seeder = 'yes' AND to_go=0 LIMIT 5") or sqlerr(__FILE__, __LINE__);
    while ($pa = mysqli_fetch_assoc($p)) {
        $peers[$pa["tid"]][] = $pa;
    }
}
$htmlout .= "<div align='center' style='width:90%'>\n        <fieldset style='border:2px solid #333333;'>\n            <legend style='padding:5xp 0px 0px 5px;'>{$lang['catol_search']}</legend>\n                <form  action='" . $_SERVER["PHP_SELF"] . "' method='get' style='margin:10px;'>\n                    <input type='text' size='50' name='search' value='" . ($search ? $search : "{$lang['catol_search_for_tor']}") . "' onblur=\"if (this.value == '') this.value='{$lang['catol_search_for_tor']}';\" onfocus=\"if (this.value == '{$lang['catol_search_for_tor']}') this.value='';\" />&nbsp;<input type='submit' value='search!' />\n                </form>";
for ($i = 97; $i < 123; ++$i) {
    $l = chr($i);
    $L = chr($i - 32);
    if ($l == $letter) {
        $htmlout .= "<font class=\"sublink-active\">{$L}</font>\n";
    } else {
        $htmlout .= "<a class=\"sublink\" href=\"" . $_SERVER["PHP_SELF"] . "?letter=" . $l . "\">" . $L . "</a>\n";
    }
}
$htmlout .= "</fieldset></div><br />";
$htmlout .= begin_frame();
if (count($rows) > 0) {
    $htmlout .= "<table width='95%' border='1' cellpadding='5' style='border-collapse:collapse'>\n        <tr><td align='left' colspan='2' class='colhead'>{$lang['catol_std_head']}</td></tr>\n        <tr><td align='left' colspan='2' >{$top}</td></tr>";
    foreach ($rows as $row) {
        $htmlout .= "<tr>\n         <td align='center' valign='top' nowrap='nowrap'>\n            <table align='center' width='160' border='1' cellpadding='2'>\n                <tr><td align='center' class='colhead'>{$lang['catol_upper']} : <a href='userdetails.php?id=" . (int) $row["owner"] . "'>" . ($row["user"] ? htmlsafechars($row["user"]) : "{$lang['catol_unknown']}[" . (int) $row["owner"] . "]") . "</a></td></tr>\n                <tr><td align='center'>" . ($row["poster"] ? "<a href=\"" . htmlsafechars($row["poster"]) . "\"><img src=\"" . htmlsafechars($row["poster"]) . "\" border=\"0\" width=\"150\" height=\"195\" alt=\"{$lang['catol_no_poster']}\" title=\"{$lang['catol_no_poster']}\" /></a>" : "<img src=\"pic/noposter.png\" border=\"0\" width=\"150\" alt=\"{$lang['catol_no_poster']}\" title=\"{$lang['catol_no_poster']}\" />") . "</td></tr>\n            </table>\n\n        </td>\n\n            <td align='center' width='100%' valign='top'>\n            <table width='100%' cellpadding='3' cellspacing='0' border='1' style='border-collapse:collapse;font-weight:bold;'>\n            <tr>\n                <td align='center' width='100%' rowspan='2' ><a href='details.php?id=" . (int) $row["id"] . "&amp;hit=1'><b>" . substr(htmlsafechars($row["name"]), 0, 60) . "</b></a></td>\n                <td align='center' class='colhead'>{$lang['catol_added']}</td>\n                <td align='center' class='colhead'>{$lang['catol_size']}</td>\n                <td align='center' class='colhead'>{$lang['catol_snatched']}</td>\n                <td align='center' class='colhead'>S.</td>\n                <td align='center' class='colhead'>L.</td>\n            </tr>\n            <tr>\n                <td align='center'>" . get_date($row["added"], 'LONG', 0, 1) . "</td>\n                <td align='center' nowrap='nowrap'>" . mksize($row["size"]) . "</td>\n                <td align='center' nowrap='nowrap'>" . ($row["snatched"] > 0 ? $row["snatched"] == 1 ? (int) $row["snatched"] . " time" : (int) $row["snatched"] . " times" : 0) . "</td>\n                <td align='center'>" . (int) $row["seeders"] . "</td>\n                <td align='center'>" . (int) $row["leechers"] . "</td>\n            </tr>\n            <tr><td width='100%' colspan='6' class='colhead' >{$lang['catol_info']}.</td></tr>\n            <tr><td width='100%' colspan='6' style='font-weight:normal;' >" . readMore($row["descr"], 500, "details.php?id=" . (int) $row["id"] . "&amp;hit=1") . "</td></tr>\n            <tr><td width='100%' colspan='6' class='colhead'>{$lang['catol_seeder_info']}</td></tr>\n            <tr><td width='100%' colspan='6' style='font-weight:normal;' >" . (isset($peers[$row["id"]]) ? peer_list($peers[$row["id"]]) : "{$lang['catol_no_info_show']}") . "</td></tr>\n            </table></td></tr>";
    }
    $htmlout .= "<tr><td align='left' colspan='2' >{$bottom}</td></tr>\n        <tr><td align='right' colspan='2' class='colhead'>{$lang['catol_orig_created_by']}</td></tr>\n        </table>";
} else {
    $htmlout .= "<h2>{$lang['catol_nothing_found']}!</h2>";
}
$htmlout .= end_frame();
echo stdhead($lang['catol_std_head']) . $htmlout . stdfoot();
Esempio n. 4
0
        $peers[$pa["tid"]][] = $pa;
    }
}
$htmlout .= "<div class='row'><div class='col-md-12'>\n        <fieldset style='border:2px solid #333333;'>\n            <div class='row'><div class='col-md-8 col-md-push-2'><h4 class='text-center'>{$lang['catol_search']}</h4>\n                <form  action='" . $_SERVER["PHP_SELF"] . "' method='get' style='margin:10px;'>\n                    <input type='text' size='100' name='search' value='" . ($search ? $search : "{$lang['catol_search_for_tor']}") . "' onblur=\"if (this.value == '') this.value='{$lang['catol_search_for_tor']}';\" onfocus=\"if (this.value == '{$lang['catol_search_for_tor']}') this.value='';\" />&nbsp;<input type='submit' value='search!' />\n                </form></div></div>";
$htmlout .= "<div class='row'><div class='col-md-8 col-md-push-4'>";
for ($i = 97; $i < 123; ++$i) {
    $l = chr($i);
    $L = chr($i - 32);
    if ($l == $letter) {
        $htmlout .= "<font class=\"sublink-active\">{$L}</font>\n";
    } else {
        $htmlout .= "<a class=\"sublink\" href=\"" . $_SERVER["PHP_SELF"] . "?letter=" . $l . "\">" . $L . "</a>\n";
    }
    $htmlout .= "<!--</div></div>-->";
}
$htmlout .= "</fieldset></div></div><br>";
$htmlout .= "<div class='container'>";
if (count($rows) > 0) {
    $htmlout .= "<div class='row'><div class='col-md-10'>" . $pager['pagerbottom'] . "</div><br><br><div class='col-md-2 col-md-push-0'><a class='btn btn-default btn-link' title='Back to Browse' href='" . $INSTALLER09['baseurl'] . "/browse.php'>Back to Browse</a></div></div>";
    $htmlout .= "<h3 class='text-center'>{$lang['catol_std_head']}</h3>";
    $htmlout .= "<div class='row'>";
    foreach ($rows as $row) {
        $htmlout .= "<div class='panel col-sm-3 col-sm-offset-0 panel-default browsep'>\n        <div style='display:block; height:5px;'></div>\n\n  \t<p class='browsed text-center'><b><font color='rgb(67,158,76)'>{$lang['catol_upper']} :</font></b>&nbsp;<a href='userdetails.php?id=" . (int) $row["owner"] . "'>" . ($row["user"] ? htmlsafechars($row["user"]) : "{$lang['catol_unknown']}[" . (int) $row["owner"] . "]") . "</a></p>\n\n\t<p class='browsepd text-center'>" . ($row["poster"] ? "<a href=\"" . htmlsafechars($row["poster"]) . "\"><img src=\"" . htmlsafechars($row["poster"]) . "\" border=\"0\" width=\"150\" height=\"225\" alt=\"{$lang['catol_no_poster']}\" title=\"{$lang['catol_no_poster']}\" /></a>" : "<img src=\"pic/noposter.png\" border=\"0\" width=\"150\" alt=\"{$lang['catol_no_poster']}\" title=\"{$lang['catol_no_poster']}\" />") . "</p>\n  \n<p  class='squashp browsepd text-center'><b><font color='rgb(67,158,76)'>Torrent:</font></b>&nbsp;<a href='details.php?id=" . (int) $row["id"] . "&amp;hit=1'><b>" . substr(htmlsafechars($row["name"]), 0, 60) . "</b></a></p>\n\t\n";
        $htmlout .= "<div class=''>\n<p><b><font color='rgb(67,158,76)'>{$lang['catol_added']}:</font></b>&nbsp;" . get_date($row["added"], 'LONG', 0, 1) . "<br>\n           <b><font color='rgb(67,158,76)'>{$lang['catol_size']}:</font></b>&nbsp;" . mksize($row["size"]) . "<br >\n           <b><font color='rgb(67,158,76)'>{$lang['catol_snatched']}:</font></b>&nbsp;" . ($row["snatched"] > 0 ? $row["snatched"] == 1 ? (int) $row["snatched"] . " time" : (int) $row["snatched"] . " times" : 0) . "<br>\n           <b><font color='rgb(67,158,76)'>Seeds:</font></b>&nbsp;" . (int) $row["seeders"] . "<br>\n           <b><font color='rgb(67,158,76)'>Leechers:</font></b>&nbsp;" . (int) $row["leechers"] . "<br>\n          </p>\n  \t<p class='squashp'><b><font color='rgb(67,158,76)'>{$lang['catol_info']}:</font></b>&nbsp;" . readMore($row["descr"], 500, "details.php?id=" . (int) $row["id"] . "&amp;hit=1") . "</p>\n  \t<!--<p><b><font color='rgb(67,158,76)'>{$lang['catol_seeder_info']}:</font></b>" . (isset($peers[$row["id"]]) ? peer_list($peers[$row["id"]]) : "{$lang['catol_no_info_show']}") . "</p>-->\n\t<p><b><font color='rgb(67,158,76)'>{$lang['catol_orig_created_by']}</font></b></p></div></div>";
    }
    $htmlout .= "</div></div><br>";
    $htmlout .= $pager['pagerbottom'] . "<br>";
} else {
    $htmlout .= "<div class='row'><div class='col-sm-04'><h2>{$lang['catol_nothing_found']}!</h2></div></div>";
}
echo stdhead($lang['catol_std_head']) . $htmlout . stdfoot();
Esempio n. 5
0
    $tid[] = $ta["id"];
}
if (isset($tids) && count($tids)) {
    $p = sql_query("SELECT p.id,p.torrent as tid,p.seeder, p.finishedat, p.downloadoffset, p.uploadoffset, p.ip, p.port, p.uploaded, p.downloaded, p.started AS started, p.last_action AS last_action, u.id as p_uid , u.username as p_user FROM peers AS p LEFT JOIN users as u on u.id=p.userid WHERE p.torrent IN (" . join(",", $tid) . ") AND p.seeder = 'yes' AND to_go=0 LIMIT 5") or sqlerr(__FILE__, __LINE__);
    while ($pa = mysql_fetch_assoc($p)) {
        $peers[$pa["tid"]][] = $pa;
    }
}
$htmlout .= "<div align='center' style='width:90%'>\r\n\t\t<fieldset style='border:2px solid #333333;'>\r\n\t\t\t<legend style='padding:5xp 0px 0px 5px;'>Search</legend>\r\n\t\t\t\t<form  action='" . $_SERVER["PHP_SELF"] . "' method='get' style='margin:10px;'>\r\n\t\t\t\t\t<input type='text' size='50' name='search' value='" . ($search ? $search : "Search for a torrent") . "' onblur=\"if (this.value == '') this.value='Search for a torrent';\" onfocus=\"if (this.value == 'Search for a torrent') this.value='';\" />&nbsp;<input type='submit' value='search!' />\r\n\t\t\t\t</form>";
for ($i = 97; $i < 123; ++$i) {
    $l = chr($i);
    $L = chr($i - 32);
    if ($l == $letter) {
        $htmlout .= "<font class=\"sublink-active\">{$L}</font>\n";
    } else {
        $htmlout .= "<a class=\"sublink\" href=\"" . $_SERVER["PHP_SELF"] . "?letter=" . $l . "\">" . $L . "</a>\n";
    }
}
$htmlout .= "</fieldset></div><br />";
$htmlout .= begin_frame();
if (count($rows) > 0) {
    $htmlout .= "<table width='95%' border='1' cellpadding='5' style='border-collapse:collapse'>\r\n    \t<tr><td align='left' colspan='2' class='colhead'>Catalogue</td></tr>\r\n    \t<tr><td align='left' colspan='2' >{$top}</td></tr>";
    foreach ($rows as $row) {
        $htmlout .= "<tr>\r\n\t\t <td align='center' valign='top' nowrap='nowrap'>\r\n        \t<table align='center' width='160' border='1' cellpadding='2'>\r\n            \t<tr><td align='center' class='colhead'>Upper : <a href='userdetails.php?id=" . $row["owner"] . "'>" . ($row["user"] ? $row["user"] : "******" . $row["owner"] . "]") . "</a></td></tr>\r\n                <tr><td align='center'>" . ($row["poster"] ? "<a href=\"" . $row["poster"] . "\"><img src=\"" . $row["poster"] . "\" border=\"0\" width=\"150\" height=\"195\" alt=\"No Poster\" title=\"No Poster\" /></a>" : "<img src=\"pic/noposter.png\" border=\"0\" width=\"150\" alt=\"No Poster\" title=\"No Poster\" />") . "</td></tr>\r\n            </table>\r\n\r\n        </td>\r\n\r\n            <td align='center' width='100%' valign='top'>\r\n\t\t\t<table width='100%' cellpadding='3' cellspacing='0' border='1' style='border-collapse:collapse;font-weight:bold;'>\r\n\t\t\t<tr>\r\n\t\t\t\t<td align='center' width='100%' rowspan='2' ><a href='details.php?id=" . $row["id"] . "&amp;hit=1'><b>" . substr($row["name"], 0, 60) . "</b></a></td>\r\n\t\t\t\t<td align='center' class='colhead'>Added</td>\r\n\t\t\t\t<td align='center' class='colhead'>Size</td>\r\n\t\t\t\t<td align='center' class='colhead'>Snatched</td>\r\n\t\t\t\t<td align='center' class='colhead'>S.</td>\r\n\t\t\t\t<td align='center' class='colhead'>L.</td>\r\n\t\t\t</tr>\r\n\t\t\t<tr>\r\n\t\t\t\t<td align='center'>" . get_date($row["added"], 'LONG', 0, 1) . "</td>\r\n\t\t\t\t<td align='center' nowrap='nowrap'>" . mksize($row["size"]) . "</td>\r\n\t\t\t\t<td align='center' nowrap='nowrap'>" . ($row["snatched"] > 0 ? $row["snatched"] == 1 ? $row["snatched"] . " time" : $row["snatched"] . " times" : 0) . "</td>\r\n\t\t\t\t<td align='center'>" . $row["seeders"] . "</td>\r\n\t\t\t\t<td align='center'>" . $row["leechers"] . "</td>\r\n\t\t\t</tr>\r\n\t\t\t<tr><td width='100%' colspan='6' class='colhead' >Info.</td></tr>\r\n\t\t\t<tr><td width='100%' colspan='6' style='font-weight:normal;' >" . readMore($row["descr"], 500, "details.php?id=" . $row["id"] . "&amp;hit=1") . "</td></tr>\r\n\t\t\t<tr><td width='100%' colspan='6' class='colhead'>Seeder Info (Top 5 Seeders)</td></tr>\r\n\t\t\t<tr><td width='100%' colspan='6' style='font-weight:normal;' >" . (isset($peers[$row["id"]]) ? peer_list($peers[$row["id"]]) : "No information to show") . "</td></tr>\r\n\t\t\t</table></td></tr>";
    }
    $htmlout .= "<tr><td align='left' colspan='2' >{$bottom}</td></tr>\r\n\t\t<tr><td align='right' colspan='2' class='colhead'>Original By EnzoF1 recoded by Putyn, Updated for 09 by Bigjoos</td></tr>\r\n\t\t</table>";
} else {
    $htmlout .= "<h2>Nothing found!</h2>";
}
$htmlout .= end_frame();
print stdhead('Catalogue') . $htmlout . stdfoot();
Esempio n. 6
0
    foreach ($notices as $notice) {
        ?>
									<tr>
										<td><?php 
        echo bn2enNumber($sl++);
        ?>
</td>
										<td><?php 
        echo $notice['noticetitle'];
        ?>
</td>
										<td>
										<?php 
        $description = $notice['noticedescription'];
        $newsid = $notice['noticeid'];
        echo readMore($description, 200, "notice/" . $newsid, "বিস্তারিত");
        ?>
										
										</td>
										<td><?php 
        echo bn2enNumber($notice['publishdate']);
        ?>
</td>
										<td class="thDownload">
										<?php 
        $note = $notice['attachment'];
        if ($note) {
            echo fileIcon($note);
        }
        ?>
										
Esempio n. 7
0
				<td align="center" nowrap="nowrap"><?php 
        echo $row["snatched"] > 0 ? $row["snatched"] == 1 ? $row["snatched"] . " time" : $row["snatched"] . " times" : 0;
        ?>
</td>
				<td align="center"><?php 
        echo $row["seeders"];
        ?>
</td>
				<td align="center"><?php 
        echo $row["leechers"];
        ?>
</td>
			</tr>
			<tr><td width="100%" colspan="6" class="colhead" >Info.</td></tr>
			<tr><td width="100%" colspan="6" style="font-weight:normal;" ><?php 
        echo readMore($row["descr"], 500, "details.php?id=" . $row["id"] . "&amp;hit=1");
        ?>
</td></tr>
			<tr><td width="100%" colspan="6" class="colhead">Seeder Info (Top 5 Seeders)</td></tr>
			<tr><td width="100%" colspan="6" style="font-weight:normal;" ><?php 
        echo isset($peers[$row["id"]]) ? peer_list($peers[$row["id"]]) : "No information to show";
        ?>
</td></tr>
			</table>

            </td>
       </tr>

		<?php 
    }
    ?>
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 . "&amp;" . $get_name . "=" . $get_value;
            } else {
                $oldlink = $oldlink . $get_name . "=" . $get_value;
            }
            $count_get++;
        }
    }
    if ($count_get > 0) {
        $oldlink = $oldlink . "&amp;";
    }
    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&amp;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&amp;type=<?php 
        echo $link4;
        ?>
">&nbsp;&nbsp;<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&amp;type=<?php 
    echo $link2;
    ?>
">&nbsp;&nbsp;&nbsp;<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&amp;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&amp;type=<?php 
    echo $link6;
    ?>
"><?php 
    echo $language['size'];
    ?>
</a></td>
<td class="colhead" align="center"><a href="browse.php?<?php 
    echo $oldlink;
    ?>
sort=7&amp;type=<?php 
    echo $link7;
    ?>
">&nbsp;&nbsp;<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&amp;type=<?php 
    echo $link8;
    ?>
">&nbsp;&nbsp;<img src=pic/arrowup2.gif border="0" alt=Seeders />&nbsp;&nbsp;</a></td>
<td class="colhead" align="center"><a href="browse.php?<?php 
    echo $oldlink;
    ?>
sort=9&amp;type=<?php 
    echo $link9;
    ?>
">&nbsp;&nbsp;<img src=pic/arrowdown2.gif border="0" alt=Leechers />&nbsp;&nbsp;</a></td>
<?php 
    if ($variant == "index") {
        echo "<td class=\"colhead\" align=\"center\"><a href=\"browse.php?{$oldlink}sort=9&amp;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" ? "&nbsp;<img src='pic/scene.gif' border=0 title='Scene' alt='Scene'/>" : "";
        $request = $row["request"] == "yes" ? "&nbsp;<img src='pic/request.gif' border=0 title='Request' alt='Request'/>" : "";
        $nuked = $row["nuked"] == "yes" ? "&nbsp;<img src='pic/nuked.gif' border=0 title='nuked' alt='Nuked'/>" : "";
        $newtag = sql_timestamp_to_unix_timestamp($row['added']) >= $_SESSION['browsetime'] ? '&nbsp;<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 ? "&nbsp;<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("\"", "&quot;", readMore($row["descr"], 350, "details.php?id=" . $row["id"] . "&amp;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>&nbsp;<a href=\"javascript:klappe_descr('descr" . $row["id"] . "');\" ><img src=\"/pic/plus.gif\" border=\"0\" title=\"Show torrent info in this page\"/></a>&nbsp;{$sticky}&nbsp;{$request}&nbsp;{$scene}&nbsp;{$nuked}<br />{$nukereason}&nbsp;{$newtag}&nbsp;{$viponly}&nbsp;{$countstats}&nbsp;{$half}&nbsp;{$description}\n";
        // //////////multiplicator///
        if ($row["multiplicator"] == "2") {
            $multiplicator = "&nbsp;<img src=\"pic/multi2.gif\" title=\"X2 Upload\">&nbsp;";
        } elseif ($row["multiplicator"] == "3") {
            $multiplicator = "&nbsp;<img src=\"pic/multi3.gif\" title=\"X3 Upload\">&nbsp;";
        } elseif ($row["multiplicator"] == "4") {
            $multiplicator = "&nbsp;<img src=\"pic/multi4.gif\" title=\"X4 Upload\">&nbsp;";
        } elseif ($row["multiplicator"] == "5") {
            $multiplicator = "&nbsp;<img src=\"pic/multi5.gif\" title=\"X5 Upload\">&nbsp;";
        }
        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 . '&amp;action=add\'><img src=\'' . $pic_base_url . 'bookmark.gif\' border=\'0\' alt=\'Bookmark it!\' title=\'Bookmark it!\' /></a>' : '<a href="bookmark.php?torrent=' . $id . '&amp;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}&amp;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}&amp;hit=1&amp;tocomm=1\">" . $row["comments"] . "</a></b></td>\n";
            } else {
                echo "<td align=\"right\"><b><a href=\"details.php?id={$id}&amp;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}&amp;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}&amp;hit=1&amp;#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";
}