Ejemplo n.º 1
0
function category_read()
{
    global $admintpl, $language, $STYLEURL, $CURUSER, $STYLEPATH, $btit_settings;
    $admintpl->set("language", $language);
    $cres = genrelist();
    for ($i = 0; $i < count($cres); $i++) {
        $cres[$i]["frm_number"] = "form" . $i;
        $cres[$i]["name"] = unesc($cres[$i]["name"]);
        $cres[$i]["image"] = "<img src=\"{$STYLEURL}/images/categories/" . $cres[$i]["image"] . "\" alt=\"\" border=\"0\" />";
        $cres[$i]["smf_select"] = get_forum_list($cres[$i]["forumid"], $cres[$i]["id"]);
    }
    $admintpl->set("categories", $cres);
    unset($cres);
}
Ejemplo n.º 2
0
function category_read()
{
    global $admintpl, $language, $STYLEURL, $CURUSER, $STYLEPATH;
    $admintpl->set("category_add", false, true);
    $admintpl->set("language", $language);
    $cres = genrelist();
    for ($i = 0; $i < count($cres); $i++) {
        $cres[$i]["name"] = unesc($cres[$i]["name"]);
        $cres[$i]["image"] = "<img src=\"{$STYLEURL}/images/categories/" . $cres[$i]["image"] . "\" alt=\"\" border=\"0\" />";
        $cres[$i]["edit"] = "<a href=\"index.php?page=admin&amp;user="******"uid"] . "&amp;code=" . $CURUSER["random"] . "&amp;do=category&amp;action=edit&amp;id=" . $cres[$i]["id"] . "\">" . image_or_link("{$STYLEPATH}/images/edit.png", "", $language["EDIT"]) . "</a>";
        $cres[$i]["delete"] = "<a href=\"index.php?page=admin&amp;user="******"uid"] . "&amp;code=" . $CURUSER["random"] . "&amp;do=category&amp;action=delete&amp;id=" . $cres[$i]["id"] . "\" onclick=\"return confirm('" . AddSlashes($language["DELETE_CONFIRM"]) . "')\">" . image_or_link("{$STYLEPATH}/images/delete.png", "", $language["DELETE"]) . "</a>";
    }
    $admintpl->set("categories", $cres);
    $admintpl->set("category_add_new", "<a href=\"index.php?page=admin&amp;user="******"uid"] . "&amp;code=" . $CURUSER["random"] . "&amp;do=category&amp;action=add\">" . $language["CATEGORY_ADD"] . "</a>");
    unset($cres);
}
Ejemplo n.º 3
0
function category_read()
{
    global $admintpl, $language, $STYLEURL, $CURUSER, $STYLEPATH;
    $admintpl->set("category_add", false, true);
    $admintpl->set("language", $language);
    $admintpl->set("perm", false, true);
    $admintpl->set("permedit", false, true);
    $cres = genrelist();
    for ($i = 0; $i < count($cres); $i++) {
        $cres[$i]["name"] = unesc($cres[$i]["name"]);
        $cres[$i]["perm"] = "<a href=\"index.php?page=admin&amp;user="******"uid"] . "&amp;code=" . $CURUSER["random"] . "&amp;do=category&amp;action=perm&amp;id=" . $cres[$i]["id"] . "\">" . image_or_link("{$STYLEPATH}/images/edit.png", "", $language["PERMISSIONS"]) . "</a>";
        $cres[$i]["image"] = "<img src=\"{$STYLEURL}/images/categories/" . $cres[$i]["image"] . "\" alt=\"\" border=\"0\" />";
        $cres[$i]["edit"] = "<a href=\"index.php?page=admin&amp;user="******"uid"] . "&amp;code=" . $CURUSER["random"] . "&amp;do=category&amp;action=edit&amp;id=" . $cres[$i]["id"] . "\">" . image_or_link("{$STYLEPATH}/images/edit.png", "", $language["EDIT"]) . "</a>";
        $cres[$i]["delete"] = "<a href=\"index.php?page=admin&amp;user="******"uid"] . "&amp;code=" . $CURUSER["random"] . "&amp;do=category&amp;action=delete&amp;id=" . $cres[$i]["id"] . "\" onclick=\"return confirm('" . AddSlashes($language["DELETE_CONFIRM"]) . "')\">" . image_or_link("{$STYLEPATH}/images/delete.png", "", $language["DELETE"]) . "</a>";
    }
    $admintpl->set("categories", $cres);
    $admintpl->set("category_add_new", "<a href=\"index.php?page=admin&amp;user="******"uid"] . "&amp;code=" . $CURUSER["random"] . "&amp;do=category&amp;action=add\">" . $language["CATEGORY_ADD"] . "</a>");
    $ajax_order = "<script type=\"text/javascript\">\n\t   \t\tfunction updateOrder()\n            {\n                var options = {\n                                method : 'post',\n                                parameters : Sortable.serialize('categories_list'),\n                                onComplete : function(request) {                                \t\n\t\t\t                        new Effect.Highlight(ID.id,{duration:3});\n\t\t\t                        \n\t\t\t                    }\n                              };\n                new Ajax.Request('index.php?page=admin&user="******"user"] . "&code=" . $_GET["code"] . "&do=category&action=order', options);\n            }\n  \t Sortable.create('categories_list', { onUpdate : updateOrder });\n\t   \n            \n</script>";
    $admintpl->set('ajax_order', $ajax_order);
    unset($cres);
}
Ejemplo n.º 4
0
print "</td></tr>\n";
if ($allowtorrents) {
    $disablespecial = " onchange=\"disableother('browsecat','specialcat')\"";
    $s = "<select name=\"type\" id=\"browsecat\" " . ($allowtwosec ? $disablespecial : "") . ">\n<option value=\"0\">" . $lang_upload['select_choose_one'] . "</option>\n";
    $cats = genrelist($browsecatmode);
    foreach ($cats as $row) {
        $s .= "<option value=\"" . $row["id"] . "\">" . htmlspecialchars($row["name"]) . "</option>\n";
    }
    $s .= "</select>\n";
} else {
    $s = "";
}
if ($allowspecial) {
    $disablebrowse = " onchange=\"disableother('specialcat','browsecat')\"";
    $s2 = "<select name=\"type\" id=\"specialcat\" " . $disablebrowse . ">\n<option value=\"0\">" . $lang_upload['select_choose_one'] . "</option>\n";
    $cats2 = genrelist($specialcatmode);
    foreach ($cats2 as $row) {
        $s2 .= "<option value=\"" . $row["id"] . "\">" . htmlspecialchars($row["name"]) . "</option>\n";
    }
    $s2 .= "</select>\n";
} else {
    $s2 = "";
}
tr($lang_upload['row_type'] . "<font color=\"red\">*</font>", ($allowtwosec ? $lang_upload['text_to_browse_section'] : "") . $s . ($allowtwosec ? $lang_upload['text_to_special_section'] : "") . $s2 . ($allowtwosec ? $lang_upload['text_type_note'] : ""), 1);
if ($showsource || $showmedium || $showcodec || $showaudiocodec || $showstandard || $showprocessing) {
    if ($showsource) {
        $source_select = torrent_selection($lang_upload['text_source'], "source_sel", "sources");
    } else {
        $source_select = "";
    }
    if ($showmedium) {
Ejemplo n.º 5
0
function bookmarktable($res, $variant = "index")
{
    global $INSTALLER09, $CURUSER, $lang;
    $htmlout = '';
    $htmlout .= "\r\n   <span>Icon Legend :\r\n   <img src='{$INSTALLER09['pic_base_url']}aff_cross.gif' alt='Delete Bookmark' border='none' /> = Delete Bookmark |\r\n   <img src='{$INSTALLER09['pic_base_url']}zip.gif' alt='Download Bookmark' border='none' /> = Download Torrent |\r\n   <img alt='Bookmark is Private' src='{$INSTALLER09['pic_base_url']}key.gif' border='none'  /> = Bookmark is Private |\r\n   <img src='{$INSTALLER09['pic_base_url']}public.gif' alt='Bookmark is Public' border='none'  /> = Bookmark is Public</span>\r\n   <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'>{$lang["torrenttable_name"]}</td>";
    $htmlout .= ($variant == 'index' ? '<td class="colhead" align="center">Delete</td><td class="colhead" align="right">' : '') . 'Download</td><td class="colhead" align="right">Share</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'>{$lang["torrenttable_files"]}</td>\r\n   <td class='colhead' align='right'>{$lang["torrenttable_comments"]}</td>\r\n   <td class='colhead' align='center'>{$lang["torrenttable_added"]}</td>\r\n   <td class='colhead' align='center'>{$lang["torrenttable_size"]}</td>\r\n   <td class='colhead' align='center'>{$lang["torrenttable_snatched"]}</td>\r\n   <td class='colhead' align='right'>{$lang["torrenttable_seeders"]}</td>\r\n   <td class='colhead' align='right'>{$lang["torrenttable_leechers"]}</td>";
    if ($variant == 'index') {
        $htmlout .= "<td class='colhead' align='center'>{$lang["torrenttable_uppedby"]}</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)) {
        $row['cat_name'] = htmlsafechars($change[$row['category']]['name']);
        $row['cat_pic'] = htmlsafechars($change[$row['category']]['image']);
        $id = (int) $row["id"];
        $htmlout .= "<tr>\n";
        $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']}/" . htmlsafechars($row['cat_pic']) . "' alt='" . htmlsafechars($row['cat_name']) . "' />";
            } else {
                $htmlout .= htmlsafechars($row["cat_name"]);
            }
            $htmlout .= "</a>";
        } else {
            $htmlout .= "-";
        }
        $htmlout .= "</td>\n";
        $dispname = htmlsafechars($row["name"]);
        $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";
        }
        $htmlout .= "'><b>{$dispname}</b></a>&nbsp;</td>\n";
        $htmlout .= $variant == "index" ? "<td align='center'><a href='bookmark.php?torrent={$id}&amp;action=delete'><img src='{$INSTALLER09['pic_base_url']}aff_cross.gif' border='0' alt='Delete Bookmark!' title='Delete Bookmark!' /></a></td>" : "";
        $htmlout .= $variant == "index" ? "<td align='center'><a href='download.php?torrent={$id}'><img src='{$INSTALLER09['pic_base_url']}zip.gif' border='0' alt='Download Bookmark!' title='Download Bookmark!' /></a></td>" : "";
        $bm = sql_query("SELECT * FROM bookmarks WHERE torrentid=" . sqlesc($id) . " && userid=" . sqlesc($CURUSER['id']));
        $bms = mysqli_fetch_assoc($bm);
        if ($bms['private'] == 'yes' && $bms['userid'] == $CURUSER['id']) {
            $makepriv = "<a href='bookmark.php?torrent={$id}&amp;action=public'><img src='{$INSTALLER09['pic_base_url']}key.gif' border='0' alt='Mark Bookmark Public!' title='Mark Bookmark Public!' /></a>";
            $htmlout .= "" . ($variant == "index" ? "<td align='center'>{$makepriv}</td>" : "");
        } elseif ($bms['private'] == 'no' && $bms['userid'] == $CURUSER['id']) {
            $makepriv = "<a href='bookmark.php?torrent=" . $id . "&amp;action=private'><img src='{$INSTALLER09['pic_base_url']}public.gif' border='0' alt='Mark Bookmark Private!' title='Mark Bookmark Private!' /></a>";
            $htmlout .= "" . ($variant == "index" ? "<td align='center'>{$makepriv}</td>" : "");
        }
        if ($variant == "mytorrents") {
            $htmlout .= "</td><td align='center'><a href='edit.php?returnto=" . urlencode($_SERVER["REQUEST_URI"]) . "&amp;id=" . (int) $row["id"] . "'>{$lang["torrenttable_edit"]}</a>\n";
        }
        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";
        }
        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 ((int) $row["seeders"]) {
            if ($variant == "index") {
                if ($row["leechers"]) {
                    $ratio = (int) $row["seeders"] / (int) $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 ((int) $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"]) ? "<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 .= "</table>\n";
    return $htmlout;
}
Ejemplo n.º 6
0
 print "<tr><td class=\"rowhead\">" . $lang_edit['row_description'] . "<font color=\"red\">*</font></td><td class=\"rowfollow\">";
 textbbcode("edittorrent", "descr", $row["descr"], false);
 print "</td></tr>";
 $s = "<select name=\"type\" id=\"oricat\">";
 $cats = genrelist($sectionmode);
 foreach ($cats as $subrow) {
     $s .= "<option value=\"" . $subrow["id"] . "\"";
     if ($subrow["id"] == $row["category"]) {
         $s .= " selected=\"selected\"";
     }
     $s .= ">" . htmlspecialchars($subrow["name"]) . "</option>\n";
 }
 $s .= "</select>\n";
 if ($allowmove) {
     $s2 = "<select name=\"type\" id=newcat disabled>\n";
     $cats2 = genrelist($othermode);
     foreach ($cats2 as $subrow) {
         $s2 .= "<option value=\"" . $subrow["id"] . "\"";
         if ($subrow["id"] == $row["category"]) {
             $s2 .= " selected=\"selected\"";
         }
         $s2 .= ">" . htmlspecialchars($subrow["name"]) . "</option>\n";
     }
     $s2 .= "</select>\n";
     $movecheckbox = "<input type=\"checkbox\" id=movecheck name=\"movecheck\" value=\"1\" onclick=\"disableother2('oricat','newcat')\" />";
 }
 tr($lang_edit['row_type'] . "<font color=\"red\">*</font>", $s . ($allowmove ? "&nbsp;&nbsp;" . $movecheckbox . $movenote . $s2 : ""), 1);
 if ($showsource || $showmedium || $showcodec || $showaudiocodec || $showstandard || $showprocessing) {
     if ($showsource) {
         $source_select = torrent_selection($lang_edit['text_source'], "source_sel", "sources", $row["source"]);
     } else {
Ejemplo n.º 7
0
print "<p align=\"left\"><b><font size=\"5\">" . $lang_offers['text_rules'] . "</font></b></p>\n";
print "<div align=\"left\"><ul>";
print "<li>" . $lang_offers['text_rule_one_one'] . get_user_class_name($upload_class, false, true, true) . $lang_offers['text_rule_one_two'] . get_user_class_name($addoffer_class, false, true, true) . $lang_offers['text_rule_one_three'] . "</li>\n";
print "<li>" . $lang_offers['text_rule_two_one'] . "<b>" . $minoffervotes . "</b>" . $lang_offers['text_rule_two_two'] . "</li>\n";
if ($offervotetimeout_main) {
    print "<li>" . $lang_offers['text_rule_three_one'] . "<b>" . $offervotetimeout_main / 3600 . "</b>" . $lang_offers['text_rule_three_two'] . "</li>\n";
}
if ($offeruptimeout_main) {
    print "<li>" . $lang_offers['text_rule_four_one'] . "<b>" . $offeruptimeout_main / 3600 . "</b>" . $lang_offers['text_rule_four_two'] . "</li>\n";
}
print "</ul></div>";
if (get_user_class() >= $addoffer_class) {
    print "<div align=\"center\" style=\"margin-bottom: 8px;\"><a href=\"?add_offer=1\">" . "<b>" . $lang_offers['text_add_offer'] . "</b></a></div>";
}
print "<div align=\"center\"><form method=\"get\" action=\"?\">" . $lang_offers['text_search_offers'] . "&nbsp;&nbsp;<input type=\"text\" id=\"specialboxg\" name=\"search\" />&nbsp;&nbsp;";
$cats = genrelist($browsecatmode);
$catdropdown = "";
foreach ($cats as $cat) {
    $catdropdown .= "<option value=\"" . $cat["id"] . "\"";
    $catdropdown .= ">" . htmlspecialchars($cat["name"]) . "</option>\n";
}
print "<select name=\"category\"><option value=\"0\">" . $lang_offers['select_show_all'] . "</option>" . $catdropdown . "</select>&nbsp;&nbsp;<input type=\"submit\" class=\"btn\" value=\"" . $lang_offers['submit_search'] . "\" /></form></div>";
end_frame();
print "<br /><br />";
$last_offer = strtotime($CURUSER['last_offer']);
if (!$num) {
    stdmsg($lang_offers['text_nothing_found'], $lang_offers['text_nothing_found']);
} else {
    $catid = $_GET[category];
    print "<table class=\"torrents\" cellspacing=\"0\" cellpadding=\"5\" width=\"100%\">";
    print "<tr><td class=\"colhead\" style=\"padding: 0px\"><a href=\"?category=" . $catid . "&amp;sort=cat&amp;type=" . $cat_order_type . "\">" . $lang_offers['col_type'] . "</a></td>" . "<td class=\"colhead\" width=\"100%\"><a href=\"?category=" . $catid . "&amp;sort=name&amp;type=" . $name_order_type . "\">" . $lang_offers['col_title'] . "</a></td>" . "<td colspan=\"3\" class=\"colhead\"><a href=\"?category=" . $catid . "&amp;sort=v_res&amp;type=" . $v_res_order_type . "\">" . $lang_offers['col_vote_results'] . "</a></td>" . "<td class=\"colhead\"><a href=\"?category=" . $catid . "&amp;sort=comments&amp;type=" . $comments_order_type . "\"><img class=\"comments\" src=\"pic/trans.gif\" alt=\"comments\" title=\"" . $lang_offers['title_comment'] . "\" />" . $lang_offers['col_comment'] . "</a></td>" . "<td class=\"colhead\"><a href=\"?category=" . $catid . "&amp;sort=added&amp;type=" . $added_order_type . "\"><img class=\"time\" src=\"pic/trans.gif\" alt=\"time\" title=\"" . $lang_offers['title_time_added'] . "\" /></a></td>";
Ejemplo n.º 8
0
 $showprocessing = get_searchbox_value($brsectiontype, 'showprocessing') || $allowspecial && get_searchbox_value($spsectiontype, 'showprocessing');
 //whether show processings or not
 $showteam = get_searchbox_value($brsectiontype, 'showteam') || $allowspecial && get_searchbox_value($spsectiontype, 'showteam');
 //whether show teams or not
 $showaudiocodec = get_searchbox_value($brsectiontype, 'showaudiocodec') || $allowspecial && get_searchbox_value($spsectiontype, 'showaudiocodec');
 //whether show audio codecs or not
 $brcatsperror = get_searchbox_value($brsectiontype, 'catsperrow');
 $catsperrow = get_searchbox_value($spsectiontype, 'catsperrow');
 $catsperrow = !$allowspecial ? $brcatsperror : ($catsperrow > $catsperrow ? $catsperrow : $catsperrow);
 //show how many cats per line
 $brcatpadding = get_searchbox_value($brsectiontype, 'catpadding');
 $spcatpadding = get_searchbox_value($spsectiontype, 'catpadding');
 $catpadding = !$allowspecial ? $brcatpadding : ($brcatpadding < $spcatpadding ? $brcatpadding : $spcatpadding);
 //padding space between categories in pixel
 $brcats = genrelist($brsectiontype);
 $spcats = genrelist($spsectiontype);
 if ($showsubcat) {
     if ($showsource) {
         $sources = searchbox_item_list("sources");
     }
     if ($showmedium) {
         $media = searchbox_item_list("media");
     }
     if ($showcodec) {
         $codecs = searchbox_item_list("codecs");
     }
     if ($showstandard) {
         $standards = searchbox_item_list("standards");
     }
     if ($showprocessing) {
         $processings = searchbox_item_list("processings");
Ejemplo n.º 9
0
function delete_cat_form()
{
    global $params, $lang;
    if (!isset($params['id']) or !is_valid_id($params['id'])) {
        stderr($lang['categories_error'], $lang['categories_no_id']);
    }
    $q = sql_query("SELECT * FROM categories WHERE id = " . intval($params['id']));
    if (false == mysqli_num_rows($q)) {
        stderr($lang['categories_error'], $lang['categories_exist_error']);
    }
    $r = mysqli_fetch_assoc($q);
    $q = sql_query("SELECT COUNT(*) FROM torrents WHERE category = " . intval($r['id']));
    $count = mysqli_fetch_array($q, MYSQLI_NUM);
    $check = '';
    if ($count[0]) {
        $select = "<select name='new_cat_id'>\n<option value='0'>{$lang['categories_select']}</option>\n";
        $cats = genrelist();
        foreach ($cats as $c) {
            $select .= $c['id'] != $r['id'] ? "<option value='{$c["id"]}'>" . htmlsafechars($c['name'], ENT_QUOTES) . "</option>\n" : "";
        }
        $select .= "</select>\n";
        $check .= "<tr>\n        <td align='right' width='50%'>{$lang['categories_select_new']}<br /><span style='color:red;font-weight:bold;'>{$lang['categories_del_warning']}</span></td>\n        <td>{$select}</td>\n      </tr>";
    }
    $htmlout = '';
    $htlmout .= "<div class='row'><div class='col-md-12'>";
    $htmlout .= "<form action='staffpanel.php?tool=categories&amp;action=categories' method='post'>\n      <input type='hidden' name='mode' value='takedel_cat' />\n      <input type='hidden' name='id' value='" . (int) $r['id'] . "' />\n    \n      <table class='torrenttable' align='center' width='80%' bgcolor='#555555' cellspacing='2' cellpadding='2'>\n      <tr>\n        <td colspan='2' class='colhead'>{$lang['categories_del_about']}" . htmlsafechars($r['name'], ENT_QUOTES) . "</td>\n      </tr>\n      <tr>\n        <td align='right' width='50%'>{$lang['categories_del_name']}</td>\n        <td>" . htmlsafechars($r['name'], ENT_QUOTES) . "</td>\n      </tr>\n      <tr>\n        <td align='right'>{$lang['categories_del_description']}</td>\n        <td>" . htmlsafechars($r['cat_desc'], ENT_QUOTES) . "</td>\n      </tr>\n       <tr>\n        <td align='right'>{$lang['categories_show_minclass']}</td>\n        <td>" . htmlsafechars(get_user_class_name($r['min_class']), ENT_QUOTES) . "</td>\n          </tr>\n      <tr>\n        <td align='right'>{$lang['categories_del_image']}</td>\n        <td>" . htmlsafechars($r['image'], ENT_QUOTES) . "</td>\n      </tr>\n      {$check}\n      <tr>\n        <td colspan='2' align='center'>\n         <input type='submit' class='btn' value='{$lang['categories_del_delete']}' /><input type='button' class='btn' value='{$lang['categories_cancel']}' onclick=\"history.go(-1)\" /></td>\n      </tr>\n      </table>\n      </form>";
    $htlmout .= "</div></div>";
    echo stdhead($lang['categories_del_stdhead'] . $r['name']) . $htmlout . stdfoot();
}
Ejemplo n.º 10
0
         $foutput .= "\$GLOBALS['block_newslimit'] = '" . $_POST["newslimit"] . "';\n";
         $foutput .= "\$GLOBALS['block_forumlimit'] = '" . $_POST["forumlimit"] . "';\n";
         $foutput .= "\$GLOBALS['block_last10limit'] = '" . $_POST["last10limit"] . "';\n";
         $foutput .= "\$GLOBALS['block_mostpoplimit'] = '" . $_POST["mostpoplimit"] . "';\n";
         $foutput .= "\$GLOBALS['clocktype'] = " . $_POST["clocktype"] . ";\n";
         $foutput .= "\n?>";
         fwrite($fd, $foutput) or die(CANT_SAVE_CONFIG);
         fclose($fd);
         @chmod("include/config.php", 0744);
         $db->query("UPDATE users SET language = " . $db->real_escape_string($_POST['default_langue']) . ", style = " . $db->real_escape_string($_POST['default_style']) . " WHERE id_level = 1");
         print CONFIG_SAVED;
         redirect("admincp.php?user="******"uid"] . "&code=" . user::$current["random"]);
         exit;
     }
 } elseif ($do == "category" && $action == "read") {
     $cat = genrelist();
     block_begin(CAT_SETTINGS);
     print "&nbsp;&nbsp;<a href='admincp.php?user="******"uid"] . "&code=" . user::$current["random"] . "&do=category&action=add'><img alt='" . CAT_INSERT_NEW . "' border='0' src='images/new.gif'></a>\n";
     print "<br /><br />\n<table class='lista' width='100%' align='center'>\n";
     print "<tr>\n";
     print "<td class='header' align='center'>" . CAT_SORT_INDEX . "</td>\n";
     print "<td class='header' align='center'>" . NAME . "</td>\n";
     print "<td class='header' align='center'>" . PICTURE . "</td>\n";
     print "<td class='header' align='center'>" . EDIT . "</td>\n";
     print "<td class='header' align='center'>" . DELETE . "</td>\n";
     print "</tr>\n";
     foreach ($cat as $category) {
         if ($category["sub"] != 0) {
             $cate = sub_cat($category["sub"]) . " &raquo; " . security::html_safe($category["name"]);
         } else {
             $cate = security::html_safe($category["name"]);
Ejemplo n.º 11
0
function search($_GET, $CURUSER)
{
    $cats = genrelist();
    if (isset($_GET["search"])) {
        $searchstr = unesc($_GET["search"]);
        $cleansearchstr = searchfield($searchstr);
        if (empty($cleansearchstr)) {
            unset($cleansearchstr);
        }
    }
    $orderby = "ORDER BY torrents.id DESC";
    $addparam = "";
    $wherea = array();
    $wherecatina = array();
    if (isset($_GET["incldead"]) && $_GET["incldead"] == 1) {
        $addparam .= "incldead=1&amp;";
        if (!isset($CURUSER) || get_user_class() < UC_ADMINISTRATOR) {
            $wherea[] = "banned != 'yes'";
        }
    } else {
        if (isset($_GET["incldead"]) && $_GET["incldead"] == 2) {
            $addparam .= "incldead=2&amp;";
            $wherea[] = "visible = 'no'";
        } else {
            $wherea[] = "visible = 'yes'";
        }
    }
    $category = isset($_GET["cat"]) ? (int) $_GET["cat"] : false;
    $license = isset($_GET["lic"]) ? (int) $_GET["lic"] : false;
    $version = isset($_GET["ver"]) ? (int) $_GET["ver"] : false;
    $user = isset($_GET["user"]) ? (int) $_GET["user"] : false;
    $all = isset($_GET["all"]) ? $_GET["all"] : false;
    $page_limit = isset($_GET["page_limit"]) ? $_GET["page_limit"] : false;
    if (!$all) {
        if (!$_GET && $CURUSER["notifs"]) {
            $all = True;
            foreach ($cats as $cat) {
                $all &= $cat['id'];
                if (strpos($CURUSER["notifs"], "[cat" . $cat['id'] . "]") !== False) {
                    $wherecatina[] = $cat['id'];
                    $addparam .= "c{$cat['id']}=1&amp;";
                }
            }
        } elseif ($category) {
            if (!is_valid_id($category)) {
                stderr("Error", "Invalid category ID.");
            }
            $wherecatina[] = $category;
            $addparam .= "cat={$category}&amp;";
        } else {
            $all = True;
            foreach ($cats as $cat) {
                $all &= isset($_GET["c{$cat['id']}"]);
                if (isset($_GET["c{$cat['id']}"])) {
                    $wherecatina[] = $cat['id'];
                    $addparam .= "c{$cat['id']}=1&amp;";
                }
            }
        }
    }
    if ($all) {
        $wherecatina = array();
        $addparam = "";
    }
    if (count($wherecatina) > 1) {
        $wherecatin = implode(",", $wherecatina);
    } elseif (count($wherecatina) == 1) {
        $wherea[] = "category = {$wherecatina['0']}";
    }
    if ($license > 0) {
        $wherea[] = "license = {$license}";
    }
    if ($user > 0) {
        $wherea[] = "owner = {$user}";
    }
    if ($version > 0) {
        $wherea[] = "version = {$version}";
    }
    $wherebase = $wherea;
    if (isset($cleansearchstr)) {
        $wherea[] = "MATCH (search_text, ori_descr) AGAINST (" . sqlesc($searchstr) . ")";
        //$wherea[] = "0";
        $addparam .= "search=" . urlencode($searchstr) . "&amp;";
        $orderby = "";
        /////////////// SEARCH CLOUD MALARKY //////////////////////
        $searchcloud = sqlesc($cleansearchstr);
        // $r = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM searchcloud WHERE searchedfor = $searchcloud"), MYSQL_NUM);
        //$a = $r[0];
        //if ($a)
        // mysql_query("UPDATE searchcloud SET howmuch = howmuch + 1 WHERE searchedfor = $searchcloud");
        //else
        // mysql_query("INSERT INTO searchcloud (searchedfor, howmuch) VALUES ($searchcloud, 1)");
        mysql_query("INSERT INTO searchcloud (searchedfor, howmuch) VALUES ({$searchcloud}, 1)\n                ON DUPLICATE KEY UPDATE howmuch=howmuch+1");
        /////////////// SEARCH CLOUD MALARKY END ///////////////////
    }
    $where = implode(" AND ", $wherea);
    if (isset($wherecatin)) {
        $where .= ($where ? " AND " : "") . "category IN(" . $wherecatin . ")";
    }
    if ($where != "") {
        $where = "WHERE {$where}";
    }
    $res = mysql_query("SELECT COUNT(*) FROM torrents {$where}") or die(mysql_error());
    $row = mysql_fetch_array($res, MYSQL_NUM);
    $count = $row[0];
    if (!$count && isset($cleansearchstr)) {
        $wherea = $wherebase;
        $orderby = "ORDER BY id DESC";
        $searcha = explode(" ", $cleansearchstr);
        $sc = 0;
        foreach ($searcha as $searchss) {
            if (strlen($searchss) <= 1) {
                continue;
            }
            $sc++;
            if ($sc > 5) {
                break;
            }
            $ssa = array();
            foreach (array("search_text", "ori_descr") as $sss) {
                $ssa[] = "{$sss} LIKE '%" . sqlwildcardesc($searchss) . "%'";
            }
            $wherea[] = "(" . implode(" OR ", $ssa) . ")";
        }
        if ($sc) {
            $where = implode(" AND ", $wherea);
            if ($where != "") {
                $where = "WHERE {$where}";
            }
            $res = mysql_query("SELECT COUNT(*) FROM torrents {$where}");
            $row = mysql_fetch_array($res, MYSQL_NUM);
            $count = $row[0];
        }
    }
    $torrentsperpage = $CURUSER["torrentsperpage"];
    if ($page_limit) {
        $torrentsperpage = $page_limit;
    }
    if (!$torrentsperpage) {
        $torrentsperpage = 15;
    }
    if ($count) {
        //list($pagertop, $pagerbottom, $limit) = pager($torrentsperpage, $count, "browse.php?" . $addparam);
        $pager = pager($torrentsperpage, $count, "browse.php?" . $addparam);
        $query = "SELECT torrents.id, torrents.category, torrents.leechers, torrents.seeders, torrents.name, torrents.times_completed, torrents.size, torrents.added, torrents.type,  torrents.comments,torrents.numfiles,torrents.filename,torrents.owner,IF(torrents.nfo <> '', 1, 0) as nfoav," . "categories.name AS cat_name, categories.image AS cat_pic, users.username, torrents.version, torrents.descr,licenses.name AS lic_name,licenses.url AS lic_url,licenses.description AS lic_desc FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id LEFT JOIN licenses ON torrents.license = licenses.id {$where} {$orderby} {$pager['limit']}";
        $res = mysql_query($query) or die(mysql_error());
    } else {
        unset($res);
    }
    if ($count) {
        return array($res, $wherecatina, $pager);
    } else {
        return array("", $wherecatina, "");
    }
}
Ejemplo n.º 12
0
function delete_cat_form()
{
    global $params;
    if (!isset($params['id']) or !is_valid_id($params['id'])) {
        stderr('MOD ERROR', 'No category ID selected');
    }
    $q = @mysql_query("SELECT * FROM categories WHERE id = " . intval($params['id']));
    if (false == mysql_num_rows($q)) {
        stderr('MOD ERROR', 'That category does not exist or has been deleted');
    }
    $r = mysql_fetch_assoc($q);
    $q = @mysql_query("SELECT COUNT(*) FROM torrents WHERE category = " . intval($r['id']));
    $count = mysql_fetch_array($q, MYSQL_NUM);
    $check = '';
    if ($count[0]) {
        $select = "<select name='new_cat_id'>\n<option value='0'>Select Category</option>\n";
        $cats = genrelist();
        foreach ($cats as $c) {
            $select .= $c['id'] != $r['id'] ? "<option value='{$c["id"]}'>" . htmlentities($c['name'], ENT_QUOTES) . "</option>\n" : "";
        }
        $select .= "</select>\n";
        $check .= "<tr>\r\n        <td align='right' width='50%'>Select a new category:<br /><span style='color:red;font-weight:bold;'>Warning: There are torrents in this category, so you need to select a category to move them to.</span></td>\r\n        <td>{$select}</td>\r\n      </tr>";
    }
    $htmlout = '';
    $htmlout .= "<form action='admin.php?action=categories' method='post'>\r\n      <input type='hidden' name='mode' value='takedel_cat' />\r\n      <input type='hidden' name='id' value='{$r['id']}' />\r\n    \r\n      <table class='torrenttable' align='center' width='80%' bgcolor='#cecece' cellspacing='2' cellpadding='2'>\r\n      <tr>\r\n        <td colspan='2' class='colhead'>You are about to delete category: " . htmlentities($r['name'], ENT_QUOTES) . "</td>\r\n      </tr>\r\n      <tr>\r\n        <td align='right' width='50%'>Cat Name:</td>\r\n        <td>" . htmlentities($r['name'], ENT_QUOTES) . "</td>\r\n      </tr>\r\n      <tr>\r\n        <td align='right'>Description:</td>\r\n        <td>" . htmlentities($r['cat_desc'], ENT_QUOTES) . "</td>\r\n      </tr>\r\n      <tr>\r\n        <td align='right'>Image:</td>\r\n        <td>" . htmlentities($r['image'], ENT_QUOTES) . "</td>\r\n      </tr>\r\n      {$check}\r\n      <tr>\r\n        <td colspan='2' align='center'>\r\n         <input type='submit' class='btn' value='Delete' /><input type='button' class='btn' value='Cancel' onclick=\"history.go(-1)\" /></td>\r\n      </tr>\r\n      </table>\r\n      </form>";
    print stdhead("Deleting category {$r['name']}") . $htmlout . stdfoot();
}
Ejemplo n.º 13
0
//whether show media or not
$showcodec = get_searchbox_value($sectiontype, 'showcodec');
//whether show codecs or not
$showstandard = get_searchbox_value($sectiontype, 'showstandard');
//whether show standards or not
$showprocessing = get_searchbox_value($sectiontype, 'showprocessing');
//whether show processings or not
$showteam = get_searchbox_value($sectiontype, 'showteam');
//whether show teams or not
$showaudiocodec = get_searchbox_value($sectiontype, 'showaudiocodec');
//whether show audio codec or not
$catsperrow = get_searchbox_value($sectiontype, 'catsperrow');
//show how many cats per line in search box
$catpadding = get_searchbox_value($sectiontype, 'catpadding');
//padding space between categories in pixel
$cats = genrelist($sectiontype);
if ($showsubcat) {
    if ($showsource) {
        $sources = searchbox_item_list("sources");
    }
    if ($showmedium) {
        $media = searchbox_item_list("media");
    }
    if ($showcodec) {
        $codecs = searchbox_item_list("codecs");
    }
    if ($showstandard) {
        $standards = searchbox_item_list("standards");
    }
    if ($showprocessing) {
        $processings = searchbox_item_list("processings");
Ejemplo n.º 14
0
?>
</b></p>
<!--<p>The tracker's announce url is <b><?php 
echo $announce_urls[0];
?>
</b></p>-->
<p>Please see the <a href="faq.php#up2">FAQ:Upload</a> section for more information.</p>
<table border="1" cellspacing="0" cellpadding="10">
<?php 
tr("Torrent file", "<input type='file' name='file' size='80' />\n", 1);
tr("Torrent name", "<input type=\"text\" name=\"name\" size=\"80\" /><br />(Taken from filename if not specified. <b>Please use descriptive names.</b>)\n", 1);
#tr("NFO file", "<input type='file' name='nfo' size='80' /><br />(<b>Optional.</b> Can only be viewed by power users.)\n", 1);
tr("Description", "<textarea name=\"descr\" rows=\"10\" cols=\"80\"></textarea>" . "<br />(HTML/BB code is <b>not</b> allowed.)", 1);
#category
$s = "<select name=\"type\">\n<option value=\"0\">(choose one)</option>\n";
$cats = genrelist();
foreach ($cats as $row) {
    $s .= "<option value=\"" . $row["id"] . "\">" . htmlspecialchars($row["name"]) . "</option>\n";
}
$s .= "</select>\n";
tr("Category", $s, 1);
#Morgan: license
$lic = "<select name=\"lic\">\n<option value=\"0\">(choose one)</option>\n";
$lic_cats = licenselist();
foreach ($lic_cats as $row) {
    $lic .= "<option value=\"" . $row["id"] . "\">" . htmlspecialchars($row["name"]) . ' (' . htmlspecialchars($row["description"]) . ')' . "</option>\n";
}
$lic .= "</select>\n";
tr("License", $lic, 1);
#Morgan: version
$version = "<select name=\"version\">\n<option value=\"0\">(Select alternative version of this torrent)</option>\n";
function torrenttable($res, $variant = "index")
{
    global $INSTALLER09, $CURUSER, $lang, $free, $mc1;
    require_once INCL_DIR . 'bbcode_functions.php';
    require_once CLASS_DIR . 'class_user_options_2.php';
    $htmlout = $prevdate = $nuked = $free_slot = $freetorrent = $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++;
    }
    while ($row = mysqli_fetch_assoc($res)) {
        //==
        if ($CURUSER['opt2'] & user_options_2::SPLIT) {
            if (get_date($row['added'], 'DATE') == $prevdate) {
                $cleandate = '';
            } else {
                $htmlout .= "<!--<b>{$lang['torrenttable_upped']} " . get_date($row['added'], 'DATE') . "</b>-->";
            }
            $prevdate = get_date($row['added'], 'DATE');
        }
        $imdb = "<b>IMDB:&nbsp;" . (preg_match('/imdb.com.*tt\\d{2,}/i', $row['url']) ? "<a href='{$row['url']}' target='_blank'>Click Here</a>" : "None listed") . "</b><br />";
        $htmlout .= "<div class='container'><div class='row'>\n<div class='col-sm-3 col-sm-offset-0 panel panel-default browsep'>";
        $htmlout .= "<br /><table class='table table-bordered' >";
        $id = (int) $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 .= "";
        $dispname = htmlsafechars($row["name"]);
        $htmlout .= "<div style='display:block; height:5px;'></div>\n<a href='details.php?id={$id}'><div class='text-center squashp browsed'>{$dispname}</a></div><div style='display:block; height:5px;'></div>";
        $categories = genrelist();
        foreach ($categories as $key => $value) {
            $change[$value['id']] = array('id' => $value['id'], 'name' => $value['name'], 'image' => $value['image'], 'min_class' => $value['min_class']);
        }
        $row['cat_name'] = htmlsafechars($change[$row['category']]['name']);
        $row['cat_pic'] = htmlsafechars($change[$row['category']]['image']);
        $row['min_class'] = htmlsafechars($change[$row['category']]['min_class']);
        $htmlout .= "<div style='display:block; height:5px;'></div><a href='details.php?id={$id}'><div class='text-center browsepd'>";
        if (!empty($row["poster"]) && isset($row["cat_pic"]) && $row["cat_pic"] != "") {
            $htmlout .= "<img src='{$INSTALLER09['pic_base_url']}caticons/{$CURUSER['categorie_icon']}/{$row['cat_pic']}' alt='{$row['cat_name']}' class='overlay'><img src='" . htmlsafechars($row["poster"]) . "' alt='Poster' title='Poster' class='tt''>";
        }
        if (empty($row["poster"]) && isset($row["cat_pic"]) && $row["cat_pic"] != "") {
            $htmlout .= "<img src='{$INSTALLER09['pic_base_url']}caticons/{$CURUSER['categorie_icon']}/{$row['cat_pic']}' alt='{$row['cat_name']}' class='overlaynp'><img src='{$INSTALLER09['pic_base_url']}noposter.png' class='tt'><br />";
        }
        $htmlout .= "</div></a><div style='display:block; height:5px;'></div>";
        $htmlout .= "<div class='text-center browsepd'>";
        if ($variant == "mytorrents") {
            $htmlout .= "<a class='btn btn-primary' 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>\n";
        }
        if ($variant == "mytorrents") {
            $htmlout .= "<button class='btn btn-primary'><a href='edit.php?id=" . (int) $row['id'] . "amp;returnto=" . urlencode($_SERVER["REQUEST_URI"]) . "'>{$lang["torrenttable_edit"]}</a></button>\n";
        }
        $htmlout .= $variant == "index" ? "DOWNLOAD&nbsp;<a class='btn btn-primary' 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></button>" : "";
        if ($variant == "mytorrents") {
            $htmlout .= "test";
            if ($row["visible"] == "no") {
                $htmlout .= "<b>{$lang["torrenttable_not_visible"]}</b>";
            } else {
                $htmlout .= "{$lang["torrenttable_visible"]}";
            }
            $htmlout .= "<!--<br />-->";
        }
        $htmlout .= "</div>";
        $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 = '<div style="display:block; height:5px;"></div><div class="browsemp">
<b>Bookmark This:</b>&nbsp;<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><br />';
        if ($variant == "index") {
            $htmlout .= "{$bookmark}";
        }
        $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='" . htmlsafechars($sub["pic"]) . "' alt='" . htmlsafechars($sub["name"]) . "' title='" . htmlsafechars($sub["name"]) . "' />";
                    }
                }
            }
        } else {
            $Subs = "---";
        }
        if ($row["type"] == "single") {
            $htmlout .= "<b>Files:</b>" . (int) $row["numfiles"] . "<br />";
        } else {
            if ($variant == "index") {
                $htmlout .= "<b>Files:&nbsp;<a href='filelist.php?id={$id}'>" . (int) $row["numfiles"] . "</a></b><br />";
            } else {
                $htmlout .= "<b>Files:&nbsp;<a href='filelist.php?id={$id}'>" . (int) $row["numfiles"] . "</a></b><br />";
            }
        }
        $htmlout .= "Size:&nbsp;" . str_replace(" ", " ", mksize($row["size"])) . "\n";
        if ($row["times_completed"] != 1) {
            $_s = "" . $lang["torrenttable_time_plural"] . "";
        } else {
            $_s = "" . $lang["torrenttable_time_singular"] . "";
        }
        $What_Script_S = XBT_TRACKER == true ? 'snatches_xbt.php?id=' : 'snatches.php?id=';
        $htmlout .= "<br />Snatches:<a href='{$What_Script_S}" . "{$id}'>{$_s}&nbsp;<b>downloaded</b>&nbsp;" . number_format($row["times_completed"]) . "</a>\n";
        if ($row["seeders"]) {
            if ($variant == "index") {
                if ($row["leechers"]) {
                    $ratio = $row["seeders"] / $row["leechers"];
                } else {
                    $ratio = 1;
                }
                $What_Script_P = XBT_TRACKER == true ? 'peerlist_xbt.php?id=' : 'peerlist.php?id=';
                $htmlout .= "<br /><b>Seeders:</b>&nbsp;<b><a href='{$What_Script_P}" . "{$id}#seeders'><font color='" . get_slr_color($ratio) . "'>" . (int) $row["seeders"] . "</font></a></b>&nbsp;\n";
            } else {
                $What_Script_P = XBT_TRACKER == true ? 'peerlist_xbt.php?id=' : 'peerlist.php?id=';
                $htmlout .= "<br /><b>Seeders:</b>&nbsp;<b><a class='" . linkcolor($row["seeders"]) . "' href='{$What_Script_P}" . "{$id}#seeders'>" . (int) $row["seeders"] . "</a></b>&nbsp;\n";
            }
        } else {
            $htmlout .= "<br /><b>Seeders:</b>&nbsp;<span class='" . linkcolor($row["seeders"]) . "'>" . (int) $row["seeders"] . "</span>\n";
        }
        if ($row["leechers"]) {
            $What_Script_P = XBT_TRACKER == true ? 'peerlist_xbt.php?id=' : 'peerlist.php?id=';
            if ($variant == "index") {
                $htmlout .= "<b><a href='{$What_Script_P}" . "{$id}#leechers'>" . number_format($row["leechers"]) . "</a></b>\n";
            } else {
                $htmlout .= "<b><a class='" . linkcolor($row["leechers"]) . "' href='{$What_Script_P}" . "{$id}#leechers'>" . (int) $row["leechers"] . "</a></b>\n";
            }
        } else {
            $htmlout .= "<b>Leechers:</b>&nbsp;0\n";
        }
        if ($variant == "index") {
            $htmlout .= "<br /><b>Upped By:</b>&nbsp;" . (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>") . "\n";
        }
        if ($CURUSER['class'] >= UC_STAFF) {
            $url = "edit.php?id=" . (int) $row["id"];
            if (isset($_GET["returnto"])) {
                $addthis = "&amp;returnto=" . urlencode($_GET["returnto"]);
                $url .= $addthis;
            }
            $editlink = "a href=\"{$url}\" class=\"sublink\"";
            $del_link = $CURUSER['class'] === UC_MAX ? "<a href='fastdelete.php?id=" . (int) $row['id'] . "'>&nbsp;<img src='pic/button_delete2.gif' alt='Fast Delete' title='Fast Delete' /></a>" : "";
            $htmlout .= "<br />\n<b>Added:&nbsp;" . get_date($row['added'], 'DATE') . "</b><br />" . $imdb . "<b>Subtitle:&nbsp;{$Subs}</b><br />";
            if (!$row["comments"]) {
                $htmlout .= "<b>Comments:</b>&nbsp;" . (int) $row["comments"] . "\n";
            } else {
                if ($variant == "index") {
                    $htmlout .= "<b>Comments:</b>&nbsp;<b><a href='details.php?id={$id}&amp;hit=1&amp;tocomm=1'>" . (int) $row["comments"] . "</a></b>\n";
                } else {
                    $htmlout .= "<b>Comments:</b>&nbsp;<b><a href='details.php?id={$id}&amp;page=0#startcomments'>" . (int) $row["comments"] . "</a></b>\n";
                }
            }
            if ($CURUSER['class'] >= UC_STAFF) {
                $htmlout .= "<br /><b>Tools:</b>&nbsp;";
            }
            $htmlout .= "<{$editlink}><img src='pic/button_edit2.gif' alt='Fast Edit' title='Fast Edit' /></a>{$del_link}";
        }
        $htmlout .= "</div></table><br /></div><div style='display:block;width:5px;'></div>";
    }
    $htmlout .= "</div></div>\n";
    return $htmlout;
}
Ejemplo n.º 16
0
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;
}
Ejemplo n.º 17
0
Archivo: my.php Proyecto: klldll/tbdev
while (list($displayname, $filename) = @each($lang)) {
    $selected = strtolower($CURUSER["language"]) == strtolower($filename) ? ' selected="selected"' : '';
    $lang_select .= '<option value="' . $filename . '"' . $selected . '>' . ucwords($displayname) . '</option>';
}
$lang_select .= '</select>';
function format_tz($a)
{
    $h = floor($a);
    $m = ($a - floor($a)) * 60;
    return ($a >= 0 ? "+" : "-") . (strlen(abs($h)) > 1 ? "" : "0") . abs($h) . ":" . ($m == 0 ? "00" : $m);
}
tr($tracker_lang['my_allow_pm_from'], "<input type=radio name=acceptpms" . ($CURUSER["acceptpms"] == "yes" ? " checked" : "") . " value=\"yes\">Все (исключая блокированных)\r\n<br /><input type=radio name=acceptpms" . ($CURUSER["acceptpms"] == "friends" ? " checked" : "") . " value=\"friends\">Только друзей\r\n<br /><input type=radio name=acceptpms" . ($CURUSER["acceptpms"] == "no" ? " checked" : "") . " value=\"no\">Только администрации", 1);
tr($tracker_lang['my_parked'], "<input type=\"radio\" name=\"parked\"" . ($CURUSER["parked"] == "yes" ? " checked" : "") . " value=\"yes\">" . $tracker_lang['yes'] . "\r\n<input type=\"radio\" name=\"parked\"" . ($CURUSER["parked"] == "no" ? " checked" : "") . " value=\"no\">" . $tracker_lang['no'] . "\r\n<br /><font class=\"small_text\">" . $tracker_lang['my_you_can_park'] . ".</font>", 1);
tr($tracker_lang['my_delete_after_reply'], "<input type=checkbox name=deletepms" . ($CURUSER["deletepms"] == "yes" ? " checked" : "") . ">", 1);
tr($tracker_lang['my_sentbox'], "<input type=checkbox name=savepms" . ($CURUSER["savepms"] == "yes" ? " checked" : "") . ">", 1);
$r = genrelist();
//$categories = "Default browsing categories:<br />\n";
if (count($r) > 0) {
    $categories = "<table><tr>\n";
    $i = 0;
    foreach ($r as $a) {
        $categories .= $i && $i % 2 == 0 ? "</tr><tr>" : "";
        $categories .= "<td class=bottom style='padding-right: 5px'><input name=cat{$a['id']} type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[cat{$a['id']}]") !== false ? " checked" : "") . " value='yes'>&nbsp;" . htmlspecialchars_uni($a["name"]) . "</td>\n";
        ++$i;
    }
    $categories .= "</tr></table>\n";
}
tr($tracker_lang['my_email_notify'], "<input type=checkbox name=pmnotif" . (strpos($CURUSER['notifs'], "[pm]") !== false ? " checked" : "") . " value=yes> Уведомить меня при получении ЛС<br />\n" . "<input type=checkbox name=emailnotif" . (strpos($CURUSER['notifs'], "[email]") !== false ? " checked" : "") . " value=yes> Уведомить меня при размещении торрента в одной <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; из следующих предпочитаемых категорий.\n", 1);
tr($tracker_lang['my_default_browse'], $categories, 1);
tr($tracker_lang['my_style'], "{$themes}", 1);
tr($tracker_lang['my_country'], "<select name=country>\n{$countries}\n</select>", 1);
Ejemplo n.º 18
0
|--------------------------------------------------------------------------|
|   Licence Info: GPL						            |
|--------------------------------------------------------------------------|
|   Copyright (C) 2010 U-232 V5				            |
|--------------------------------------------------------------------------|
|   A bittorrent tracker source based on TBDev.net/tbsource/bytemonsoon.   |
|--------------------------------------------------------------------------|
|   Project Leaders: Mindless, Autotron, whocares, Swizzles.		    |
|--------------------------------------------------------------------------|
 _   _   _   _   _     _   _   _   _   _   _     _   _   _   _
/ \ / \ / \ / \ / \   / \ / \ / \ / \ / \ / \   / \ / \ / \ / \
( U | - | 2 | 3 | 2 )-( S | o | u | r | c | e )-( C | o | d | e )
\_/ \_/ \_/ \_/ \_/   \_/ \_/ \_/ \_/ \_/ \_/   \_/ \_/ \_/ \_/
*/
//== category
$categorie = genrelist();
foreach ($categorie as $key => $value) {
    $change[$value['id']] = array('id' => $value['id'], 'name' => $value['name'], 'image' => $value['image']);
}
$HTMLOUT .= "<div class='panel panel-default'>\n\t<div class='panel-heading'>\n\t\t<label for='checkbox_4' class='text-left'>Requests and Offers</label>\n\t</div>\n\t<div class='panel-body'>";
//== Requests
$HTMLOUT .= "<div class='panel panel-default'>\n\t<div class='panel-heading'>\n\t\t<label class='text-left'>Unfilled Requests</label>\n\t</div>\n\t<div class='panel-body'>";
$requests = array();
if (($requests = $mc1->get_value('requests_')) === false) {
    $res = sql_query("SELECT r.id AS request_id, r.request_name, r.category, r.comments, r.added, r.vote_yes_count, r.vote_no_count, r.filled_by_user_id, u.id, u.username, u.warned, u.suspended, u.enabled, u.donor, u.class, u.leechwarn, u.chatpost, u.pirate, u.king FROM requests AS r LEFT JOIN users AS u ON r.requested_by_user_id = u.id WHERE filled_by_user_id = '' ORDER BY added DESC LIMIT {$INSTALLER09['requests']['req_limit']}") or sqlerr(__FILE__, __LINE__);
    if (mysqli_num_rows($res)) {
        while ($request = mysqli_fetch_assoc($res)) {
            $requests[] = $request;
        }
        $mc1->cache_value('requests_', $requests, $INSTALLER09['expires']['req_limit']);
    }
Ejemplo n.º 19
0
function move_cat_form()
{
    global $params, $lang;
    if (!isset($params['id']) or !is_valid_id($params['id'])) {
        stderr($lang['categories_error'], $lang['categories_no_id']);
    }
    $q = sql_query("SELECT * FROM categories WHERE id = " . intval($params['id']));
    if (false == mysqli_num_rows($q)) {
        stderr($lang['categories_error'], $lang['categories_exist_error']);
    }
    $r = mysqli_fetch_assoc($q);
    $check = '';
    $select = "<select name='new_cat_id'>\n<option value='0'>{$lang['categories_select']}</option>\n";
    $cats = genrelist();
    foreach ($cats as $c) {
        $select .= $c['id'] != $r['id'] ? "<option value='{$c["id"]}'>" . htmlsafechars($c['name'], ENT_QUOTES) . "</option>\n" : "";
    }
    $select .= "</select>\n";
    $check .= "<tr>\n      <td align='right' width='50%'><span style='color:limegreen;font-weight:bold;'>{$lang['categories_select_new']}</span></td>\n      <td>{$select}</td>\n    </tr>";
    $htmlout = '';
    $htmlout .= "<form action='staffpanel.php?tool=categories&amp;action=categories' method='post'>\n      <input type='hidden' name='mode' value='takemove_cat' />\n      <input type='hidden' name='id' value='{$r['id']}' />\n    \n      <table class='torrenttable' align='center' width='80%' bgcolor='#555555' cellspacing='2' cellpadding='4px'>\n      <tr>\n        <td colspan='2' class='colhead'>" . $lang['categories_move_about'] . htmlsafechars($r['name'], ENT_QUOTES) . "</td>\n      </tr>\n      <tr>\n        <td colspan='2'>{$lang['categories_move_note']}</td>\n      </tr>\n      <tr>\n        <td align='right' width='50%'><span style='color:red;font-weight:bold;'>{$lang['categories_move_old']}</span></td>\n        <td>" . htmlsafechars($r['name'], ENT_QUOTES) . "</td>\n      </tr>\n      {$check}\n      <tr>\n        <td colspan='2' align='center'>\n         <input type='submit' class='btn' value='{$lang['categories_move']}' /><input type='button' class='btn' value={$lang['categories_cancel']}' onclick=\"history.go(-1)\" /></td>\n      </tr>\n      </table>\n      </form>";
    echo stdhead($lang['categories_move_stdhead'] . $r['name']) . $htmlout . stdfoot();
}