示例#1
0
$dllink = false;
$passkey = $_GET['passkey'];
$where = "";
if ($passkey) {
    $res = sql_query("SELECT id, enabled, parked FROM users WHERE passkey=" . sqlesc($passkey) . " LIMIT 1");
    $user = mysql_fetch_array($res);
    if (!$user) {
        die("invalid passkey");
    } elseif ($user['enabled'] == 'no' || $user['parked'] == 'yes') {
        die("account disabed or parked");
    } elseif ($_GET['linktype'] == 'dl') {
        $dllink = true;
    }
    $inclbookmarked = 0 + $_GET['inclbookmarked'];
    if ($inclbookmarked == 1) {
        $bookmarkarray = return_torrent_bookmark_array($user['id']);
        if ($bookmarkarray) {
            $whereidin = implode(",", $bookmarkarray);
            $where .= ($where ? " AND " : "") . "torrents.id IN(" . $whereidin . ")";
        }
    }
}
$searchstr = mysql_real_escape_string(trim($_GET["search"]));
if (empty($searchstr)) {
    unset($searchstr);
}
if (isset($searchstr)) {
    $search_mode = 0 + $_GET["search_mode"];
    if (!in_array($search_mode, array(0, 1, 2))) {
        $search_mode = 0;
    }
示例#2
0
function get_torrent_bookmark_state($userid, $torrentid, $text = false)
{
    global $lang_functions;
    $userid = 0 + $userid;
    $torrentid = 0 + $torrentid;
    $ret = array();
    $ret = return_torrent_bookmark_array($userid);
    if (!count($ret) || !in_array($torrentid, $ret, false)) {
        // already bookmarked
        $act = $text == true ? $lang_functions['title_bookmark_torrent'] : "<img class=\"delbookmark\" src=\"pic/trans.gif\" alt=\"Unbookmarked\" title=\"" . $lang_functions['title_bookmark_torrent'] . "\" />";
    } else {
        $act = $text == true ? $lang_functions['title_delbookmark_torrent'] : "<img class=\"bookmark\" src=\"pic/trans.gif\" alt=\"Bookmarked\" title=\"" . $lang_functions['title_delbookmark_torrent'] . "\" />";
    }
    return $act;
}