Exemple #1
0
if (!isset($_FILES["file"])) {
    bark($lang_takeupload['std_missing_form_data']);
}
$f = $_FILES["file"];
$fname = unesc($f["name"]);
if (empty($fname)) {
    bark($lang_takeupload['std_empty_filename']);
}
if (get_user_class() >= $beanonymous_class && $_POST['uplver'] == 'yes') {
    $anonymous = "yes";
    $anon = "Anonymous";
} else {
    $anonymous = "no";
    $anon = $CURUSER["username"];
}
$url = parse_imdb_id($_POST['url']);
$douban_url = $_POST['douban_url'];
if (substr($douban_url, -1) != "/") {
    $douban_url = $douban_url . "/";
}
$nfo = '';
if ($enablenfo_main == 'yes') {
    $nfofile = $_FILES['nfo'];
    if ($nfofile['name'] != '') {
        if ($nfofile['size'] == 0) {
            bark($lang_takeupload['std_zero_byte_nfo']);
        }
        if ($nfofile['size'] > 65535) {
            bark($lang_takeupload['std_nfo_too_big']);
        }
        $nfofilename = $nfofile['tmp_name'];
Exemple #2
0
         $movie = new imdb($thenumbers);
         $movieid = $thenumbers;
         $movie->setid($movieid);
         $target = array('Title', 'Credits', 'Plot');
         $type == 2 ? $movie->purge_single(true) : "";
         set_cachetimestamp($id, "cache_stamp");
         $movie->preparecache($target, true);
         $Cache->delete_value('imdb_id_' . $thenumbers . '_movie_name');
         $Cache->delete_value('imdb_id_' . $thenumbers . '_large', true);
         $Cache->delete_value('imdb_id_' . $thenumbers . '_median', true);
         $Cache->delete_value('imdb_id_' . $thenumbers . '_minor', true);
         header("Location: " . get_protocol_prefix() . "{$BASEURL}/details.php?id=" . htmlspecialchars($id));
     }
     break;
 case 2:
     $imdb_id = parse_imdb_id($row["url"]);
     if ($imdb_id) {
         $dbdata = new douban();
         $dbdata->setid($imdb_id);
         set_cachetimestamp($id, "cache_stamp");
         $Cache->delete_value('imdb_id_' . $thenumbers . '_movie_name');
         $Cache->delete_value('imdb_id_' . $thenumbers . '_large', true);
         $Cache->delete_value('imdb_id_' . $thenumbers . '_median', true);
         $Cache->delete_value('imdb_id_' . $thenumbers . '_minor', true);
         header("Location: " . get_protocol_prefix() . "{$BASEURL}/details.php?id=" . htmlspecialchars($id));
     }
     break;
 case 3:
     $douban_id = parse_douban_id($row["dburl"]);
     if ($douban_id) {
         $dbdata = new douban();
Exemple #3
0
if ($showextinfo['imdb'] == 'yes' && ($showmovies['hot'] == "yes" || $showmovies['classic'] == "yes")) {
    $type = array('hot', 'classic');
    foreach ($type as $type_each) {
        if ($showmovies[$type_each] == 'yes' && (!isset($CURUSER) || $CURUSER['show' . $type_each] == 'yes')) {
            $Cache->new_page($type_each . '_resources', 900, true);
            if (!$Cache->get_page()) {
                $Cache->add_whole_row();
                $imdbcfg = new imdb_config();
                $res = sql_query("SELECT * FROM torrents WHERE picktype = " . sqlesc($type_each) . " AND seeders > 0 AND url != '' ORDER BY id DESC LIMIT 30") or sqlerr(__FILE__, __LINE__);
                if (mysql_num_rows($res) > 0) {
                    $movies_list = "";
                    $count = 0;
                    $allImdb = array();
                    while ($array = mysql_fetch_array($res)) {
                        $pro_torrent = get_torrent_promotion_append($array[sp_state], 'word');
                        if ($imdb_id = parse_imdb_id($array["url"])) {
                            if (array_search($imdb_id, $allImdb) !== false) {
                                //a torrent with the same IMDb url already exists
                                continue;
                            }
                            $allImdb[] = $imdb_id;
                            $photo_url = $imdbcfg->photodir . $imdb_id . $imdbcfg->imageext;
                            if (file_exists($photo_url)) {
                                $thumbnail = "<img width=\"101\" height=\"140\" src=\"" . $photo_url . "\" border=\"0\" alt=\"poster\" />";
                            } else {
                                continue;
                            }
                        } else {
                            continue;
                        }
                        $thumbnail = "<a href=\"details.php?id=" . $array['id'] . "&amp;hit=1\" onmouseover=\"domTT_activate(this, event, 'content', '" . htmlspecialchars("<font class=\\'big\\'><b>" . addslashes($array['name'] . $pro_torrent) . "</b></font><br /><font class=\\'medium\\'>" . addslashes($array['small_descr']) . "</font>") . "', 'trail', true, 'delay', 0,'lifetime',5000,'styleClass','niceTitle','maxWidth', 600);\">" . $thumbnail . "</a>";
Exemple #4
0
function get_torrent_extinfo_identifier($torrentid)
{
    $torrentid = 0 + $torrentid;
    $result = array('imdb_id');
    unset($result);
    if ($torrentid) {
        $res = sql_query("SELECT url FROM torrents WHERE id=" . $torrentid) or sqlerr(__FILE__, __LINE__);
        if (mysql_num_rows($res) == 1) {
            $arr = mysql_fetch_array($res) or sqlerr(__FILE__, __LINE__);
            $imdb_id = parse_imdb_id($arr["url"]);
            $result['imdb_id'] = $imdb_id;
        }
    }
    return $result;
}
Exemple #5
0
$wherebase = $wherea;
if (isset($searchstr)) {
    if (!$_GET['notnewword']) {
        insert_suggest($searchstr, $CURUSER['id']);
        $notnewword = "";
    } else {
        $notnewword = "notnewword=1&";
    }
    $search_mode = 0 + $_GET["search_mode"];
    if (!in_array($search_mode, array(0, 1, 2))) {
        $search_mode = 0;
        write_log("User " . $CURUSER["username"] . "," . $CURUSER["ip"] . " is hacking search_mode field in" . $_SERVER['SCRIPT_NAME'], 'mod');
    }
    $search_area = 0 + $_GET["search_area"];
    if ($search_area == 4) {
        $searchstr = (int) parse_imdb_id($searchstr);
    }
    $like_expression_array = array();
    unset($like_expression_array);
    switch ($search_mode) {
        case 0:
            // AND, OR
        // AND, OR
        case 1:
            $searchstr = str_replace(".", " ", $searchstr);
            $searchstr_exploded = explode(" ", $searchstr);
            $searchstr_exploded_count = 0;
            foreach ($searchstr_exploded as $searchstr_element) {
                $searchstr_element = trim($searchstr_element);
                // furthur trim to ensure that multi space seperated words still work
                $searchstr_exploded_count++;
Exemple #6
0
     }
     $searchstr_exploded = explode(" ", $searchstr);
     $searchstr_exploded_count = 0;
     foreach ($searchstr_exploded as $searchstr_element) {
         $searchstr_element = trim($searchstr_element);
         // furthur trim to ensure that multi space seperated words still work
         if (!$searchstr_element) {
             continue;
         }
         if ($searchstr_exploded_count >= 10) {
             // 每次最多查询10个关键字
             break;
         }
         $searchstr_exploded_count++;
         if ($search_area == 4) {
             $searchstr_element = (int) parse_imdb_id($searchstr_element);
             $like_expression_array[] = " = " . ($searchstr_element ? $searchstr_element : "'-1'");
         } else {
             $like_expression_array[] = (substr($searchstr_element, 0, 1) == '!' ? " NOT" : "") . " LIKE '%" . (substr($searchstr_element, 0, 1) == '!' ? substr($searchstr_element, 1, strlen($searchstr_element)) : $searchstr_element) . "%'";
         }
     }
     if (!$like_expression_array) {
         $like_expression_array[] = " LIKE '%'";
     }
     break;
 case 2:
     $like_expression_array[] = " LIKE '%" . $searchstr . "%'";
     break;
     /*case 3 :	// parsed
     		{
     		$like_expression_array[] = $searchstr;
Exemple #7
0
    bark($lang_takeupload['std_missing_form_data']);
}
$f = $_FILES["file"];
$fname = unesc($f["name"]);
if (empty($fname)) {
    bark($lang_takeupload['std_empty_filename']);
}
if (get_user_class() >= $beanonymous_class && $_POST['uplver'] == 'yes') {
    $anonymous = "yes";
    $anon = "Anonymous";
} else {
    $anonymous = "no";
    $anon = $CURUSER["username"];
}
$url = parse_imdb_id($_POST['url']);
$dburl = parse_imdb_id($_POST['dburl']);
$nfo = '';
if ($enablenfo_main == 'yes') {
    $nfofile = $_FILES['nfo'];
    if ($nfofile['name'] != '') {
        if ($nfofile['size'] == 0) {
            bark($lang_takeupload['std_zero_byte_nfo']);
        }
        if ($nfofile['size'] > 65535) {
            bark($lang_takeupload['std_nfo_too_big']);
        }
        $nfofilename = $nfofile['tmp_name'];
        if (@(!is_uploaded_file($nfofilename))) {
            bark($lang_takeupload['std_nfo_upload_failed']);
        }
        $nfo = str_replace("\r\r\n", "\r\n", @file_get_contents($nfofilename));
Exemple #8
0
<?php

require "include/bittorrent.php";
require_once "imdb/imdb.class.php";
dbconn();
//Send some headers to keep the user's browser from caching the response.
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
header("Content-Type: text/xml; charset=utf-8");
$imdblink = $_GET['url'];
$mode = $_GET['type'];
$cache_stamp = $_GET['cache'];
$imdb_id = parse_imdb_id($imdblink);
$Cache->new_page('imdb_id_' . $imdb_id . '_' . $mode, 1296000, true);
if (!$Cache->get_page()) {
    $infoblock = getimdb($imdb_id, $cache_stamp, $mode);
    if ($infoblock) {
        $Cache->add_whole_row();
        print $infoblock;
        $Cache->end_whole_row();
        $Cache->cache_page();
        echo $Cache->next_row();
    }
} else {
    echo $Cache->next_row();
}