static function parseMovie($id, $p_code)
 {
     $url = replaceStr(SinaTeachParse::BASE_SHOW_EPISODE, '{COURSE_ID}', $id);
     $content = getPage($url, $p_code);
     $content = json_decode($content);
     if (is_object($content) && property_exists($content, 'result') && property_exists($content->result, 'data') && property_exists($content->result->data, 'lessoninfo')) {
         $contents = $content->result->data->lessoninfo;
         if (is_array($contents) && count($contents) > 0) {
             $sites = array();
             $site = array();
             $site['site_url'] = "sina";
             $site['site_name'] = "sinahd";
             $site['max_episode'] = 'true';
             $episodes = array();
             foreach ($contents as $content) {
                 $episodes[] = array('name' => property_exists($content, 'name') ? $content->name : "1", 'guest' => property_exists($content, 'short_name') ? $content->short_name : "1", 'episode' => property_exists($content, 'jieci') ? $content->jieci : "1", 'url' => property_exists($content, 'burl') ? $content->burl : "", 'img_url' => property_exists($content, 'thumb') ? $content->thumb : "", 'time' => property_exists($content, 'length') ? $content->length : "", 'stream_url' => property_exists($content, 'stream_url') && !isN($content->stream_url) ? MovieType::HIGH_CLEAR . MovieType::VIDEO_NAME_URL_SEP . $content->stream_url : "", 'androidUrl' => property_exists($content, 'android_url') && !isN($content->android_url) ? MovieType::HIGH_CLEAR . MovieType::VIDEO_NAME_URL_SEP . $content->android_url : "", 'videoAddressUrl' => property_exists($content, 'ipad_url') && !isN($content->ipad_url) ? MovieType::HIGH_CLEAR . MovieType::VIDEO_NAME_URL_SEP . $content->ipad_url : "");
             }
             $site['episodes'] = $episodes;
             $sites[] = $site;
             //  	 	 	 var_dump($episodes);
             return $sites;
         }
     }
     return false;
 }
 static function parseMovie($id, $p_code, $info)
 {
     $url = replaceStr(NeteaseTeachParse::BASE_SHOW_EPISODE, '{COURSE_ID}', $id);
     $content = getPage($url, $p_code);
     $content = json_decode($content);
     if (is_object($content)) {
         $info->actor = property_exists($content, 'director') ? $content->director : "";
         $info->brief = property_exists($content, 'description') ? $content->description : "";
         $contents = property_exists($content, 'videoList') ? $content->videoList : array();
         if (is_array($contents) && count($contents) > 0) {
             $sites = array();
             $site = array();
             $site['site_url'] = "126";
             $site['site_name'] = "126";
             $site['max_episode'] = 'true';
             $episodes = array();
             foreach ($contents as $content) {
                 $episodes[] = array('name' => property_exists($content, 'title') ? $content->title : "", 'guest' => property_exists($content, 'subtitle') ? $content->subtitle : "", 'episode' => property_exists($content, 'pnumber') ? $content->pnumber : "", 'url' => property_exists($content, 'weburl') ? $content->weburl : "", 'img_url' => property_exists($content, 'imgpath') ? $content->imgpath : "", 'androidUrl' => property_exists($content, 'repovideourl') && !isN($content->repovideourl) ? MovieType::HIGH_CLEAR . MovieType::VIDEO_NAME_URL_SEP . $content->repovideourl : "", 'videoAddressUrl' => property_exists($content, 'repoMP3url') && !isN($content->repoMP3url) ? MovieType::HIGH_CLEAR . MovieType::VIDEO_NAME_URL_SEP . $content->repoMP3url : "");
             }
             $site['episodes'] = $episodes;
             $sites[] = $site;
             //  	 	 	 var_dump($episodes);
             return $sites;
         }
     }
     return false;
 }
 static function parseMovieInfoByContent($content, $p_code, $type)
 {
     $content = getBody($content, TVSouLiveParse::contentparmStart, TVSouLiveParse::contentparaend);
     //  	 	var_dump($content);color='#CC9966'
     $content = replaceStr($content, '#CC9966', '#6699CC');
     $times = getArray($content, "<font color='#6699CC'>", "</font>");
     $names = getArray($content, "<div id='e2' >", "</div>");
     //  	 	var_dump($names);
     //  	 	 $names=filterScript($names,8191);
     $timesArray = explode("{Array}", $times);
     $namesArray = explode("{Array}", $names);
     //  	 	var_dump($timesArray);
     $prod_itmes = array();
     $index = 0;
     foreach ($timesArray as $timeItem) {
         $name = $namesArray[$index];
         $nameArray = explode('<ahref=', $name);
         if (!isN($nameArray[0])) {
             $itemName = $nameArray[0];
         } else {
             $itemName = filterScript($name, 8191);
         }
         $prod_itmes[$timeItem] = $itemName;
         $index++;
     }
     //  	 	var_dump($prod_itmes);
     if (count($prod_itmes) == 1) {
         return false;
     }
     return $prod_itmes;
 }
Example #4
0
function getProgject($p_id)
{
    global $db;
    $sql = "select * from {pre}cj_vod_projects where p_id=" . $p_id;
    $row = $db->getRow($sql);
    $proejct = new ProjectVO();
    $proejct->p_playlinktype = $row["p_playlinktype"];
    $proejct->p_videocodeApiUrl = $row["p_videocodeApiUrl"];
    $proejct->p_videocodeApiUrlParamstart = $row["p_videocodeApiUrlParamstart"];
    $proejct->p_videocodeApiUrlParamend = $row["p_videocodeApiUrlParamend"];
    $proejct->p_videourlstart = $row["p_videourlstart"];
    $proejct->p_videourlend = $row["p_videourlend"];
    $proejct->p_videocodeType = $row["p_videocodeType"];
    //api start
    $proejct->playcodeApiUrl = $row["p_playcodeApiUrl"];
    $proejct->playcodeApiUrltype = $row["p_playcodeApiUrltype"];
    $proejct->p_playcodeApiUrlParamend = $row["p_playcodeApiUrlParamend"];
    $proejct->playcodeApiUrlParamstart = $row["p_playcodeApiUrlParamstart"];
    if (isN($proejct->playcodeApiUrltype)) {
        $proejct->playcodeApiUrltype = 0;
    }
    if (isN($proejct->p_videocodeType)) {
        $proejct->p_videocodeType = 0;
    }
    $proejct->p_coding = $row["p_coding"];
    $proejct->p_classtype = $row["p_classtype"];
    $proejct->p_typestart = $row["p_typestart"];
    $proejct->p_typeend = $row["p_typeend"];
    $proejct->p_collect_type = $row["p_collect_type"];
    $proejct->p_script = $row["p_script"];
    $proejct->p_playtype = $row["p_playtype"];
    unset($row);
    return $proejct;
}
function parseVodPad($rs, $scoreDouban)
{
    global $db;
    while ($row = $db->fetch_array($rs)) {
        $name = $row["d_name"];
        $area = $row["d_area"];
        $year = $row["d_year"];
        $d_id = $row["d_id"];
        $type = $row["d_type"];
        $doubanid = $row['d_douban_id'];
        $flag = true;
        if (!isN($doubanid) && $doubanid !== 0 && $doubanid !== '0') {
            $flag = false;
            $pic = $scoreDouban->getPicById($doubanid, 7 / 5);
        } else {
            $pic = $scoreDouban->getDouBanPics($name, $year, $area, 7 / 5);
        }
        if ($pic !== false) {
            $doubanid = $pic['id'];
            if (!isN($doubanid) && $flag) {
                $db->Update("{pre}vod", array("d_douban_id"), array($doubanid), "d_id=" . $d_id);
            }
            $pic = $pic['pic'];
        }
        if ($pic !== false && !isN($pic)) {
            $padPic = explode("{Array}", $pic);
            if (count($padPic) > 0) {
                $padPic = $padPic[0];
                writetofile("updateVodPic.txt", 'd_pic_ipad{=}' . $padPic . '{=}d_pic_ipad_tmp{=}' . $pic);
                $db->Update("{pre}vod", array("d_pic_ipad", "d_pic_ipad_tmp"), array($padPic, $pic), "d_id=" . $d_id);
            }
        }
    }
    unset($rs);
}
function replaceTop($topic_id, $rec_topic_id, $rec_topic_rule)
{
    global $db;
    //    	var_dump($rec_topic_id);
    $rs = $db->query("SELECT vod_id  FROM mac_vod_topic_items,mac_vod WHERE vod_id=d_id AND (can_search_device like '%TV%' or can_search_device is null or can_search_device ='' ) and flag=1 and topic_id =" . $topic_id . " ORDER BY disp_order DESC LIMIT 0 , 10");
    $movie = array();
    while ($row = $db->fetch_array($rs)) {
        $movie[] = $row['vod_id'];
    }
    foreach (array_keys($rec_topic_rule) as $key) {
        $position = $key;
        $position = $position - 1;
        $displayOrder = $rec_topic_rule[$key];
        $movieid = $movie[$position];
        $d_addtime = date('Y-m-d H:i:s', time());
        //  		    var_dump($movieid);
        //  		    var_dump($position);
        //  		    var_dump($displayOrder);
        $id = $db->getRow('select id from mac_vod_topic_items where flag=1 and topic_id =' . $rec_topic_id . ' and disp_order=' . $displayOrder);
        $id = $id['id'];
        if (!isN($id)) {
            //    		   var_dump($id);
            $rs = $db->query("update mac_vod_topic_items set vod_id='" . $movieid . "' WHERE id =" . $id);
        } else {
            $rs = $db->query("insert into mac_vod_topic_items (topic_id,vod_id,flag,disp_order,create_date) values('" . $rec_topic_id . "','" . $movieid . "',1,'" . $displayOrder . "','" . $d_addtime . "')");
        }
    }
}
function parseVodPad($rs, $scoreDouban)
{
    global $db;
    while ($row = $db->fetch_array($rs)) {
        $name = $row["d_name"];
        $area = $row["d_area"];
        $year = $row["d_year"];
        $d_id = $row["d_id"];
        $type = $row["d_type"];
        $doubanid = $row['d_douban_id'];
        writetofile("updateVodThumb.txt", 'sssdoubanid{=}' . $doubanid);
        $flag = true;
        if (!isN($doubanid) && $doubanid !== 0 && $doubanid !== '0') {
            $flag = false;
            writetofile("updateVodThumb.txt", 'getThumb:' . $name);
            $pic = $scoreDouban->getThumb($doubanid);
        } else {
            writetofile("updateVodThumb.txt", 'getDoubanThumb:' . $name);
            $pic = $scoreDouban->getDoubanThumb($name, $year, $area);
        }
        if ($pic !== false) {
            $doubanid = $pic['id'];
            writetofile("updateVodThumb.txt", 'doubanid{=}' . $doubanid);
            if (!isN($doubanid) && $flag) {
                $db->Update("{pre}vod", array("d_douban_id"), array($doubanid), "d_id=" . $d_id);
            }
            $pic = $pic['pic'];
        }
        if ($pic !== false && !isN($pic)) {
            writetofile("updateVodThumb.txt", 'd_pic{=}' . $pic);
            $db->Update("{pre}vod", array("d_pic"), array($pic), "d_id=" . $d_id);
        }
    }
    unset($rs);
}
Example #8
0
function editall()
{
    global $db;
    $l_id = be("arr", "l_id");
    $ids = explode(",", $l_id);
    foreach ($ids as $id) {
        $l_name = be("post", "l_name" . $id);
        $l_sort = be("post", "l_sort" . $id);
        $l_url = be("post", "l_url" . $id);
        if (isN($l_name)) {
            echo "名称不能为空";
            exit;
        }
        if (isN($l_url)) {
            echo "地址不能为空";
            exit;
        }
        if (isN($l_sort)) {
            $l_sort = $db->getOne("SELECT MAX(l_sort) FROM {pre}link");
        }
        if (!isNum($l_sort)) {
            echo "排序号不能为空";
            exit;
        }
        $db->Update("{pre}link", array("l_name", "l_url", "l_sort"), array($l_name, $l_url, $l_sort), "l_id=" . $id);
    }
    echo "修改完毕";
}
function parseVideoIOSUrls($sql)
{
    global $db;
    writetofile("parseVideo.txt", $sql);
    $rs = $db->query($sql);
    $rscount = $db->num_rows($rs);
    if ($rscount == 0) {
        errmsg("没有可用的数据");
    } else {
        while ($row = $db->fetch_array($rs)) {
            $u_id = $row["u_id"];
            $u_weburl = $row["u_weburl"];
            $p_id = $row["p_id"];
            $m_urltest = $row["m_urltest"];
            if (isN($u_weburl)) {
                $u_weburl = $m_urltest;
            }
            $project = getProgject($p_id);
            $webCode = getPage($u_weburl, $project->p_coding);
            //	    		$videoUrl = crawleVideoByPlayUrl($webCode,$project);
            $videoUrl = ContentProviderFactory::getContentProvider($project->p_playtype)->parseIOSVideoUrlByContent($webCode, $project->p_coding, $project->p_script);
            writetofile("android_log.txt", $strlink . '{===}' . $androidUrl);
            if (!isN($videoUrl)) {
                $sql = "update {pre}cj_vod_url set iso_video_url='" . $videoUrl . "', u_weburl='" . $u_weburl . "',android_vedio_url ='" . $androidUrl . "' where u_id=" . $u_id;
                writetofile("parseVideo.txt", $sql);
                $db->query($sql);
            } else {
                writetofile("videoUrlErrors.txt", '{===}' . $p_id . '{===}' . $u_id . '{===}' . $u_weburl);
            }
        }
    }
    unset($rs);
}
function editall()
{
    global $db;
    $t_id = be("arr", "t_id");
    $ids = explode(",", $t_id);
    foreach ($ids as $id) {
        $t_name = be("post", "t_name" . $id);
        $t_sort = be("post", "t_sort" . $id);
        $t_enname = be("post", "t_enname" . $id);
        $t_template = be("post", "t_template" . $id);
        $t_pic = be("post", "t_pic" . $id);
        if (isN($t_name)) {
            echo "信息填写不完整!";
            exit;
        }
        if (isN($t_enname)) {
            echo "信息填写不完整!";
            exit;
        }
        if (isN($t_sort)) {
            $t_sort = $db->getOne("SELECT MAX(t_sort) FROM {pre}vod_topic") + 1;
        }
        if (!isNum($t_sort)) {
            echo "信息填写不完整!";
            exit;
        }
        $db->Update("{pre}art_topic", array("t_name", "t_enname", "t_template", "t_sort", "t_pic"), array($t_name, $t_enname, $t_template, $t_sort, $t_pic), "t_id=" . $id);
    }
    updateCacheFile();
    echo "修改完毕";
}
Example #11
0
 public function parseIOSVideoUrlByContent($content, $p_coding, $p_script)
 {
     $videoAddressUrl = "";
     $contentObj = json_decode($content);
     if (is_object($contentObj) && property_exists($contentObj, 'down_urls') && property_exists($contentObj->down_urls, 'urls')) {
         if (is_array($contentObj->down_urls->urls)) {
             foreach ($contentObj->down_urls->urls as $item) {
                 if (!isN($item->url)) {
                     if (isN($videoAddressUrl)) {
                         if ($item->type == "hd") {
                             $videoAddressUrl = 'mp4' . MovieType::VIDEO_NAME_URL_SEP . $item->url;
                         } else {
                             $videoAddressUrl = $item->type . MovieType::VIDEO_NAME_URL_SEP . $item->url;
                         }
                     } else {
                         if ($item->type == "hd") {
                             $videoAddressUrl = $videoAddressUrl . MovieType::VIDEO_SEP_VERSION . 'mp4' . MovieType::VIDEO_NAME_URL_SEP . $item->url;
                         } else {
                             $videoAddressUrl = $videoAddressUrl . MovieType::VIDEO_SEP_VERSION . $item->type . MovieType::VIDEO_NAME_URL_SEP . $item->url;
                         }
                     }
                 }
             }
         }
     }
     //var_dump($videoAddressUrl);
     return $videoAddressUrl;
 }
Example #12
0
function chkLogin2()
{
    global $db;
    $m_id = getCookie('adminid');
    ckSql($m_id);
    $m_name = getCookie('adminname');
    ckSql($m_name);
    $m_check = getCookie('admincheck');
    ckSql($m_check);
    $index = 'index.php';
    if (strpos($_SERVER['PHP_SELF'], 'editor') > -1) {
        $index = "../" . $index;
    }
    if (!isN($m_name) && !isNum($m_id)) {
        $row = $db->getRow('SELECT * FROM {pre}manager WHERE m_name=\'' . mysql_real_escape_string($m_name) . '\' AND m_id= \'' . $m_id . '\' AND m_status=1');
        if ($row) {
            $loginValidate = md5($row['m_random'] . $row['m_name'] . $row['m_id']);
            if ($m_check != $loginValidate) {
                sCookie('admincheck', '');
                redirect($index . '?m=admin-login', 'top.');
            }
        } else {
            sCookie('admincheck', '');
            redirect($index . '?m=admin-login', 'top.');
        }
    } else {
        redirect($index . '?m=admin-login', 'top.');
    }
}
function import()
{
    global $db;
    if ($_FILES["file"]["error"] > 0) {
        echo "Error: " . $_FILES["file"]["error"] . "<br />";
    } else {
        $file = $_FILES["file"]["tmp_name"];
        $tempFile = $_FILES["file"]["name"];
        if (!isN($tempFile) && strpos($tempFile, ".csv") !== false && strpos($tempFile, ".csv") === strlen($tempFile) - 4) {
            try {
                $str = file_get_contents($file);
                $str = replaceStr($str, chr(10), "");
                $tvArrays = explode(chr(13), $str);
                //setGlobalCache("cache_vodlang",$cachearea,1,'php');
            } catch (Exception $e) {
                $tvArrays = array();
            }
            foreach ($tvArrays as $tv) {
                $items = explode(",", $tv);
                if (is_array($items)) {
                    $count = count($items);
                    if ($count > 0) {
                        $id = $items[0];
                    } else {
                        $id = '';
                        $url = '';
                    }
                    if ($count > 1) {
                        $url = $items[1];
                    } else {
                        $url = '';
                    }
                    if ($count > 2) {
                        $definition = $items[2];
                    } else {
                        $definition = '';
                        $playfrom = '';
                    }
                    if ($count > 3) {
                        $playfrom = $items[3];
                    } else {
                        $playfrom = '';
                    }
                    if (!isN($id) && !isN($url)) {
                        $row = $db->getRow("select * from mac_tv_play where tv_playurl='" . $url . "' and tv_id=" . $id);
                        if (!$row) {
                            $sql = "insert into mac_tv_play(tv_id,tv_playurl,status,tv_definition,tv_playfrom) values('" . $id . "','" . $url . "','1','" . $definition . "','" . $playfrom . "')";
                        } else {
                            $sql = "update mac_tv_play set status='1', tv_definition='" . $definition . "',tv_playfrom='" . $playfrom . "' where tv_playurl='" . $url . "' and tv_id=" . $id;
                        }
                        $row = $db->query($sql);
                    }
                }
            }
            echo "修改完毕";
        } else {
            echo "文件格式不对";
        }
    }
}
function editall()
{
    global $db;
    $t_id = be("arr", "ids");
    $ids = explode(",", $t_id);
    foreach ($ids as $id) {
        $t_flag = be("post", "t_flag" . $id);
        $t_sort = be("post", "disp_order" . $id);
        if (isN($t_sort)) {
            $t_sort = $db->getOne("SELECT MAX(disp_order) FROM {pre}vod_topic_items") + 1;
        }
        if (!isNum($t_sort)) {
            echo "信息填写不完整!";
            exit;
        }
        $db->Update("{pre}vod_topic_items", array("flag", "disp_order"), array($t_flag, $t_sort), "id=" . $id);
    }
    updateCacheFile();
    $topic_id = getBody(getReferer(), 'topic_id=', '&');
    if (isN($topic_id)) {
        $topic_id = getBodys(getReferer(), 'topic_id=');
    }
    if (!isN($topic_id)) {
        replaceTopRecommend($topic_id);
    }
    echo "修改完毕";
}
function parseVideoAndroidUrls($sql)
{
    global $db;
    writetofile("parseVideoAndroid.txt", $sql);
    //    	var_dump($sql);
    $rs = $db->query($sql);
    $rscount = $db->num_rows($rs);
    if ($rscount == 0) {
        errmsg("没有可用的数据");
    } else {
        while ($row = $db->fetch_array($rs)) {
            $u_id = $row["u_id"];
            $u_weburl = $row["u_weburl"];
            $p_id = $row["p_id"];
            $m_urltest = $row["m_urltest"];
            if (isN($u_weburl)) {
                $u_weburl = $m_urltest;
            }
            $project = getProgject($p_id);
            $videoUrl = crawleAndroidVideoByPlayUrl($u_weburl, $project);
            if (!isN($videoUrl)) {
                $sql = "update {pre}cj_vod_url set android_vedio_url='" . $videoUrl . "', u_weburl='" . $u_weburl . "' where u_id=" . $u_id;
                writetofile("parseVideoAndroid.txt", $sql);
                $db->query($sql);
            } else {
                writetofile("videoUrlAndroidErrors.txt", '{===}' . $p_id . '{===}' . $u_id . '{===}' . $u_weburl);
            }
        }
    }
    unset($rs);
}
function editall()
{
    global $db;
    $t_id = be("arr", "t_id");
    $ids = explode(",", $t_id);
    //var_dump($ids);
    foreach ($ids as $id) {
        $play_time = be("post", "play_time" . $id);
        $video_name = be("post", "video_name" . $id);
        $program_type = be("post", "program_type" . $id);
        //update config tabel
        if (!isN($program_type)) {
            $row = $db->getRow("select * from  mac_tv_program_type_item where program_type ='" . $program_type . "' and program_name='" . $video_name . "'");
            // var_dump("select * from  mac_tv_program_type_item where program_type ='".$program_type."' and program_name='".$video_name."'");
            // var_dump($row);
            if (!$row) {
                $db->query("insert into mac_tv_program_type_item(program_type,program_name) values('" . $program_type . "','" . $video_name . "')");
                //				 var_dump("insert into mac_tv_program_type_item(program_type,program_name) values('".$program_type."','".$video_name."')");
            }
            $db->query("update mac_tv_program_item set program_type='" . $program_type . "' where video_name='" . $video_name . "'");
            //var_dump("update mac_tv_program_item set program_type='".$program_type ."' where video_name='".$video_name."'");
        }
        $db->Update("{pre}tv_program_item", array("play_time", "video_name", "program_type"), array($play_time, $video_name, $program_type), "id=" . $id);
    }
    echo "修改完毕";
}
Example #17
0
function checkLogin()
{
    global $db;
    $m_name = be("post", "m_name");
    $m_name = chkSql($m_name, true);
    $m_password = be("post", "m_password");
    $m_password = chkSql($m_password, true);
    $m_password = md5($m_password);
    $m_check = be("post", "m_check");
    if (isN($m_name) || isN($m_password) || isN($m_check)) {
        alertUrl("请输入您的用户名或密码!", "?action=login");
    }
    $row = $db->getRow("SELECT * FROM {pre}manager WHERE m_name='" . $m_name . "' AND m_password = '******' AND m_status=1");
    if ($row && $m_check == app_safecode) {
        sCookie("adminid", $row["m_id"]);
        sCookie("adminname", $row["m_name"]);
        sCookie("adminlevels", $row["m_levels"]);
        $randnum = md5(rand(1, 99999999));
        sCookie("admincheck", md5($randnum . $row["m_name"] . $row["m_id"]));
        $db->Update("{pre}manager", array("m_logintime", "m_loginip", "m_random"), array(date("Y-m-d H:i:s"), getIP(), $randnum), " m_id=" . $row["m_id"]);
        echo "<script>top.location.href='index.php';</script>";
    } else {
        alertUrl("您输入的用户名和密码不正确或者您不是系统管理员!", "?action=login");
    }
}
Example #18
0
function chkLogin()
{
    global $db;
    $m_id = getCookie("adminid");
    $m_id = chkSql($m_id, true);
    $m_name = getCookie("adminname");
    //	writetofile("operate.log", "loginame:{".$m_name ."};action:{".be("all","action")."};referce:{".getReferer()."}.request:{".$_SERVER["REQUEST_URI"]."};parameters GET:{".json_encode($_GET)."}" );
    writetofile("operate.log", "loginame:{" . $m_name . "};action:{" . be("all", "action") . "};referce:{" . getReferer() . "}.request:{" . $_SERVER["REQUEST_URI"] . "};parameters POST:{" . json_encode($_POST) . "}");
    $m_name = chkSql($m_name, true);
    if (!isN($m_name) && !isN($m_id)) {
        $row = $db->getRow("SELECT * FROM {pre}manager WHERE m_name='" . $m_name . "' AND m_id= '" . $m_id . "' AND m_status ='1'");
        if ($row) {
            $loginValidate = md5($row["m_random"] . $row["m_name"] . $row["m_id"]);
            if (getCookie("admincheck") != $loginValidate) {
                sCookie("admincheck", "");
                die("<script>top.location.href='index.php?action=login';</script>");
            }
        } else {
            sCookie("admincheck", "");
            die("<script>top.location.href='index.php?action=login';</script>");
        }
    } else {
        die("<script>top.location.href='index.php?action=login';</script>");
    }
}
function editall()
{
    global $db;
    $t_id = be("arr", "t_id");
    $ids = explode(",", $t_id);
    foreach ($ids as $id) {
        $t_name = be("post", "t_name" . $id);
        $t_enname = be("post", "t_enname" . $id);
        $t_sort = be("post", "t_sort" . $id);
        //		$t_template = be("post","t_template" .$id);
        //		$t_vodtemplate = be("post","t_vodtemplate" .$id);
        //		$t_playtemplate = be("post","t_playtemplate" .$id);
        //		$t_key = be("post","t_key" .$id);
        //		$t_des = be("post","t_des" .$id);
        if (isN($t_name)) {
            echo "名称不能为空";
            exit;
        }
        if (isN($t_enname)) {
            echo "别名不能为空";
            exit;
        }
        if (!isNum($t_sort)) {
            echo "排序号不能为空或不是数字";
            exit;
        }
        //		if (isN($t_template)) { $t_template = "vodlist.html";}
        //		if (isN($t_vodtemplate)) { $t_vodtemplate = "vod.html";}
        //		if (isN($t_playtemplate)) { $t_playtemplate = "vodplay.html";}
        $db->Update("{pre}vod_type", array("t_name", "t_enname", "t_sort"), array($t_name, $t_enname, $t_sort), "t_id=" . $id);
    }
    updateCacheFile();
    echo "修改完毕";
}
Example #20
0
 function checkLogin()
 {
     if (isN($_REQUEST["code"])) {
         return false;
     } else {
         return true;
     }
 }
Example #21
0
function audit()
{
    global $db;
    $g_id = be("arr", "g_id");
    if (!isN($g_id)) {
        $db->Update("{pre}gbook", array("g_audit"), array("1"), "g_id in (" . $g_id . ")");
    }
    echo "审核完毕";
}
Example #22
0
 public function parseAndroidVideoUrlByContent($content, $p_coding, $p_script)
 {
     $aid = getBody($content, '"tvId":"', '",');
     if (isN($aid)) {
         $aid = getBody($content, 'data-player-tvid="', '"');
     }
     $api = $url = replaceStr(IqiyiContent::API, "{aid}", $aid);
     $json = getPageWindow($api, $p_coding);
     //  writetofile("iqiyi.log", $json);
     return $this->getAndroidVideoUrl(json_decode($json), $p_coding, $p_script);
 }
function getVideoUrlByProjectAndUrl($url, $pid)
{
    //    	global $db;
    $project = getProgject($pid);
    $webCode = getPage($url, $project->p_coding);
    $videoUrl = ContentProviderFactory::getContentProvider($project->p_playtype)->parseIOSVideoUrlByContent($webCode, $project->p_coding, $project->p_script);
    $androidUrl = ContentProviderFactory::getContentProvider($project->p_playtype)->parseAndroidVideoUrlByContent($webCode, $project->p_coding, $project->p_script);
    if (!isN($videoUrl) || !isN($androidUrl)) {
        return $videoUrl . MovieType::VIDEO_SEP_VERSION . $androidUrl;
    } else {
        return "Can't find";
    }
}
function parseVodPad($rs, $scoreDouban)
{
    global $db;
    while ($row = $db->fetch_array($rs)) {
        $name = $row["d_name"];
        $area = $row["d_area"];
        $year = $row["d_year"];
        $d_id = $row["d_id"];
        $type = $row["d_type"];
        $doubanid = $row['d_douban_id'];
        writetofile("updateVodReviews.txt", 'sssdoubanid{=}' . $doubanid);
        $flag = true;
        if (!isN($doubanid) && $doubanid !== 0 && $doubanid !== '0') {
            $flag = false;
            writetofile("updateVodReviews.txt", 'getThumb:' . $name);
            $comments = $scoreDouban->getReviewsById($doubanid);
        } else {
            writetofile("updateVodReviews.txt", 'getDoubanThumb:' . $name);
            $comments = $scoreDouban->getDoubanReviews($name, $year, $area);
        }
        if ($comments !== false) {
            $doubanid = $comments['id'];
            writetofile("updateVodReviews.txt", 'getDoubanThumb:' . $doubanid);
            if (!isN($doubanid) && $flag) {
                $db->Update("{pre}vod", array("d_douban_id"), array($doubanid), "d_id=" . $d_id);
            }
        }
        if (is_array($comments) && !isN($comments['comments'])) {
            $commentsArray = $comments['comments'];
            $titlesArray = $comments['title'];
            $reviewidsArray = $comments['reviewid'];
            $total = count($commentsArray);
            if ($total > 0) {
                $db->Delete("tbl_comments", "content_id=" . $d_id . " and author_id is null and comment_type=1");
                //$db->Delete("mac_comment", "c_vid=".$d_id );
            }
            for ($i = 0; $i < $total; $i++) {
                $com = $commentsArray[$i];
                $title = $titlesArray[$i];
                $reviewid = $reviewidsArray[$i];
                if (!isN($com)) {
                    $com = filterScript($com, 8191);
                    $db->Add("tbl_comments", array("status", "content_type", "content_name", "content_id", "create_date", "comments", "comment_type", "douban_comment_id", "comment_title"), array('1', $type, $name, $d_id, date("Y-m-d H:i:s"), $com, '1', $reviewid, $title));
                    $db->Add("mac_comment", array("c_audit", "c_type", "c_vid", "c_time", "c_content", "c_name"), array('1', $type, $d_id, date("Y-m-d H:i:s"), $com, $author));
                }
            }
        }
    }
    unset($rs);
}
Example #25
0
 private function getAndroidVideoUrl($vid)
 {
     $videoAddressUrl = "";
     if (isset($vid) && !is_null($vid)) {
         $url = replaceStr(SohuContent::BASE_URL, "{id}", $vid);
         $location = getPage($url, "utf-8");
         $location = getBody($location, $this->contentparmStart2, $this->contentparaend2);
         var_dump($location);
         if (!isN($location)) {
             $videoAddressUrl = $videoAddressUrl . MovieType::HIGH_CLEAR . MovieType::VIDEO_NAME_URL_SEP . $location;
         }
     }
     return $videoAddressUrl;
 }
function chgpwd()
{
    global $db;
    $oldP = be('all', 'old_pwds');
    $newP = be('all', 'new_pwd');
    $m_name = getCookie("adminname");
    $row = $db->getRow("select m_id from {pre}manager where m_password='******' and m_name='" . $m_name . "'");
    if (!isN($row['m_id'])) {
        $db->Update("{pre}manager", array('m_password'), array(md5($newP)), "m_name='" . $m_name . "'");
        echo '更新密码成功';
    } else {
        echo '输入的旧密码不对';
    }
}
function cjBaiduView($m_id, $id, $p_id, $p_collect_type, $m_playfrom)
{
    if (isN($id) || $id === "") {
        writetofile("auto_crawel_error.log", $id);
        return;
    } else {
        $info = NBaidu::parseMovieInfoById($id, $p_collect_type);
        //视频连载备注信息
        if ($p_collect_type === '2' || $p_collect_type === '131') {
            $lzcode = $info->max_episode;
            $remarksarr = NBaidu::getRemarks($id, $p_collect_type);
            $remarkscode = '';
            if ($remarksarr["remarkcode"] !== "" && $remarksarr["remarkcode"] !== "0") {
                $remarkscode = $remarksarr["remarkcode"];
            }
        } else {
            $lzcode = $info->max_episode;
            $remarkscode = $lzcode;
        }
        $lzcode = trim($lzcode);
        try {
            $lzcode = intval($lzcode);
        } catch (Exception $e) {
            $lzcode = 0;
        }
        $weburl = $info->sites;
        if (count($weburl) <= 0) {
            echo "<tr><td colspan=\"2\" align=\"center\"><span style=\"color:red\">第条数据采集结果----获取播放列表链接时出错</td></tr><tr><td width=\"20%\" >来源:</td><td ></td></tr><tr><td width=\"20%\" >名称:</td><td > 连载:" . $lzcode . " 备注:" . $remarkscode . "</span></br></td></tr>";
            writetofile("crawel_error.log", $p_collect_type . '{=====}{=====}');
            return;
        } else {
            echo "<tr><td colspan=\"2\" align=\"center\">第条数据采集结果</td></tr><tr><td width=\"20%\" >来源:</td><td ></td></tr><tr><td width=\"20%\" >名称:</td><td > 连载:" . $lzcode . " 备注:" . $remarkscode . "</br></td></tr>";
            foreach ($weburl as $weburlitem) {
                $p_playtypebaiduweb = $weburlitem['site_name'];
                $baiduwebUrls = $weburlitem['episodes'];
                if ($m_playfrom === $p_playtypebaiduweb) {
                    updateVod($m_id, $baiduwebUrls, $p_id, $p_collect_type, $p_playtypebaiduweb, $lzcode, $remarkscode);
                }
            }
        }
    }
}
function editall()
{
    global $db;
    $t_id = be("arr", "t_id");
    $ids = explode(",", $t_id);
    foreach ($ids as $id) {
        $status = be("post", "status" . $id);
        $disp_order = be("post", "disp_order" . $id);
        if (isN($disp_order)) {
            $t_sort = $db->getOne("SELECT MAX(disp_order) FROM apk_master_items ") + 1;
        }
        if (!isNum($disp_order)) {
            echo "信息填写不完整!";
            exit;
        }
        $db->Update("apk_master_items", array("status", "disp_order"), array($status, $disp_order), "id=" . $id);
    }
    updateCacheFile();
    echo "修改完毕";
}
Example #29
0
function parseVodPad($rs, $scoreDouban)
{
    global $db;
    while ($row = $db->fetch_array($rs)) {
        $name = $row["d_name"];
        $area = $row["d_area"];
        $year = $row["d_year"];
        $d_id = $row["d_id"];
        $type = $row["d_type"];
        $pic = $scoreDouban->getDouBanPics($name, $year, $area, 5 / 7);
        if ($pic !== false && !isN($pic)) {
            $padPic = explode("{Array}", $pic);
            if (count($padPic) > 0) {
                $padPic = $padPic[0];
                writetofile("updateVodPic.txt", 'd_pic_ipad{=}' . $padPic . '{=}d_pic_ipad_tmp{=}' . $pic);
                $db->Update("{pre}vod", array("d_pic_ipad", "d_pic_ipad_tmp"), array($padPic, $pic), "d_id=" . $d_id);
            }
        }
    }
    unset($rs);
}
Example #30
0
 public function parseIOSVideoUrlByContent($site_url, $p_coding, $p_script)
 {
     //  	    $videoUrlParam = getBody($content,$this->p_videourlstart,$this->p_videourlend);
     //  	    $videoUrlParam=replaceLine($videoUrlParam);
     //  	    var_dump($videoUrlParam);
     if (!isN($site_url) && preg_match('/id_(\\w.+?).html/', $site_url)) {
         preg_match_all('/id_(\\w.+?).html/', $site_url, $match);
         $videoUrlParam = $match[1][0];
     }
     if ($videoUrlParam === false || $videoUrlParam === '') {
         return '';
     }
     $videoAddressUrl = replaceStr($this->p_videocodeApiUrl_new, "{PROD_ID}", $videoUrlParam);
     $videoAddressUrl = replaceStr($videoAddressUrl, "{now_date}", time());
     if (strpos($videoAddressUrl, MovieType::VIDEO_SEP_VERSION) !== false) {
         $videoAddressUrls = MovieType::TOP_CLEAR . MovieType::VIDEO_NAME_URL_SEP . replaceStr($videoAddressUrl, MovieType::VIDEO_SEP_VERSION, MovieType::TOP_CLEAR) . MovieType::VIDEO_SEP_VERSION;
         $videoAddressUrls = $videoAddressUrls . MovieType::HIGH_CLEAR . MovieType::VIDEO_NAME_URL_SEP . replaceStr($videoAddressUrl, MovieType::VIDEO_SEP_VERSION, MovieType::HIGH_CLEAR) . MovieType::VIDEO_SEP_VERSION;
         $videoAddressUrls = $videoAddressUrls . MovieType::NORMAL . MovieType::VIDEO_NAME_URL_SEP . replaceStr($videoAddressUrl, MovieType::VIDEO_SEP_VERSION, MovieType::NORMAL);
         $videoAddressUrl = $videoAddressUrls;
     }
     return $videoAddressUrl;
 }