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 "修改完毕"; }
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; }
public function parseIOSVideoUrl($url, $p_coding, $p_script) { $id = getBody($url, $this->p_videourlstart, $this->p_videourlend); $id = base64_decode($id); $url = replaceStr(WLContent::BASE_IOS_URL, "{ID}", $id); $videoAddressUrl = $videoAddressUrl . MovieType::HIGH_CLEAR . MovieType::VIDEO_NAME_URL_SEP . $url; return $videoAddressUrl; }
private function getAndroidVideoUrl($obj, $p_coding, $p_script) { //var_dump($obj); $videoAddressUrl = ""; if (!is_object($obj) || !is_object($obj->data)) { return true; } /* mp4 && m3u8 */ if (property_exists($obj->data, 'mpl')) { foreach ($obj->data->mpl as $mpl) { /* mp4 */ switch ($mpl->vd) { case 1: $strBody = getPageWindow($mpl->m4u, 'utf-8'); $videoAddressUrl .= MovieType::VIDEO_SEP_VERSION . MovieType::Liu_Chang . MovieType::VIDEO_NAME_URL_SEP . getBody($strBody, 'data:{"l":"', '"'); break; case 2: $strBody = getPageWindow($mpl->m4u, 'utf-8'); $videoAddressUrl .= MovieType::VIDEO_SEP_VERSION . MovieType::HIGH_CLEAR . MovieType::VIDEO_NAME_URL_SEP . getBody($strBody, 'data:{"l":"', '"'); break; } } /* m3u8 */ foreach ($obj->data->mpl as $mpl) { switch ($mpl->vd) { case 1: $videoAddressUrl .= MovieType::VIDEO_SEP_VERSION . MovieType::Liu_Chang . MovieType::VIDEO_NAME_URL_SEP . $mpl->m3u; break; case 2: $videoAddressUrl .= MovieType::VIDEO_SEP_VERSION . MovieType::HIGH_CLEAR . MovieType::VIDEO_NAME_URL_SEP . $mpl->m3u; break; } } } /* m3u8 */ if (property_exists($obj->data, 'mtl')) { foreach ($obj->data->mtl as $mtl) { switch ($mtl->vd) { case 1: $videoAddressUrl .= MovieType::VIDEO_SEP_VERSION . MovieType::Liu_Chang . MovieType::VIDEO_NAME_URL_SEP . $mtl->m3u; break; case 2: $videoAddressUrl .= MovieType::VIDEO_SEP_VERSION . MovieType::HIGH_CLEAR . MovieType::VIDEO_NAME_URL_SEP . $mtl->m3u; break; case 3: $videoAddressUrl .= MovieType::VIDEO_SEP_VERSION . MovieType::TOP_CLEAR . MovieType::VIDEO_NAME_URL_SEP . $mtl->m3u; break; } } } if (strpos($videoAddressUrl, "{mType}") !== false && strpos($videoAddressUrl, "{mType}") === 0) { $videoAddressUrl = substr($videoAddressUrl, 7); } writetofile("iqiyi.log", "down url:" . $videoAddressUrl); return $videoAddressUrl; }
public function parseIOSVideoUrlByContent($content, $p_coding, $p_script) { $videoUrlParam = getBody($content, $this->p_videocodeApiUrlParamstart, $this->p_videocodeApiUrlParamend); $videoUrlParam = replaceLine($videoUrlParam); // var_dump($videoUrlParam); $p_videoUrlApi = replaceStr($this->p_videocodeApiUrl, "{PROD_ID}", $videoUrlParam); $videoUrlApiCode = getPageWindow($p_videoUrlApi, $this->p_code); $videoAddressUrl = getBody($videoUrlApiCode, $this->p_videourlstart, $this->p_videourlend); return $videoAddressUrl; }
public function parseAndroidVideoUrlByContent($content, $p_coding, $p_script) { // writetofile("content.txt", $content); $mediaid = getBody($content, $this->contentparmStart, $this->contentparaend); $number = getBody($content, $this->contentparmStartNum, $this->contentparaendNum); // writetofile("daa.txt", $vid); $vid = $mediaid . '/' . $number; // var_dump($vid) ; return $this->getAndroidVideoUrl($vid); }
public function parseAndroidVideoUrlByContent($content, $p_coding, $p_script) { $iosurl = base64_decode(getBody($content, '["iosurl"] ' . "= '", "'")); $iosurl = strstr($iosurl, '.', true); $type = trim(getBody($content, "videotype='", "'")); if ($type = 'vod' || ($type = 'video')) { $videosrc = MovieType::HIGH_CLEAR . MovieType::VIDEO_NAME_URL_SEP . 'http://mp4i.vodfile.m1905.com/movie' . $iosurl . '.mp4'; $videosrc .= MovieType::VIDEO_SEP_VERSION . MovieType::HIGH_CLEAR . MovieType::VIDEO_NAME_URL_SEP . 'http://m3u8i.vodfile.m1905.com/movie' . $iosurl . '.m3u8'; } return $videosrc; }
public function parseAndroidVideoUrlByContent($content, $p_coding, $p_script) { //writetofile("content.txt", $content); $vid = getBody($content, $this->contentparmStart, $this->contentparaend); // writetofile("daa.txt", $vid); // var_dump($vid) ; if ($vid === false || $vid === '') { return ''; } return $this->getAndroidVideoUrl($vid); }
function getActivityHtml($activity, $translation) { $result = ""; $result .= getHeader($translation); $result .= "<tbody>"; foreach ($activity as $admin) { $result .= getBody($admin); } $result .= "</tbody>"; $result .= "</table>"; return $result; }
function getActivityHtml($kills, $translation) { $result = ""; $result .= getHeader($translation); $result .= "<tbody>"; $poradie = 0; foreach ($kills as $kill) { $poradie += 1; $result .= getBody($kill, $poradie); } $result .= "</tbody>"; $result .= "</table>"; return $result; }
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; }
static function parseMovieInfoByContent($content, $p_code, $type) { $content = getBody($content, CnTVLiveParse::contentparmStart, CnTVLiveParse::contentparaend); $items = getArray($content, "<dd>", "</dd>"); $itemArray = explode("{Array}", $items); $prod_itmes = array(); foreach ($itemArray as $item) { $item = filterScript($item, 8191); $item = trim($item); $item = replaceStr($item, '回看', ''); $date = substr($item, 0, 5); $item = replaceStr($item, $date, ''); $prod_itmes[$date] = $item; } if (count($prod_itmes) == 1) { return false; } return $prod_itmes; }
function replaceFilters($strContent, $pid, $sobject, $f_sys) { //$f_sys=0视频, $flag=1文章 global $db; $sql = "select * from {pre}cj_filters where f_flag=1 and f_sys=" . $f_sys . " and (f_pid=0 or f_pid='" . $pid . "') and (f_object=0 or f_object='" . $sobject . "')"; $rs = $db->query($sql); if ($rs) { while ($row = $db->fetch_array($rs)) { if ($row["f_type"] == 1) { $strContent = replaceStr($strContent, $row["f_content"], $row["f_rep"]); } else { $FilterStr = getBody($strContent, $row["f_strstart"], $row["f_strend"]); if ($FilterStr != false) { $strContent = replaceStr($strContent, $row["f_strstart"], ""); $strContent = replaceStr($strContent, $row["f_strend"], ""); $strContent = replaceStr($strContent, $FilterStr, $row["f_rep"]); } } } } unset($rs); return $strContent; }
$pdf->setFontSize(13); $pdf->WriteHTMLCell(0, 5, 95, $y + 33, '<div style="text-transform:uppercase">' . $sequence['LIBELLEHTML'] . "</div>"); $pdf->setFontSize(8); # Table header $nbMatieres = count($groupe1) + count($groupe2) + count($groupe3); $line_height = "11px"; if ($nbMatieres >= 14) { $line_height = "9px"; } $corps = '<table border="0.5" cellpadding="0.5" style="line-height: ' . $line_height . '"><thead>' . '<tr style="text-align:center;font-weight:bold; line-height: 15px;background-color:#444444;color:#FFF;">' . '<th border="0.5" width="' . $col[1] . '%" style="text-align:left"> Matières</th>' . '<th border="0.5" width="' . $col[2] . '%">DP</th>' . '<th border="0.5" width="' . $col[3] . '%">DH</th><th border="0.5" width="' . $col[4] . '%">Moy</th>' . '<th border="0.5" width="' . $col[5] . '%">Coef</th><th border="0.5" width="' . $col[6] . '%">Total</th>' . '<th border="0.5" width="' . $col[7] . '%">Rang</th>' . '<th border="0.5" width="' . $col[8] . '%">Moy.Cl</th>' . '<th border="0.5" width="' . $col[9] . '%">Min/Max</th>' . '<th border="0.5" width="' . $col[10] . '%">Appréciation</th></tr></thead><tbody>'; # FAIRE UNE BOUCLE SUR LES GROUPES DE MATIERES $st1 = $sc1 = $st2 = $sc2 = 0; $corps .= getBody($groupe1, $col, $eleve, $st1, $sc1); $corps .= getBody($groupe2, $col, $eleve, $st2, $sc2); $corps .= printGroupe($st1 + $st2, $sc1 + $sc2, $col, "Groupe 1 + Groupe 2"); $corps .= getBody($groupe3, $col, $eleve); $corps .= "</tbody></table>"; $pdf->WriteHTMLCell(0, 5, 14, $y + 40, $corps); # RESUME DU TRAVAIL ACCOMPLI $pdf->setFontSize(7); $corps = printTravail($rang, $travail, $eleve, $prev); $pdf->WriteHTMLCell(0, 5, 25, $y + 173, $corps); # Discripline $corps = printDiscipline($discipline); $pdf->WriteHTMLCell(0, 0, 25, $y + 188, $corps); $pdf->setFont("helvetica", '', 8); # Desinner la coube d'evolution $moyennes = getMoyennesRecapitulatives($recapitulatifs, $eleve['IDELEVE']); $moyennes[] = $rang['MOYGENERALE']; genererCourbe($moyennes, $eleve); $courbe = SITE_ROOT . "public/tmp/" . $eleve['IDELEVE'] . ".png";
require_once "collect_fun.php"; require_once "api_collect_youku_cj.php"; headAdminCollect("优酷视频采集"); define("VIDEOS", "https://openapi.youku.com/v2/shows/videos.json?client_id=715115c589f8533a&show_id={id}&page=1&count={count}"); define("SHOWINFO", "https://openapi.youku.com/v2/shows/show.json?client_id=715115c589f8533a&show_id={id}"); $action = be("get", "action"); $contentparmStart = "showid_en=\""; $contentparaend = "\";"; if (isset($action) && $action === 'collectSimpl') { $type_id = be("all", "type_id"); $web_url = be("all", "web_url"); $site_url = be("all", "site_url"); $id = ''; if (!isN($web_url)) { $content = getPage($web_url, 'utf-8'); $id = getBody($content, $contentparmStart, $contentparaend); } else { if (!isN($site_url) && preg_match('/id_z(\\w.+?).html/', $site_url)) { $ids = preg_match_all('/id_z(\\w.+?).html/', $site_url, $match); $id = $match[1][0]; } else { errmsg("采集提示", "采集信息不能为空"); } } $content = getYoukuInfo($id, $type_id); $pid = ''; $category = "电影"; switch ($type_id) { case "1": //电影 $pid = "177";
$newBody .= '--MfFXiAuoTsnnDAfX' . "\n"; $newBody .= 'Content-Type: application/pgp-encrypted' . "\n"; $newBody .= 'Content-Disposition: attachment' . "\n"; $newBody .= '' . "\n"; $newBody .= 'Version: 1' . "\n"; $newBody .= '' . "\n"; $newBody .= '--MfFXiAuoTsnnDAfX' . "\n"; $newBody .= 'Content-Type: application/octet-stream' . "\n"; $newBody .= 'Content-Disposition: inline; filename="msg.asc"' . "\n"; $newBody .= '' . "\n"; $newBody .= $gpg->encrypt($raw, true); $newBody .= '' . "\n"; $newBody .= '--MfFXiAuoTsnnDAfX--' . "\n"; } else { /* No key, don't touch. */ $newBody = getBody($raw); } } $smtpOptions = array('host' => $config['relay']['host'], 'port' => $config['relay']['port']); $smtp =& Mail::factory('smtp', $smtpOptions); $smtp->send($recipient, $structure->headers, $newBody); } function randStr($length) { $chars = "abcdefghijklmnopqrstuvwxyz0123456789"; $str = ''; $size = strlen($chars); for ($i = 0; $i < $length; $i++) { $str .= $chars[rand(0, $size - 1)]; } return $str;
function register() { $salt = substr(uniqid(mt_rand(), true), 10, 10); $password = $salt . hash('sha256', $salt . getBody()->password); echo '{"password": "******"}'; }
private function handleException($e) { // TODO: test coverage if ($e instanceof ClientErrorResponseException) { // will catch all 4xx errors if ($e->getResponse()->getStatusCode() == 403) { throw new AuthenticationException($this->apiKey, $this->apiSecret, null, $e); } else { throw new DomainException('The OpenTok API request failed: ' . json_decode($e->getResponse()->getBody(true))->message, null, $e); } } else { if ($e instanceof ServerErrorResponseException) { // will catch all 5xx errors throw new UnexpectedValueException('The OpenTok API server responded with an error: ' . json_decode($e->getResponse() - getBody(true))->message, null, $e); } else { // TODO: check if this works because Exception is an interface not a class throw new Exception('An unexpected error occurred'); } } }
static function parseMovieInfoByContent($content, $p_code, $type) { if ($type == '131') { $contentSt = getBody($content, "window.aldJson = [", BaiduParse::contentparaend); } else { $contentSt = getBody($content, BaiduParse::contentparmStart, BaiduParse::contentparaend); } $content = json_decode($contentSt); $info = new VideoInfo(); if (is_object($content)) { $info->max_episode = property_exists($content, 'max_episode') ? $content->max_episode : ""; $info->curr_episode = property_exists($content, 'cur_episodes') ? $content->cur_episodes : ""; if (isN($info->curr_episode)) { $info->curr_episode = property_exists($content, 'episode') ? $content->episode : ""; } // $info->title = property_exists($content, 'title') ? $content->title : ""; if (property_exists($content, 'season_num')) { $info->season_num = $content->season_num; } if (!isN($content->season_num)) { $content->season_num = BaiduParse::lang($num); if (!isN($content->season_num)) { $info->title = $info->title . ' 第' . $content->season_num . '季'; } } $info->language = property_exists($content, 'language') ? $content->language : ""; $info->update_freq = property_exists($content, 'update_freq') ? $content->update_freq : ""; $info->duration = property_exists($content, 'duration') ? $content->duration : ""; $info->big_poster = ""; //property_exists($content, 'big_poster')?$content->big_poster:""; // $info->director = property_exists($content, 'director') ? BaiduParse::parseArrayToString($content->director) : ""; $info->area = property_exists($content, 'area') ? BaiduParse::parseArrayToString($content->area) : ""; $info->type = property_exists($content, 'type') ? BaiduParse::parseArrayToString($content->type) : ""; $info->actor = property_exists($content, 'actor') ? BaiduParse::parseArrayToString($content->actor) : ""; if (isN($info->actor)) { $info->actor = property_exists($content, 'host') ? BaiduParse::parseArrayToString($content->host) : ""; } if (isN($info->director)) { $info->director = property_exists($content, 'station') ? BaiduParse::parseArrayToString($content->station) : ""; } if (isN($info->actor)) { //角色 $info->actor = property_exists($content, 'leader') ? BaiduParse::parseArrayToString($content->leader) : ""; } if (isN($info->director)) { //声优 $info->director = property_exists($content, 'dub') ? BaiduParse::parseArrayToString($content->dub) : ""; } $info->alias = property_exists($content, 'alias') ? BaiduParse::parseArrayToString($content->alias) : ""; $info->brief = property_exists($content, 'brief') ? $content->brief : ""; if (!isN($info->alias)) { $info->brief = $info->brief . ' ' . $info->alias; } if (!isN($info->update_freq)) { $info->brief = $info->brief . ' 更新频率:' . $info->update_freq; } $info->id = property_exists($content, 'id') ? $content->id : ""; $info->pubdate = property_exists($content, 'al_date') ? $content->al_date : ""; if (isN($info->pubdate)) { $info->pubdate = property_exists($content, 'pubtime') ? $content->pubtime : ""; } if (isN($info->pubdate)) { $info->pubdate = property_exists($content, 'years') ? BaiduParse::parseArrayToString($content->years) : ""; } $info->sites = property_exists($content, 'sites') ? BaiduParse::parseSitesUrl($content->sites, $info->id, $type, property_exists($content, 'years') ? BaiduParse::parseArrayToString($content->years) : $info->pubdate, $p_code) : ""; } else { $vedio_id = getBody($contentSt, "id: '", "'"); $info->id = $vedio_id; if ($type === 1 || $type === '1') { $url = 'http://v.baidu.com/movie_intro/?dtype=playUrl&service=json&id=' . $vedio_id; } else { if ($type === 2 || $type === '2') { $url = 'http://v.baidu.com/tv_intro/?dtype=tvPlayUrl&service=json&id=' . $vedio_id; } else { if ($type === 3 || $type === '3') { $url = 'http://v.baidu.com/show_intro/?dtype=tvshowPlayUrl&service=json&frp=browse&year=2014&id=' . $vedio_id; } else { if ($type === 131 || $type === '131') { $url = 'http://v.baidu.com/comic_intro/?dtype=comicPlayUrl&service=json&id=' . $vedio_id; } } } } writetofile("baiducontent.log", "request url:" . $url); $playUrlsContent = getPage($url, 'gb2312'); writetofile("baiducontent.log", "request content:" . $playUrlsContent); $content = json_decode($playUrlsContent); if ($type === 1 || $type === '1') { $info->sites = BaiduParse::parseArrayMovie($content); } else { if ($type === 2 || $type === '2') { $info->sites = BaiduParse::parseArrayTV($content); } else { if ($type === 3 || $type === '3') { $info->sites = BaiduParse::parseArrayTV($content); } else { if ($type === 131 || $type === '131') { $info->sites = BaiduParse::parseArrayTV($content); } } } } } // var_dump($info->sites[0]); // var_dump('------'); return $info; }
function get_table_data($access_level) { global $mySQLi, $posts, $myReturn; $out['aoColumns'] = getHead($access_level); $qry = "SELECT * FROM `{$posts}` WHERE `{$posts}`.`type`='post' AND `{$posts}`.`status`='open' ORDER BY created;"; $out['sql'] = $qry; $result = $mySQLi->get_results($qry); $out['access_level'] = $access_level; $out['results'] = $result; /* For debugging only. Passes security information for your MySQL connection ob_start(); var_dump($mySQLi); $out['mySQLi'] = ob_get_clean(); */ if ($result !== false) { $out['success'] = true; $out['aaData'] = getBody($result, $access_level); } else { $out['success'] = false; $out['tbody'] = '<tbody>'; $out['tbody'] .= '<tr><td colspan="' . (isset($access_level) && $access_level > 0 ? 6 : 7) . '">'; $out['tbody'] .= '(No records found)'; $out['tbody'] .= '</td></tr>'; } // end if results found; return $out; }
$attrs = ["codeperiode" => $codeperiode]; } elseif ($codeperiode === "A") { $attrs = ["codeperiode" => $codeperiode]; } $corps = getHeaderBulletin($enseignements, $col, $attrs); # FAIRE UNE BOUCLE SUR LES GROUPES DE MATIERES $st1 = $sc1 = $st2 = $sc2 = 0; if ($codeperiode === "A") { $corps .= getBodyAnnuelle($groupe1, $col, $rang, $st1, $sc1); $corps .= getBodyAnnuelle($groupe2, $col, $rang, $st2, $sc2); $corps .= getBodyAnnuelle($groupe3, $col, $rang); } else { $corps .= getBody($groupe1, $col, $rang, $codeperiode, $st1, $sc1); $corps .= getBody($groupe2, $col, $rang, $codeperiode, $st2, $sc2); //$corps .= printGroupe($st1 + $st2, $sc1 + $sc2, $col, "Groupe 1 + Groupe 2"); $corps .= getBody($groupe3, $col, $rang, $codeperiode); } $corps .= "</tbody></table>"; if ($codeperiode === "A") { $pdf->WriteHTMLCell(0, 5, 14, $y + 15, $corps); } else { $pdf->WriteHTMLCell(0, 5, 14, $y + 20, $corps); } # RESUME DU TRAVAIL ACCOMPLI $pdf->setFontSize(10); if ($codeperiode === "S") { $corps = printTravail($rang, $travail, $prev); } elseif ($codeperiode === "T") { $seq1 = getMoyRecapitulativeSequence($rang['IDELEVE'], $sequence1); $seq1["ORDRE"] = $sequences[0]['ORDRE']; $seq2 = getMoyRecapitulativeSequence($rang['IDELEVE'], $sequence2);
function del() { global $db, $action, $flag, $show, $id, $name, $ajaxcontent, $tid, $ttype, $thit, $ttopic; $tab = be("all", "tab"); $flag = be("all", "flag"); $upcache = false; switch ($tab) { case "{pre}link": $col = "l_id"; $ids = be("get", "l_id"); if (isN($ids)) { $ids = be("arr", "l_id"); } break; case "apk_master_items": $col = "id"; $ids = be("get", "t_id"); if (isN($ids)) { $ids = be("arr", "t_id"); } break; case "{pre}vod_type": $col = "t_id"; $ids = be("get", "t_id"); if (isN($ids)) { $ids = be("arr", "t_id"); } $upcache = true; break; case "apk_company": $col = "id"; $ids = be("get", "t_id"); if (isN($ids)) { $ids = be("arr", "t_id"); } $upcache = true; break; case "apk_master_temp": $col = "id"; $ids = be("get", "t_id"); if (isN($ids)) { $ids = be("arr", "t_id"); } $upcache = true; break; case "apk_category": $col = "id"; $ids = be("get", "t_id"); if (isN($ids)) { $ids = be("arr", "t_id"); } $upcache = true; break; case "{pre}vod_topic": $col = "t_id"; $ids = be("get", "t_id"); if (isN($ids)) { $ids = be("arr", "t_id"); } $upcache = true; if (!isN($ids)) { $db->Delete("{pre}vod_topic_items", "topic_id" . " in (" . $ids . ")"); } break; case "apk_master_base": $col = "id"; $ids = be("get", "t_id"); if (isN($ids)) { $ids = be("arr", "t_id"); } $upcache = true; if (!isN($ids)) { $db->Delete("apk_master_items", "apk_id" . " in (" . $ids . ")"); } break; case "{pre}art": $col = "a_id"; $ids = be("get", "a_id"); if (isN($ids)) { $ids = be("arr", "a_id"); } break; case "{pre}art_type": $col = "t_id"; $ids = be("get", "t_id"); if (isN($ids)) { $ids = be("arr", "t_id"); } $upcache = true; break; case "{pre}art_topic": $col = "t_id"; $ids = be("get", "t_id"); if (isN($ids)) { $ids = be("arr", "t_id"); } $upcache = true; break; case "{pre}gbook": $col = "g_id"; $ids = be("get", "g_id"); if (isN($ids)) { $ids = be("arr", "g_id"); } break; case "{pre}manager": $col = "m_id"; $ids = be("get", "m_id"); if (isN($ids)) { $ids = be("arr", "m_id"); } break; case "{pre}thirdpart_config": $col = "id"; $ids = be("get", "m_id"); if (isN($ids)) { $ids = be("arr", "m_id"); } break; case "{pre}user_group": $col = "ug_id"; $ids = be("get", "ug_id"); if (isN($ids)) { $ids = be("arr", "ug_id"); } $upcache = true; break; case "{pre}user": $col = "u_id"; $ids = be("get", "u_id"); if (isN($ids)) { $ids = be("arr", "u_id"); } break; case "{pre}user_card": $col = "c_id"; $ids = be("get", "c_id"); if (isN($ids)) { $ids = be("arr", "c_id"); } break; case "{pre}comment": $col = "c_id"; $ids = be("get", "c_id"); if (isN($ids)) { $ids = be("arr", "c_id"); } break; case "{pre}tv_play": $col = "id"; $ids = be("get", "t_id"); if (isN($ids)) { $ids = be("arr", "t_id"); } break; case "{pre}vod_topic_items": $col = "id"; $ids = be("get", "ids"); if (isN($ids)) { $ids = be("arr", "ids"); } break; case "{pre}vod_pasre_item": $col = "id"; $ids = be("get", "ids"); if (isN($ids)) { $ids = be("arr", "ids"); } break; case "{pre}vod_popular": $col = "id"; $ids = be("get", "t_id"); if (isN($ids)) { $ids = be("arr", "t_id"); } break; } if (!isN($ids)) { $db->Delete($tab, $col . " in (" . $ids . ")"); if ($tab === '{pre}vod_topic_items') { $topic_id = getBody(getReferer(), 'topic_id=', '&'); if (isN($topic_id)) { $topic_id = getBodys(getReferer(), 'topic_id='); } if (!isN($topic_id)) { replaceTopRecommend($topic_id); } } } if ($upcache) { updateCacheFile(); } if (isN($flag)) { redirect(getReferer()); } else { echo "删除完毕"; } }
function lastsave() { global $db, $cache; $p_id = be("all", "p_id"); $p_timestart = be("post", "p_timestart"); $p_timeend = be("post", "p_timeend"); $p_areastart = be("post", "p_areastart"); $p_areaend = be("post", "p_areaend"); $p_classtype = be("post", "p_classtype"); $p_collect_type = be("post", "p_collect_type"); $p_typestart = be("post", "p_typestart"); $p_typeend = be("post", "p_typeend"); $p_contentstart = be("post", "p_contentstart"); $p_contentend = be("post", "p_contentend"); $p_playcodetype = be("post", "p_playcodetype"); $p_playcodestart = be("post", "p_playcodestart"); $p_playcodeend = be("post", "p_playcodeend"); $p_playurlstart = be("post", "p_playurlstart"); $p_playurlend = be("post", "p_playurlend"); $p_playlinktype = be("post", "p_playlinktype"); $p_playlinkstart = be("post", "p_playlinkstart"); $p_playlinkend = be("post", "p_playlinkend"); $p_playspecialtype = be("post", "p_playspecialtype"); $p_playspecialrrul = be("post", "p_playspecialrrul"); $p_timestart = be("post", "p_timestart"); $p_playspecialrerul = be("post", "p_playspecialrerul"); $p_starringtype = be("post", "p_starringtype"); $p_starringstart = be("post", "p_starringstart"); $p_starringend = be("post", "p_starringend"); $p_titletype = be("post", "p_titletype"); $p_pictype = be("post", "p_pictype"); $p_pagetype = be("all", "p_pagetype"); $p_listcodestart = be("post", "p_listcodestart"); $p_listcodeend = be("post", "p_listcodeend"); $p_titlestart = be("post", "p_titlestart"); $p_titleend = be("post", "p_titleend"); $p_listlinkstart = be("post", "p_listlinkstart"); $p_listlinkend = be("post", "p_listlinkend"); $p_picstart = be("post", "p_picstart"); $p_picend = be("post", "p_picend"); $p_lzstart = be("post", "p_lzstart"); $p_lzend = be("post", "p_lzend"); $strlisturl = be("post", "listurl"); $p_coding = be("post", "p_coding"); $p_lzcodetype = be("post", "p_lzcodetype"); $p_lzcodestart = be("post", "p_lzcodestart"); $p_lzcodeend = be("post", "p_lzcodeend"); $p_languagestart = be("post", "p_languagestart"); $p_languageend = be("post", "p_languageend"); $p_remarksstart = be("post", "p_remarksstart"); $p_remarksend = be("post", "p_remarksend"); $p_directedstart = be("post", "p_directedstart"); $p_directedend = be("post", "p_directedend"); $p_setnametype = be("post", "p_setnametype"); $p_setnamestart = be("post", "p_setnamestart"); $p_setnameend = be("post", "p_setnameend"); $p_setnametype = be("post", "p_setnametype"); $p_playtype = be("post", "p_playtype"); //api start $playcodeApiUrl = be("post", "p_playcodeApiUrl"); $playcodeApiUrltype = be("post", "p_playcodeApiUrltype"); $p_playcodeApiUrlParamend = be("post", "p_playcodeApiUrlParamend"); $playcodeApiUrlParamstart = be("post", "p_playcodeApiUrlParamstart"); if (isN($playcodeApiUrltype)) { $playcodeApiUrltype = 0; } $p_videocodeApiUrl = be("post", "p_videocodeApiUrl"); $p_videocodeApiUrlParamstart = be("post", "p_videocodeApiUrlParamstart"); $p_videocodeApiUrlParamend = be("post", "p_videocodeApiUrlParamend"); $p_videourlstart = be("post", "p_videourlstart"); $p_videourlend = be("post", "p_videourlend"); $p_videocodeType = be("post", "p_videocodeType"); //api end if (isN($p_videocodeType)) { $p_videocodeType = 0; } if (isN($p_starringtype)) { $p_starringtype = 0; } if (isN($p_titletype)) { $p_titletype = 0; } if (isN($p_pictype)) { $p_pictype = 0; } $sql = "select * from {pre}cj_vod_projects Where p_id=" . $p_id; $row = $db->getRow($sql); $p_pagetype = $row["p_pagetype"]; $strSet = ""; if ($p_pagetype == 3 || $p_starringtype == 0) { $strSet .= "p_starringstart='" . $p_starringstart . "',p_starringend='" . $p_starringend . "',"; } else { $p_starringstart = $row["p_starringstart"]; $p_starringend = $row["p_starringend"]; } if ($p_pagetype == 3 || $p_titletype == 0) { $strSet .= "p_titlestart='" . $p_titlestart . "',p_titleend='" . $p_titleend . "',"; } else { $p_titlestart = $row["p_titlestart"]; $p_titleend = $row["p_titleend"]; } if ($p_pagetype == 3 || $p_pictype == 0) { $strSet .= "p_picstart='" . $p_picstart . "',p_picend='" . $p_picend . "',"; } else { $p_picstart = $row["p_picstart"]; $p_picend = $row["p_picend"]; } $strSet .= "p_lzstart='" . $p_lzstart . "',p_lzend='" . $p_lzend . "',p_timestart='" . $p_timestart . "',p_timeend='" . $p_timeend . "',p_areastart='" . $p_areastart . "',p_areaend='" . $p_areaend . "',p_classtype='" . $p_classtype . "',p_collect_type='" . $p_collect_type . "',p_typestart='" . $p_typestart . "',p_typeend='" . $p_typeend . "',p_contentstart='" . $p_contentstart . "',p_contentend='" . $p_contentend . "',p_playcodetype='" . $p_playcodetype . "',p_playcodestart='" . $p_playcodestart . "',p_playcodeend='" . $p_playcodeend . "',p_playurlstart='" . $p_playurlstart . "',p_playurlend='" . $p_playurlend . "',p_playlinktype='" . $p_playlinktype . "',p_playlinkstart='" . $p_playlinkstart . "',p_playlinkend='" . $p_playlinkend . "',p_playspecialtype='" . $p_playspecialtype . "',p_playspecialrrul='" . $p_playspecialrrul . "',p_playspecialrerul='" . $p_playspecialrerul . "',p_lzcodetype='" . $p_lzcodetype . "',p_lzcodestart='" . $p_lzcodestart . "',p_lzcodeend='" . $p_lzcodeend . "',p_languagestart='" . $p_languagestart . "',p_languageend='" . $p_languageend . "',p_remarksstart='" . $p_remarksstart . "',p_remarksend='" . $p_remarksend . "',p_directedstart='" . $p_directedstart . "',p_directedend='" . $p_directedend . "',p_setnametype='" . $p_setnametype . "',p_setnamestart='" . $p_setnamestart . "',p_setnameend='" . $p_setnameend . "'"; $strSet = $strSet . ",p_playcodeApiUrl='" . $playcodeApiUrl . "',p_playcodeApiUrltype='" . $playcodeApiUrltype . "',p_playcodeApiUrlParamend='" . $p_playcodeApiUrlParamend . "',p_playcodeApiUrlParamstart='" . $playcodeApiUrlParamstart . "'"; $strSet = $strSet . ",p_videocodeApiUrl='" . $p_videocodeApiUrl . "',p_videocodeApiUrlParamstart='" . $p_videocodeApiUrlParamstart . "',p_videocodeApiUrlParamend='" . $p_videocodeApiUrlParamend . "',p_videourlstart='" . $p_videourlstart . "',p_videourlend='" . $p_videourlend . "',p_videocodeType='" . $p_videocodeType . "'"; $db->query("update {pre}cj_vod_projects set " . $strSet . " where p_id=" . $p_id); $p_listcodestart = $row["p_listcodestart"]; $p_listcodeend = $row["p_listcodeend"]; $p_listlinkstart = $row["p_listlinkstart"]; $p_listlinkend = $row["p_listlinkend"]; $p_playcodestart = $row["p_playcodestart"]; $p_playcodeend = $row["p_playcodeend"]; $p_pagebatchurl = $row["p_pagebatchurl"]; $p_pagebatchid1 = $row["p_pagebatchid1"]; $p_pagebatchid2 = $row["p_pagebatchid2"]; $p_server = $row["p_server"]; $UrlTestMoive = ''; if ($p_server > 0) { $p_server_address = $db->getOne("select ds_url from {pre}vod_server where ds_id=" . $p_server); } $p_script = $row["p_script"]; // echo $p_pagetype; if ($p_pagetype != 3) { if (isN($_SESSION["strListCode"])) { $strListCode = getPage($strlisturl, $p_coding); $_SESSION["strListCode"] = $strListCode; } else { $strListCode = $_SESSION["strListCode"]; } if (isN($_SESSION["strListCodeCut"])) { $strListCodeCut = getBody($strListCode, $p_listcodestart, $p_listcodeend); $_SESSION["strListCodeCut"] = $strListCodeCut; } else { $strListCodeCut = $_SESSION["strListCodeCut"]; } if (isN($_SESSION["linkarrcode"])) { $linkarrcode = getArray($strListCodeCut, $p_listlinkstart, $p_listlinkend); $_SESSION["linkarrcode"] = $linkarrcode; } else { $linkarrcode = $_SESSION["linkarrcode"]; } if ($p_starringtype == 1) { $starringarrcode = getArray($strListCodeCut, $p_starringstart, $p_starringend); } if ($p_titletype == 1) { $titlearrcode = getArray($strListCodeCut, $p_titlestart, $p_titleend); } if ($p_pictype == 1) { $picarrcode = getArray($strListCodeCut, $p_picstart, $p_picend); } switch ($linkarrcode) { case False: errmsg("采集提示", "<li>在获取链接列表时出错。" . $linkarrcode . "</li>"); break; default: $linkarr = explode("{Array}", $linkarrcode); $UrlTest = getHrefFromLink($linkarr[0]); $UrlTest = definiteUrl($UrlTest, $strlisturl); // var_dump($UrlTest); $linkcode = getPage($UrlTest, $p_coding); $UrlTestMoive = $UrlTest; echo "<li>采集提示:采集页面:" . $UrlTest . "</li>"; break; } } else { $strlisturl = $p_pagebatchurl; $p_pagebatchurl = replaceStr($p_pagebatchurl, "{ID}", $p_pagebatchid1); $linkcode = getPage($p_pagebatchurl, $p_coding); } var_dump($p_playtype); if ($linkcode == False) { errmsg("采集提示", "获取内容页失败!"); return; } if ($p_titletype == 1) { switch ($titlearrcode) { case False: $titlecode = "获取失败"; break; default: $titlearr = explode("{Array}", $titlearrcode); $titlecode = $titlearr[0]; break; } } else { $titlecode = getBody($linkcode, $p_titlestart, $p_titleend); writetofile("tte.log", $linkcode); var_dump(ascii_decode($titlecode)); } if ($p_starringtype == 1) { switch ($starringarrcode) { case False: $starringcode = "获取失败"; break; default: $starringarr = explode("{Array}", $starringarrcode); $starringcode = $starringarr[0]; break; } } else { $starringcode = getBody($linkcode, $p_starringstart, $p_starringend); } if ($p_pictype == 1) { switch ($picarrcode) { case False: $piccode = "获取失败"; break; default: $picarr = explode("{Array}", $picarrcode); $piccode = $picarr[0]; break; } } else { $piccode = getBody($linkcode, $p_picstart, $p_picend); } $piccode = definiteUrl($piccode, $strlisturl); if ($p_lzcodetype == 1) { $lzfwcode = getBody($linkcode, $p_lzcodestart, $p_lzcodeend); $lzcode = getBody($lzfwcode, $p_lzstart, $p_lzend); $lzcode = replaceStr($lzcode, "False", "0"); } else { $lzcode = getBody($linkcode, $p_lzstart, $p_lzend); $lzcode = replaceStr($lzcode, "False", "0"); } $remarkscode = getBody($linkcode, $p_remarksstart, $p_remarksend); $remarkscode = replaceStr($remarkscode, "False", ""); $directedcode = getBody($linkcode, $p_directedstart, $p_directedend); $directedcode = replaceStr($directedcode, "False", ""); $languagecode = getBody($linkcode, $p_languagestart, $p_languageend); $languagecode = replaceStr($languagecode, "False", "未知"); $areacode = getBody($linkcode, $p_areastart, $p_areaend); if ($areacode == false) { $areacode = "未知"; } $timecode = getBody($linkcode, $p_timestart, $p_timeend); if ($timecode == false) { $timecode = date('Y-m-d', time()); } $contentcode = getBody($linkcode, $p_contentstart, $p_contentend); if ($contentcode == false) { $contentcode = "未知"; } $contentcode = replaceFilters($contentcode, $p_id, 2, 0); if ($p_classtype == 1) { $typecode = getBody($linkcode, $p_typestart, $p_typeend); } else { $typecode = $p_collect_type; $typearr = getValueByArray($cache[0], "t_id", $typecode); $typecode = $typearr["t_name"]; } if ($p_playcodetype == 1) { $playcode = getBody($linkcode, $p_playcodestart, $p_playcodeend); if ($p_playlinktype > 0) { $weburl = getArray($playcode, $p_playlinkstart, $p_playlinkend); } else { $weburl = getArray($playcode, $p_playurlstart, $p_playurlend); // var_dump($playcode); } if ($p_setnametype == 3) { $setnames = getArray($playcode, $p_setnamestart, $p_setnameend); } } else { if ($p_playcodetype == 2) { //from api // writetofile("d:\\s.txt",$linkcode) ; // echo $p_playcodeApiUrlParamend .'=='.$playcodeApiUrlParamstart; // echo $playcodeApiUrlParamstart .'\n' .$p_playcodeApiUrlParamend .' = '.$playcodeApiUrltype; if ($playcodeApiUrltype == 0) { $paracode = getBody($linkcode, $playcodeApiUrlParamstart, $p_playcodeApiUrlParamend); } else { $paracode = getBody($UrlTestMoive, $playcodeApiUrlParamstart, $p_playcodeApiUrlParamend); } // echo $paracode; $p_apibatchurl = replaceStr($playcodeApiUrl, "{PROD_ID}", $paracode); $p_apibatchurls = replaceStr($p_apibatchurl, "{PAGE_NO}", 1); // writetofile("d:\\ts.txt", $p_apibatchurls."\n"); $playcode = getFormatPage($p_apibatchurls, $p_coding); // echo $playcode."\n"; $weburl = getArray($playcode, $p_playlinkstart, $p_playlinkend); // writetofile("d:\\ts.txt",'aaaaa('.$p_playlinkstart.")\n\t(".$p_playlinkend.")\n\t"); $page_num = 2; // writetofile("d:\\ts.txt",$weburl); // echo "page 1 :".$weburl .'\n'; $flag = true; while ($flag && strpos($playcodeApiUrl, "{PAGE_NO}") !== false) { $p_apibatchurls = replaceStr($p_apibatchurl, "{PAGE_NO}", $page_num); // echo $p_apibatchurls .'\n'; $playcode = getFormatPage($p_apibatchurls, $p_coding); $weburls = getArray($playcode, $p_playlinkstart, $p_playlinkend); // writetofile("d:\\ts.txt", "page ".$page_num." :".$weburls .'\n'); if ($weburls) { $weburl = $weburl . "{Array}" . $weburls; $page_num = $page_num + 1; } else { $flag = false; } } // var_dump($weburl); // if ($p_playlinktype >0) { // $weburl = getArray($playcode,$p_playlinkstart,$p_playlinkend); // } // else{ // $weburl = getArray($playcode,$p_playurlstart,$p_playurlend); // // var_dump($playcode); // } // if ($p_setnametype == 3) { // $setnames = getArray($playcode,$p_setnamestart,$p_setnameend); // } } else { if ($p_playlinktype > 0) { $weburl = getArray($linkcode, $p_playlinkstart, $p_playlinkend); } else { $weburl = getArray($linkcode, $p_playurlstart, $p_playurlend); } if ($p_setnametype == 3) { $setnames = getArray($linkcode, $p_setnamestart, $p_setnameend); } } } $titlecode = filterScript($titlecode, $p_script); $titlecode = replaceFilters($titlecode, $p_id, 1, 0); $starringcode = filterScriptStar($starringcode, $p_script); $directedcode = filterScriptStar($directedcode, $p_script); $timecode = filterScript($timecode, $p_script); $typecode = filterScript($typecode, $p_script); $areacode = filterScript($areacode, $p_script); $piccode = filterScript($piccode, $p_script); $remarkscode = filterScript($remarkscode, $p_script); $languagecode = filterScript($languagecode, $p_script); ?> <form name="form" action="?action=saveok" method="post"> <table class="tb"> <tr> <td colspan="2" align="center">采 集 测 试 结 果</td> </tr> <tr> <td width="20%">名称:</td> <td> <?php echo $titlecode; ?> 连载:<?php echo $lzcode; ?> 备注:<?php echo $remarkscode; ?> </td> </tr> <tr> <td>演员:</td> <td> <?php echo $starringcode; ?> </td> </tr> <tr> <td>导演:</td> <td> <?php echo $directedcode; ?> </td> </tr> <tr> <td>日期:</td> <td> <?php echo $timecode; ?> </td> </tr> <tr> <td>栏目:</td> <td> <?php echo $typecode; ?> </td> </tr> <tr> <td>地区:</td> <td> <?php echo $areacode; ?> </td> </tr> <tr> <td>语言:</td> <td> <?php echo $languagecode; ?> </td> </tr> <tr> <td>图片:</td> <td> <?php echo getHrefFromImg($piccode); ?> </td> </tr> <tr> <td>介绍:</td> <td> <?php echo strip_tags($contentcode); ?> </td> </tr> <?php if ($weburl != False) { $webArray = explode("{Array}", $weburl); $setnamesArray = explode("{Array}", $setnames); $webArraTemp = array(); $index = 0; $webUrls = ''; for ($i = 0; $i < count($webArray); $i++) { $UrlTemp = $webArray[$i]; if (strpos($webUrls, $UrlTemp . '<array>') === false) { $webArraTemp[$index] = $UrlTemp; $webUrls = $webUrls . $UrlTemp . '<array>'; $index++; } } $webArray = $webArraTemp; for ($i = 0; $i < count($webArray); $i++) { $UrlTest = $webArray[$i]; if ($p_playspecialtype == 1 && strpos("," . $p_playspecialrrul, "[变量]")) { $Keyurl = explode("[变量]", $p_playspecialrrul); $urli = getBody($UrlTest, $Keyurl[0], $Keyurl[1]); if ($urli == False) { break; } $UrlTest = replaceStr($p_playspecialrerul, "[变量]", $urli); } if ($p_playspecialtype == 2) { $urArray = explode("/", $UrlTestMoive); // writetofile("d:\\ts.txt","ss:".$UrlTestMoive); $ur = ""; for ($k = 0; $k < count($urArray) - 1; $k++) { $ur = $ur . $urArray[$k] . "/"; } $UrlTest = $ur . $UrlTest . ".html"; } // writetofile("d:\\ts.txt", $UrlTest); if ($p_playlinktype == 1) { $UrlTest = getHrefFromLink($UrlTest); $UrlTest = definiteUrl($UrlTest, $strlisturl); $webCode = getPage($UrlTest, $p_coding); $url = getBody($webCode, $p_playurlstart, $p_playurlend); $url = replaceFilters($url, $p_id, 3, 0); $url = replaceLine($url); $androidUrl = ContentProviderFactory::getContentProvider($p_playtype)->parseAndroidVideoUrlByContent($webCode, $p_coding, $p_script); $videoAddressUrl = ContentProviderFactory::getContentProvider($p_playtype)->parseIOSVideoUrlByContent($webCode, $p_coding, $p_script); $videoAddressUrl = $androidUrl . '{====}' . $videoAddressUrl; } else { if ($p_playlinktype == 2) { $UrlTest = getHrefFromLink($UrlTest); if (isN($p_playurlend)) { $tmpA = strpos($UrlTest, $p_playurlstart); $url = substr($UrlTest, strlen($UrlTest) - $tmpA - strlen($p_playurlstart) + 1); } else { $url = getBody($UrlTest, $p_playurlstart, $p_playurlend); } } else { if ($p_playlinktype == 3) { $UrlTest = getHrefFromLink($UrlTest); $UrlTest = definiteUrl($UrlTest, $strlisturl); $webCode = getPage($UrlTest, $p_coding); $tmpB = getArray($webCode, $p_playurlstart, $p_playurlend); $tmpC = explode("{$Array}\$", $tmpB); foreach ($tmpC as $tmpD) { $url = $tmpD; ?> <tr> <td>播放列表:</td> <td> <?php echo $p_server_address . $UrlTest; ?> </td> </tr> <tr> <td>地址:</td> <td> <?php echo $p_server_address . $url; ?> </td> </tr> <?php } break; } else { $url = replaceFilters($UrlTest, $p_id, 3, 0); $url = replaceLine($url); // echo $url; $webCode = getPage($UrlTestMoive, $p_coding); $androidUrl = ContentProviderFactory::getContentProvider($p_playtype)->parseAndroidVideoUrlByContent($webCode, $p_coding, $p_script); $videoAddressUrl = ContentProviderFactory::getContentProvider($p_playtype)->parseIOSVideoUrlByContent($webCode, $p_coding, $p_script); $videoAddressUrl = $androidUrl . '{====}' . $videoAddressUrl; ?> <tr> <td>播放列表:</td> <td> <?php echo $p_server_address . $UrlTestMoive; ?> </td> </tr> <tr> <td>视频地址列表:</td> <td> <?php echo $p_server_address . replaceStr($videoAddressUrl, "\\", ""); ?> </td> </tr> <tr> <td>地址:</td> <td> <?php echo $p_server_address . $url; ?> </td> </tr> <?php continue; } } } if ($p_setnametype == 1) { $setname = getBody($url, $p_setnamestart, $p_setnameend); // $url = $setname ."$" .$url; } else { if ($p_setnametype == 2 && $p_playlinktype == 1) { $setname = getBody($webCode, $p_setnamestart, $p_setnameend); // $url = $setname ."$" .$url; } else { if ($p_setnametype == 3) { $setname = $setnamesArray[$i]; // $url = $setnamesArray[$i] . "$" .$url; } } } ?> <tr> <td>播放列表:</td> <td> <?php echo $UrlTest; ?> </td> </tr><tr> <td>视频地址列表:</td> <td> <?php echo $p_server_address . replaceStr($videoAddressUrl, "\\", ""); ?> </td> </tr> <tr> <td>地址:</td> <td> <?php echo $url; ?> 集数: <?php echo filterScriptStar($setname, $p_script); ?> </td> </tr> <?php } } ?> <tr> <td colspan="2"><input name="button" type="button" class="btn" id="button" onClick="window.location.href='javascript:history.go(-1)'" value="上一步"> <input name="Submit" type="submit" class="btn" id="Submit" value="完 成"></td> </tr> </table> </form> <?php }
private function getPicByUrl($url, $rate) { $content = $this->readContent($url); if (isset($content) && !is_null($content)) { $content = getBody($content, AutoDouBanParseScore::PIC_CONTENT_START, AutoDouBanParseScore::PIC_CONTENT_END); $picUrls = getArray($content, AutoDouBanParseScore::PIC_URL_START, AutoDouBanParseScore::PIC_URL_END); $picRates = getArray($content, AutoDouBanParseScore::PIC_RATES_START, AutoDouBanParseScore::PIC_RATES_END); $picUrlsArray = explode("{Array}", $picUrls); $picRatesArray = explode("{Array}", $picRates); $total = count($picUrlsArray); $tempA = array(); for ($i = 0; $i < $total; $i++) { try { $url = $picUrlsArray[$i]; $rateT = $picRatesArray[$i]; $rateT = replaceLine($rateT); $rateA = explode("x", $rateT); // $log=$url .'==='.$rateT ; if (count($rateA) == 2) { $rateR = intval($rateA[1]) / intval($rateA[0]); } // $log=$log .'==='.$rateR ; $rateR = abs($rateR / $rate - 1); // $log=$log .'==='.$rateR ; // var_dump($log ); //比率不能少于80% if ($rateR < 0.2) { $tempA[$rateR . ''] = $url; } } catch (Exception $e) { } } if (count($tempA) > 0) { $tempAKeys = array_keys($tempA); sort($tempAKeys, SORT_NUMERIC); $pic = $tempA[$tempAKeys[0]]; var_dump($tempA); // var_dump($tempAKeys); if (!isN($pic)) { $pic = replaceStr($pic, 'thumb', 'photo'); } if (count($tempAKeys) > 1) { $pic1 = $tempA[$tempAKeys[1]]; if (!isN($pic1)) { $pic1 = replaceStr($pic1, 'thumb', 'photo'); $pic = $pic . '{Array}' . $pic1; } } if (count($tempAKeys) > 2) { $pic1 = $tempA[$tempAKeys[2]]; if (!isN($pic1)) { $pic1 = replaceStr($pic1, 'thumb', 'photo'); $pic = $pic . '{Array}' . $pic1; } } if (count($tempAKeys) > 3) { $pic1 = $tempA[$tempAKeys[3]]; if (!isN($pic1)) { $pic1 = replaceStr($pic1, 'thumb', 'photo'); $pic = $pic . '{Array}' . $pic1; } } if (!isN($pic)) { return $pic; } } } return false; }
<!-- running text --> <!-- end of running text --> <?php } } ?> <div id="content_container"> <div id="content"> <?php getBody($_SESSION[admin], $_GET[component], $_GET[task]); ?> </div> <div class="clear" style="margin-bottom:45px;"></div> </div> <?php //if(isset($_SESSION[admin])) { ?> <div id="footer">Copyright © <a href="#" target="_blank">PT. TRANSPORTASI LINTAS INDONESIA</a>. All Rights Reserved.</div> <?php
<!-- mainContentWrapper --> <div id="mainContentWrapper"> <!-- sidebar --> <?php include 'templates/sidebar.php'; ?> <!-- End sidebar --> <!-- mainContent --> <div id="mainContent"> <?php getBody(); ?> </div> <!-- End mainContent --> <!-- sidebar2 --> <!-- End sidebar2 --> </div><!-- end mainContentWrapper --> <!-- footer --> <?php include 'templates/footer.php';
?> </div> <div> <form method="POST" action="?example=<?php echo $example; ?> " > <?php if ($example) { $inputSource = new ymcHtmlFormInputSourceFilterExtension(INPUT_POST); $form = getForm(); $form->init(); if ($inputSource->hasData()) { $form->validate($inputSource); } echo getBody($example, $form); } ?> <input type="submit" value="submit" /> </form> </div> <div> <h1>$_POST</h1> <?php var_dump($_POST); ?> <h1>parse form</h1> <?php if ($example) { echo 'is valid: '; var_dump($form->isValid());
function cjView($strlink, $num) { global $starringarr, $titlearr, $picarr, $strListUrl, $p_playspecialtype, $p_playtype, $p_videocodeType, $p_videocodeApiUrl, $p_id, $p_videocodeApiUrlParamstart, $p_videocodeApiUrlParamend, $p_videourlstart, $p_videourlend, $playcodeApiUrl, $playcodeApiUrlParamstart, $p_playcodeApiUrlParamend, $playcodeApiUrltype, $db, $strListUrl, $p_titletype, $starringarr, $titlearr, $picarr, $p_id, $p_titlestart, $p_titleend, $p_lzstart, $p_lzend, $p_hitsstart, $p_hitsend, $p_starringtype, $p_starringstart, $p_starringend, $p_picstart, $p_picend, $p_typestart, $p_typeend, $p_pictype, $p_classtype, $p_collect_type, $p_timestart, $p_timeend, $p_areastart, $p_areaend, $p_contentstart, $p_contentend, $p_playcodestart, $p_playcodeend, $p_playlinkstart, $p_playlinkend, $p_playurlstart, $p_playurlend, $p_playcodetype, $p_playlinktype, $p_playtype, $p_coding, $p_lzstart, $p_lzend, $p_lzcodetype, $p_lzcodestart, $p_lzcodeend, $p_languagestart, $p_languageend, $p_remarksstart, $p_remarksend, $p_script, $p_showtype, $p_savefiles, $strdstate, $p_server, $p_setnametype, $p_setnamestart, $p_setnameend, $p_directedstart, $p_directedend, $cache; $androidUrl = ""; //var_dump($strlink);var_dump($strListUrl); try { $pos = strpos($strlink, "href=\""); if ($pos !== false) { $strlink = substr($strlink, $pos + 6); } $pos = strpos($strlink, "\""); if ($pos !== false) { $strlink = substr($strlink, 0, $pos); } } catch (Exception $e) { } $strlink = definiteUrl($strlink, $strListUrl); writetofile("crawel_auto_info.log", $p_id . '{=====}' . $strlink . "{=====}View===start"); $strViewCode = getPage($strlink, $p_coding); if ($strViewCode == false) { $strdstate = "true"; writetofile("crawel_auto_error.log", $p_id . '{=====}' . $strlink . '{=====}' . $strListUrl); $sb = $sb + 1; return; } else { //节目名称,来自列表或者来自内容页 if ($p_titletype == 1) { $titlecode = $titlearr[$num]; } else { $titlecode = getBody($strViewCode, $p_titlestart, $p_titleend); } // var_dump($titlearr[$num]); $titlecode = filterScript($titlecode, $p_script); $titlecode = replaceFilters($titlecode, $p_id, 1, 0); $titlecode = replaceStr(replaceStr(replaceStr($titlecode, ",", " "), "'", ""), "\"\"", ""); $titlecode = trim($titlecode); // $sql="select count(*) as cc from {pre}cj_vod where m_name='".$titlecode."' and m_playfrom='".$p_playtype."'"; // $row=$db->getOne($sql); // //var_dump($row);var_dump($titlecode); // $rowcount = $row; //先缩小范围 if ($p_lzcodetype == 1) { //连载范围 $lzfwcode = getBody($strViewCode, $p_lzcodestart, $p_lzcodeend); //连载编码 $lzcode = getBody($lzfwcode, $p_lzstart, $p_lzend); $lzcode = replaceStr($lzcode, "false", "0"); $lzcode = trim($lzcode); $lzcode = intval($lzcode); } else { $lzcode = getBody($strViewCode, $p_lzstart, $p_lzend); $lzcode = replaceStr($lzcode, "false", "0"); $lzcode = trim($lzcode); $lzcode = intval($lzcode); } // if ($p_playcodetype !=2 &&($lzcode == 0) && ($rowcount>0)) { // $strdstate = "true"; // echo "<tr><td colspan=\"2\">遇到重复电影数据跳过采集!</TD></TR>"; // return; // } if (isN($p_hitsstart) || !isnum($p_hitsstart)) { $p_hitsstart = 0; } if (isN($p_hitsend) || !isnum($p_hitsend)) { $p_hitsend = 0; } if ($p_hitsstart == 0 && $p_hitsend == 0) { $m_hits = 0; } else { $m_hits = rand($p_hitsend, $p_hitsstart); } if ($p_starringtype == 1) { $starringcode = $starringarr[$num]; } else { $starringcode = getBody($strViewCode, $p_starringstart, $p_starringend); } //演员 $starringcode = filterScriptStar($starringcode, $p_script); $starringcode = replaceStr(replaceStr(replaceStr($starringcode, ",", " "), "'", ""), "\"\"", ""); $starringcode = trim($starringcode); if ($p_pictype == 1) { $piccode = $picarr[$num]; } else { $piccode = getBody($strViewCode, $p_picstart, $p_picend); } //图片 $piccode = trim($piccode); $piccode = getHrefFromImg(definiteUrl($piccode, $strListUrl)); //栏目设置 if ($p_classtype == 1) { $typecode = filterScript(getBody($strViewCode, $p_typestart, $p_typeend), $p_script); $typecode = trim($typecode); $m_typeid = changeId($typecode, $p_id, 0, 0); } else { $typecode = $p_collect_type; $typecode = trim($typecode); $m_typeid = $p_collect_type; $typearr = getValueByArray($cache[0], "t_id", $typecode); $typecode = $typearr["t_name"]; } if ($m_typeid == 0) { $m_typeid = $p_collect_type; } $typecode = filterScript($typecode, $p_script); //导演 $directedcode = filterScriptStar(getBody($strViewCode, $p_directedstart, $p_directedend), $p_script); $directedcode = replaceStr($directedcode, "false", ""); $directedcode = replaceStr($directedcode, "'", ""); $directedcode = trim($directedcode); //备注 $remarkscode = filterScript(getBody($strViewCode, $p_remarksstart, $p_remarksend), $p_script); $remarkscode = replaceStr($remarkscode, "false", ""); $remarkscode = trim($remarkscode); //语音 $languagecode = filterScript(getBody($strViewCode, $p_languagestart, $p_languageend), $p_script); $languagecode = replaceStr($languagecode, "false", "未知"); $languagecode = trim($languagecode); //时间 $timecode = filterScript(getBody($strViewCode, $p_timestart, $p_timeend), $p_script); if ($timecode == false) { $timecode == "未知"; } $timecode = trim($timecode); //地区 $areacode = filterScript(getBody($strViewCode, $p_areastart, $p_areaend), $p_script); if ($areacode == false) { $areacode = "未知"; } $areacode = trim($areacode); //内容 $contentcode = filterScript(getBody($strViewCode, $p_contentstart, $p_contentend), $p_script); if ($contentcode == false) { $contentcode = "未知"; } $contentcode = filterScript(replaceFilters($contentcode, $p_id, 2, 0), $p_script); $contentcode = replaceStr(replaceStr(replaceStr($contentcode, ",", " "), "'", ""), "\"\"", ""); $contentcode = trim($contentcode); $m_area = $areacode; $m_languageid = $languagecode; //播放列表,缩小 if ($p_playcodetype == 1) { $playcode = getBody($strViewCode, $p_playcodestart, $p_playcodeend); //获取地址设置 if ($p_playlinktype > 0) { //播放链接 $weburl = getArray($playcode, $p_playlinkstart, $p_playlinkend); } else { //内容页直接获取地址, 地址开始 $weburl = getArray($playcode, $p_playurlstart, $p_playurlend); } if ($p_setnametype == 3) { $setnames = getArray($playcode, $p_setnamestart, $p_setnameend); } } else { if ($p_playcodetype == 2) { //from api // writetofile("d:\\s.txt",$linkcode) ; // echo $p_playcodeApiUrlParamend .'=='.$playcodeApiUrlParamstart; // echo $playcodeApiUrlParamstart .'\n' .$p_playcodeApiUrlParamend .' = '.$playcodeApiUrltype; if ($playcodeApiUrltype == 0) { $paracode = getBody($strViewCode, $playcodeApiUrlParamstart, $p_playcodeApiUrlParamend); } else { $paracode = getBody($UrlTestMoive, $playcodeApiUrlParamstart, $p_playcodeApiUrlParamend); } // echo $paracode; $p_apibatchurl = replaceStr($playcodeApiUrl, "{PROD_ID}", $paracode); $p_apibatchurls = replaceStr($p_apibatchurl, "{PAGE_NO}", 1); $playcode = getFormatPage($p_apibatchurls, $p_coding); $weburl = getArray($playcode, $p_playlinkstart, $p_playlinkend); $page_num = 2; // echo "page 1 :".$weburl .'\n'; $flag = true; while ($flag && $page_num < 15 && strpos($playcodeApiUrl, "{PAGE_NO}") !== false) { $p_apibatchurls = replaceStr($p_apibatchurl, "{PAGE_NO}", $page_num); // echo $p_apibatchurls .'\n'; $playcode = getFormatPage($p_apibatchurls, $p_coding); $weburls = getArray($playcode, $p_playlinkstart, $p_playlinkend); // echo "page ".$page_num." :".$weburls .'\n'; if ($weburls) { $weburl = $weburl . "{Array}" . $weburls; $page_num = $page_num + 1; } else { $flag = false; } } // var_dump($weburl); // if ($p_playlinktype >0) { // $weburl = getArray($playcode,$p_playlinkstart,$p_playlinkend); // } // else{ // $weburl = getArray($playcode,$p_playurlstart,$p_playurlend); // // var_dump($playcode); // } // if ($p_setnametype == 3) { // $setnames = getArray($playcode,$p_setnamestart,$p_setnameend); // } } else { if ($p_playlinktype > 0) { $weburl = getArray($strViewCode, $p_playlinkstart, $p_playlinkend); // var_dump($weburl); } else { $weburl = getArray($strViewCode, $p_playurlstart, $p_playurlend); $androidUrl = ContentProviderFactory::getContentProvider($p_playtype)->parseAndroidVideoUrlByContent($strViewCode, $p_coding, $p_script); $videoAddressUrl = ContentProviderFactory::getContentProvider($p_playtype)->parseIOSVideoUrlByContent($strViewCode, $p_coding, $p_script); writetofile("android_log.txt", $strlink . '{===}' . $androidUrl . '{===}' . $videoAddressUrl); } if ($p_setnametype == 3) { $setnames = getArray($strViewCode, $p_setnamestart, $p_setnameend); } } } if ($p_showtype == 1) { if ($p_savefiles == 1) { $filename = time() . $num; if (strpos($piccode, ".jpg") || strpos($piccode, ".bmp") || strpos($piccode, ".png") || strpos($piccode, ".gif")) { $extName = substring($piccode, 4, strlen($piccode) - 4); } else { $extName = ".jpg"; } $picpath = "upload/vod/" . getSavePicPath() . "/"; $picfile = $filename . $extName; //echo "<tr><td width=\"20%\" >自动下载图片:</td><td><iframe border=\"0\" valign=\"bottom\" vspace=\"0\" hspace=\"0\" marginwidth=\"0\" marginheight=\"0\" framespacing=\"0\" frameborder=\"0\" scrolling=\"no\" width=\"400\" height=\"15\" src=\"../admin_pic.php?action=downpic&wjs=1&path=../".$picpath."&file=".$picfile."&url=".$piccode."\"></iframe></td></tr>"; $piccode = $picpath . $picfile; } } else { // echo "<tr><td colspan=\"2\" align=\"center\">第".($num+1)."条数据采集结果</td></tr><tr><td width=\"20%\" >来源:</td><td >".$strlink."</td></tr><tr><td width=\"20%\" >名称:</td><td >".$titlecode." 连载:".$lzcode." 备注:".$remarkscode."</td></tr>"; } if ($weburl == false) { // echo "<tr><td colspan=\"2\">在获取播放列表链接时出错 ".$strlink." / '.$strListUrl.'</TD></TR>"; writetofile("crawel_auto_error.log", $p_id . '{=====}' . $strlink . '{=====}' . $strListUrl); // $sb=$sb+1; return; } else { $sql = "select m_id,m_name,m_type,m_area,m_playfrom,m_starring,m_directed,m_pic,m_content,m_year,m_addtime,m_urltest,m_zt,m_pid,m_typeid,m_hits,m_playserver,m_state from {pre}cj_vod where m_pid='" . $p_id . "' and m_name='" . $titlecode . "' order by m_id desc"; $rowvod = $db->getRow($sql); if ($rowvod) { $cg = $cg + 1; $movieid = $rowvod["m_id"]; if (isN($titlecode)) { $titlecode = $rowvod["m_name"]; } if (isN($starringcode)) { $starringcode = $rowvod["m_starring"]; } if (isN($piccode)) { $piccode = $rowvod["m_pic"]; } $sql = "update {pre}cj_vod set m_pic='" . $piccode . "', m_type='" . $typecode . "',m_area='" . $areacode . "',m_urltest='" . $strlink . "',m_name='" . $titlecode . "',m_starring='" . $starringcode . "',m_directed='" . $directedcode . "',m_year='" . $timecode . "',m_playfrom='" . $p_playtype . "',m_content='" . $contentcode . "',m_addtime='" . date('Y-m-d H:i:s', time()) . "',m_zt='0',m_pid='" . $p_id . "',m_typeid='" . $m_typeid . "',m_playserver='" . $p_server . "',m_state='" . $lzcode . "',m_language='" . $languagecode . "',m_remarks='" . $remarkscode . "' where m_id=" . $rowvod["m_id"]; writetofile("sql.txt", $sql); $db->query($sql); // $sql="delete from {pre}cj_vod_url where u_movieid=".$rowvod["m_id"]; // writetofile("sql.txt", $sql); // $db->query($sql); } else { $cg = $cg + 1; $sql = "insert {pre}cj_vod (m_name,m_type,m_area,m_playfrom,m_starring,m_directed,m_pic,m_content,m_year,m_urltest,m_zt,m_pid,m_typeid,m_hits,m_playserver,m_state,m_addtime,m_language,m_remarks) values('" . $titlecode . "','" . $typecode . "','" . $areacode . "','" . $p_playtype . "','" . $starringcode . "','" . $directedcode . "','" . $piccode . "','" . $contentcode . "','" . $timecode . "','" . $strlink . "','0','" . $p_id . "','" . $m_typeid . "','" . $m_hits . "','" . $p_server . "','" . $lzcode . "','" . date('Y-m-d H:i:s', time()) . "','" . $languagecode . "','" . $remarkscode . "')"; writetofile("sql.txt", $sql); $db->query($sql); $movieid = $db->insert_id(); } $webArray = explode("{Array}", $weburl); $setnamesArray = explode("{Array}", $setnames); $webArraTemp = array(); $index = 0; $webUrls = ''; for ($i = 0; $i < count($webArray); $i++) { $UrlTemp = $webArray[$i]; if (strpos($webUrls, $UrlTemp . '<array>') === false) { $webArraTemp[$index] = $UrlTemp; $webUrls = $webUrls . $UrlTemp . '<array>'; $index++; } } // writetofile("d:\\ssssss.txt","p_videocodeType:".$p_videocodeType); $webArray = $webArraTemp; //http://www.youku.com/show_episode/id_zc16d0492e81411e196ac.html?dt=json&divid=reload_1&__rt=1&__ro=reload_1 for ($i = 0; $i < count($webArray); $i++) { $WebTestx = $webArray[$i]; if ($p_playspecialtype == 1 && strpos("," . $p_playspecialrrul, "[变量]")) { $Keyurl = explode("[变量]", $p_playspecialrrul); $urli = getBody($UrlTest, $Keyurl[0], $Keyurl[1]); if ($urli == false) { break; } $WebTestx = replaceStr($p_playspecialrerul, "[变量]", $urli); } if ($p_playspecialtype == 2) { $urArray = explode("/", $strlink); $ur = ""; for ($k = 0; $k < count($urArray) - 1; $k++) { $ur = $ur . $urArray[$k] . "/"; } $WebTestx = $ur . $WebTestx . ".html"; } writetofile("crawel_auto_info.log", $p_id . '{=====}' . $WebTestx . "{=====}ViewList===start"); if ($p_playlinktype == 1) { //播放页获取地址 $WebTestx = getHrefFromLink($WebTestx); $WebTestx = definiteUrl($WebTestx, $strListUrl); $playCode = getPage($WebTestx, $p_coding); $androidUrl = ContentProviderFactory::getContentProvider($p_playtype)->parseAndroidVideoUrlByContent($playCode, $p_coding, $p_script); $videoAddressUrl = ContentProviderFactory::getContentProvider($p_playtype)->parseIOSVideoUrlByContent($playCode, $p_coding, $p_script); writetofile("android_log.txt", $strlink . '{===}' . $androidUrl . '{===}' . $videoAddressUrl); $url = getBody($playCode, $p_playurlstart, $p_playurlend); $url = replaceLine($url); } else { if ($p_playlinktype == 2) { //播放链接中获取地址 $WebTestx = getHrefFromLink($WebTestx); if (isN($p_playurlend)) { $tmpA = strpos($WebTestx, $p_playurlstart); $url = substr($WebTestx, strlen($WebTestx) - $tmpA - strlen($p_playurlstart) + 1); } else { $url = getBody($WebTestx, $p_playurlstart, $p_playurlend); } } else { if ($p_playlinktype == 3) { //单播放页获取所有播放地址 $WebTestx = getHrefFromLink($WebTestx); $playCode = getPage($WebTestx, $p_coding); $tmpB = getArray($webCode, $p_playurlstart, $p_playurlend); $tmpC = explode("{$Array}\$", $tmpB); foreach ($tmpC as $tmpD) { $sql = "SELECT {pre}vod_url.u_url FROM ({pre}vod_url INNER JOIN {pre}vod ON {pre}vod_url.u_movieid = {pre}vod.m_id) where {pre}vod_url.u_url='" . $tmpD . "' and {pre}vod.m_pid=" . $p_id; $row = $db->getRow($sql); if (!$row) { $strTempUrl = $strTempUrl . $tmpD . "<br>"; $db->query("insert into {pre}vod_url(u_url,u_movieid) values('" . $tmpD . "','" . $movieid . "')"); } } break; } else { $url = $WebTestx; $url = replaceLine($url); } } } $url = replaceFilters($url, $p_id, 3, 0); if ($p_setnametype == 1) { $setname = getBody($url, $p_setnamestart, $p_setnameend); // $url = $setname . "$" . $url; } else { if ($p_setnametype == 2 && $p_playlinktype == 1) { $setname = getBody($playCode, $p_setnamestart, $p_setnameend); // $url = $setname ."$" .$url; } else { if ($p_setnametype == 3) { $setname = $setnamesArray[$i]; } } } $sql = "SELECT {pre}cj_vod_url.u_url FROM ({pre}cj_vod_url INNER JOIN {pre}cj_vod ON {pre}cj_vod_url.u_movieid = {pre}cj_vod.m_id) where {pre}cj_vod_url.u_url='" . $url . "' and {pre}cj_vod.m_pid=" . $p_id . " and {pre}cj_vod.m_id=" . $movieid; $rowurl = $db->getRow($sql); // writetofile("d:\\sql.txt",$rowurl); if (!$rowurl) { if ($p_playlinktype == 1) { $strTempUrl .= $url . "<br>"; $url = replaceStr($url, "'", "''"); writetofile("sql.txt", "insert into {pre}cj_vod_url(u_url,u_movieid,u_weburl,iso_video_url,name,android_vedio_url) values('" . $url . "','" . $movieid . "','" . getHrefFromLink($WebTestx) . "','" . getHrefFromLink($videoAddressUrl) . "','" . filterScriptStar($setname, $p_script) . "' ,'" . $androidUrl . "' )"); $db->query("insert into {pre}cj_vod_url(u_url,u_movieid,u_weburl,iso_video_url,name,android_vedio_url) values('" . $url . "','" . $movieid . "','" . getHrefFromLink($WebTestx) . "','" . getHrefFromLink($videoAddressUrl) . "','" . filterScriptStar($setname, $p_script) . "' ,'" . $androidUrl . "' )"); } else { $strTempUrl .= $url . "<br>"; writetofile("sql.txt", "insert into {pre}cj_vod_url(u_url,u_movieid,iso_video_url,u_weburl,android_vedio_url) values('" . $url . "','" . $movieid . "','" . getHrefFromLink($videoAddressUrl) . "','" . getHrefFromLink($strlink) . "', '" . $androidUrl . "')"); $db->query("insert into {pre}cj_vod_url(u_url,u_movieid,iso_video_url,u_weburl,android_vedio_url) values('" . $url . "','" . $movieid . "','" . getHrefFromLink($videoAddressUrl) . "','" . getHrefFromLink($strlink) . "', '" . $androidUrl . "')"); } } } } } $cg = $cg + 1; }
function parseChannel($area, $url, $stationname) { global $db; $contents = getPage($url, ""); $content = getBody($contents, '<div class="listmenu2" >', '<div class="listmenu" >'); if ($content === false || isN($content)) { $content = getBodys($contents, '<div class="listmenu2" >'); } // var_dump($content); $codes = getArray($content, "/program/", '</a>'); // $codesArray = explode("{Array}", $codes); ////http://epg.tvsou.com/program/ $channels = array(); $currentStation = getBody($content, '<font color="#FF6600">', '</font>'); $channels[$area . '{Array}' . $stationname . '{Array}' . $currentStation] = $url; foreach ($codesArray as $code) { $ste = explode('"class=blue2>', $code); if (!isN($ste[1])) { $channels[$area . '{Array}' . $stationname . '{Array}' . $ste[1]] = 'http://epg.tvsou.com/program/' . $ste[0]; } } //var_dump($channels); return $channels; }
static function parseListByContent($content, $p_code, $type) { $contentSt = "{" . getBody($content, NBaidu::contentparmListStart, NBaidu::contentparaListend) . '}'; $content = json_decode($contentSt); if (is_object($content) && property_exists($content, 'videoshow') && property_exists($content->videoshow, 'videos')) { $videos = $content->videoshow->videos; if (is_array($videos)) { $linkarr = array(); $starringarrcode = array(); $titlearrcode = array(); $picarrcode = array(); $areaarrcode = array(); $typearrcode = array(); $yeararrcode = array(); $idarrcode = array(); $finisharrcode = array(); $introarrcode = array(); $directorcode = array(); $durationcode = array(); foreach ($videos as $video) { if (property_exists($video, 'url')) { $linkarr[] = $video->url; } else { continue; } if (property_exists($video, 'title')) { $titlearrcode[] = $video->title; } else { $titlearrcode[] = ''; } if (property_exists($video, 'date')) { $yeararrcode[] = $video->date; } else { $yeararrcode[] = ''; } if (property_exists($video, 'intro')) { $introarrcode[] = $video->intro; } else { $introarrcode[] = ''; } if (property_exists($video, 'finish')) { $finisharrcode[] = $video->finish; } else { $finisharrcode[] = ''; } if (property_exists($video, 'duration')) { $durationcode[] = $video->duration; } else { $durationcode[] = ''; } if (property_exists($video, 'actor')) { $starringarrcode[] = NBaidu::parseArrayObjectToString($video->actor, 'name'); } else { $starringarrcode[] = ''; } if (property_exists($video, 'director')) { $directorcode[] = NBaidu::parseArrayObjectToString($video->director, 'name'); } else { $directorcode[] = ''; } if (property_exists($video, 'area')) { $areaarrcode[] = NBaidu::parseArrayObjectToString($video->area, 'name'); } else { $areaarrcode[] = ''; } if (property_exists($video, 'type')) { $typearrcode[] = NBaidu::parseArrayObjectToString($video->type, 'name'); } else { $typearrcode[] = ''; } if (property_exists($video, 'id')) { $idarrcode[] = $video->id; } else { $idarrcode[] = ''; } } return array('idarr' => $idarrcode, 'linkarr' => $linkarr, 'typearr' => $typearrcode, 'areaarr' => $areaarrcode, 'starringarr' => $starringarrcode, 'yeararr' => $yeararrcode, 'titlearr' => $titlearrcode, 'picarr' => $picarrcode, 'finisharr' => $finisharrcode, 'introarr' => $introarrcode, 'directorarr' => $directorcode, 'durationarr' => $durationcode); } } }