/**
  * 影片重名检测
  * @param  int $len
  * @return array
  */
 function RepeatCheck($Get)
 {
     $len = $Get['len'];
     //先查询$len内不同影片的title
     $arr = $this->VideoDB->field('title')->Group("Left(title,{$len})")->Having('count(*)>1')->select();
     foreach ($arr as $key => $val) {
         $arrTitle[] .= $val['title'];
     }
     //$where['status']=array('neq',-1);
     $where = $this->SearchCon($Get);
     $where["left(title, {$len})"] = array('in', $arrTitle);
     $video_count = $this->VideoDB->where($where)->count('id');
     $video_page = !empty($_GET['p']) ? intval($_GET['p']) : 1;
     $video_page = get_cms_page_max($video_count, C('web_admin_pagenum'), $video_page);
     $video_url = U('Admin-Datacheck/VideoCheck', array('check_sub' => 'ok', 'len' => urlencode($len), 'p' => ''), false, false);
     $pagelist = get_cms_page($video_count, C('web_admin_pagenum'), $video_page, $video_url, '部影片');
     $_SESSION['video_repurl'] = $video_url . $video_page;
     //order by
     $video['type'] = !empty($_GET['type']) ? $_GET['type'] : 'title';
     $video['order'] = !empty($_GET['order']) ? $_GET['order'] : 'desc';
     $order = $video["type"] . ' ' . $video['order'];
     $VResult = $this->VideoDB->field('id,title,cid,serial,addtime,hits,stars,status,picurl')->where($where)->order($order)->limit(C('web_admin_pagenum'))->page($video_page)->select();
     foreach ($VResult as $key => $val) {
         $VResult[$key]['cname'] = get_channel_name($VResult[$key]['cid']);
         $VResult[$key]['channelurl'] = U('Admin-Video/Show', array('cid' => $VResult[$key]['cid']), false, false);
         $VResult[$key]['videourl'] = get_read_url('video', $VResult[$key]['id'], $VResult[$key]['cid']);
         $VResult[$key]['stararr'] = get_star_arr($VResult[$key]['stars']);
     }
     return array('vresult' => $VResult, 'pagelist' => $pagelist, 'len' => $len, 'order' => $order, 'cid' => $Get['cid']);
 }
 public function xmlmdb($xml)
 {
     $collect = D('Xmlzy');
     $array_url = $xml['url'];
     $array_tpl = $xml['tpl'];
     $xml_page = $xml['page'];
     $list_class = $xml['listclass'];
     $list_vod = $xml['listvod'];
     //是否采集入库
     if ($array_url['action']) {
         $page = $array_url['page'];
         echo '<style type="text/css">div{font-size:12px;color: #333333;margin:6px;}span{font-weight:bold;color:#FF0000}</style>';
         echo '<div id="show"><div>当前采集任务<font color=green><strong>' . $page . '</strong></font>/<span class="green">' . $xml_page['pagecount'] . '</span>页,本页共需要采集数据<span>' . $xml_page['pagesize'] . '</span>个 ' . $array_tpl['httpurl'] . '</div>';
         foreach ($list_vod as $key => $vod) {
             $vod['addtime'] = time();
             $vod['stars'] = 1;
             $vod['letter'] = get_letter($vod['title']);
             $vod['hits'] = mt_rand(0, C('web_admin_hits'));
             $vod['score'] = mt_rand(1, C('web_admin_score'));
             $vod['scoreer'] = mt_rand(1, C('web_admin_score'));
             $vod['up'] = mt_rand(1, C('web_admin_updown'));
             $vod['down'] = mt_rand(1, C('web_admin_updown'));
             $vod['inputer'] = 'collect_' . $array_url['fid'];
             //地址入库
             echo '<div><span>' . ($key + 1) . '</span> [' . get_channel_name($vod['cid']) . '] ' . $vod['title'] . ' <font color=blue>';
             echo $collect->xml_insert($vod, $array_url['pic']);
             echo '</font></div>';
             ob_flush();
             flush();
         }
         if ('all' == $array_url['action'] || 'day' == $array_url['action']) {
             if ($page < $xml_page['pagecount']) {
                 $jumpurl = str_replace('{!page!}', $page + 1, $array_tpl['pageurl']);
                 //缓存断点续采
                 F('_collect/xucai', $jumpurl);
                 //跳转到下一页
                 echo '<div><span>' . C('url_create_time') . '</span>秒后将自动采集下一页!<meta http-equiv="refresh" content=' . C('url_create_time') . ';url=' . $jumpurl . '></div>';
             } else {
                 //清除断点续采
                 F('_collect/xucai', NULL);
                 echo '<div>所有采集任务已经完成,返回<a href="?s=Admin/Video/Show">[视频管理中心</a>],查看<a href="?s=Admin/Video/Show/status/-1">[相似未审核的影片</a>]!</div>';
             }
         } else {
             echo '<div>所有采集任务已经完成,返回<a href="?s=Admin/Video/Show">[视频管理中心</a>],查看<a href="?s=Admin/Video/Show/status/-1">[相似未审核的影片</a>]!</div>';
         }
     } else {
         $array_url['vodids'] = '';
         $this->assign($array_url);
         $this->assign($array_tpl);
         $this->assign('list_class', $list_class);
         $this->assign('list_vod', $list_vod);
         $this->display('./views/admin/collect_show.html');
     }
 }
Esempio n. 3
0
 public function xmlmdb($xml)
 {
     $cai = D('Cai');
     $array_url = $xml['url'];
     $array_tpl = $xml['tpl'];
     $xml_page = $xml['page'];
     $list_class = $xml['listclass'];
     $list_vod = $xml['listvod'];
     //是否采集入库
     if ($array_url['action']) {
         $page = $array_url['page'];
         echo '<style type="text/css">div{font-size:12px;color: #333333}span{font-weight:bold;color:#FF0000}</style>';
         echo '<div id="show"><div>当前采集任务<strong class="green">' . $page . '</strong>/<span class="green">' . $xml_page['pagecount'] . '</span>页,共需要采集数据<span>' . $xml_page['recordcount'] . '</span>个</div>';
         //print_r($list_vod);
         //	exit('c');
         //echo 'a'
         foreach ($list_vod as $key => $vod) {
             //判断地址入库
             $vod['vod_inputer'] = 'xml_' . $array_url['fid'];
             $vod_play = explode('$$$', $vod['vod_play']);
             $vod_url = explode('$$$', $vod['vod_url']);
             echo '<div style="line-height:22px"><span>' . (($page - 1) * $xml_page['pagesize'] + $key + 1) . '</span> [' . get_channel_name($vod['vod_cid']) . '] ' . $vod['vod_name'] . ' 需采集<span>' . count($vod_play) . '</span>组播放地址 <font color=green>';
             foreach ($vod_play as $ii => $value) {
                 $vod['vod_play'] = $value;
                 $vod['vod_url'] = trim($vod_url[$ii]);
                 echo $cai->xml_insert($vod, $array_url['pic']);
             }
             echo '</font></div>';
             ob_flush();
             flush();
         }
         if ('all' == $array_url['action'] || 'day' == $array_url['action']) {
             if ($page < $xml_page['pagecount']) {
                 $jumpurl = str_replace('{!page!}', $page + 1, $array_tpl['pageurl']);
                 //缓存断点续采
                 F('_xml/xucai', $jumpurl);
                 //跳转到下一页
                 echo C('url_create_time') . '秒后将自动采集下一页!';
                 echo '<meta http-equiv="refresh" content=' . C('url_create_time') . ';url=' . $jumpurl . '>';
             } else {
                 //清除断点续采
                 F('_xml/xucai', NULL);
                 echo '<div>所有采集任务已经完成,返回[<a href="?s=Admin/Video/Show">视频管理中心</a>],查看[<a href="?s=Admin/Video/Show/vod_cid/0">相似未入库影片</a>]!</div>';
             }
         }
     } else {
         $array_url['vodids'] = '';
         $this->assign($array_url);
         $this->assign($array_tpl);
         $this->assign('list_class', $list_class);
         $this->assign('list_vod', $list_vod);
         $this->display('views/admin/xml_show.html');
     }
 }
Esempio n. 4
0
 public function show()
 {
     $where = array();
     $cid = $_REQUEST['cid'];
     $keyword = urldecode(trim($_REQUEST['keyword']));
     if ($cid) {
         if (get_channel_son($cid)) {
             $where['cid'] = $cid;
         } else {
             $where['cid'] = get_channel_sqlin($cid);
         }
     }
     if ($keyword) {
         $search['title'] = array('like', '%' . $keyword . '%');
         $map = $search;
         $map['_logic'] = 'or';
         $where['_complex'] = $map;
     }
     $info['type'] = !empty($_GET['type']) ? $_GET['type'] : C('web_admin_ordertype');
     $info['order'] = !empty($_GET['order']) ? $_GET['order'] : 'desc';
     $order = $info["type"] . ' ' . $info['order'];
     //分页开始
     $news_count = $this->InfoDB->where($where)->count('id');
     $news_page = !empty($_GET['p']) ? intval($_GET['p']) : 1;
     $news_page = get_cms_page_max($news_count, C('web_admin_pagenum'), $news_page);
     $news_url = U('Admin-Info/Show', array('cid' => $cid, 'type' => $info['type'], 'order' => $info['order'], 'keyword' => urlencode($keyword), 'p' => ''), false, false);
     $listpages = get_cms_page($news_count, C('web_admin_pagenum'), $news_page, $news_url, '条文章');
     $_SESSION['info_reurl'] = $news_url . $news_page;
     //查询数据
     $list = $this->InfoDB->where($where)->order($order)->limit(C('web_admin_pagenum'))->page($news_page)->select();
     if (empty($list)) {
         if ($cid || $keyword) {
             $this->assign("jumpUrl", C('cms_admin') . '?s=Admin/Info/Show');
             $this->error('没有查询到您所筛选的文章资讯,请重新选择条件!');
         } else {
             $this->assign("jumpUrl", C('cms_admin') . '?s=Admin/Info/Add');
             $this->error('还没有任何资讯,请先添加!');
         }
     }
     foreach ($list as $key => $val) {
         $list[$key]['cname'] = get_channel_name($list[$key]['cid']);
         $list[$key]['channelurl'] = U('Admin-Info/Show', array('cid' => $list[$key]['cid']), false, false);
         $list[$key]['infourl'] = get_read_url('info', $list[$key]['id'], $list[$key]['cid'], $list[$key]['jumpurl']);
         $list[$key]['stararr'] = get_star_arr($list[$key]['stars']);
     }
     $this->assign($listpages);
     $this->assign('order', $order);
     $this->assign('cid', $cid);
     $this->assign('keyword', $keyword);
     $this->assign('list_channel_info', F('_gxcms/channelinfo'));
     $this->assign('list_info', $list);
     $this->display('views/admin/info_show.html');
 }
 public function delall()
 {
     if (empty($_POST['ids'])) {
         $this->error('请选择需要删除的栏目!');
     }
     $array = $_POST;
     foreach ($array['ids'] as $value) {
         $id = intval($value);
         $mid = get_channel_name($id, 'mid');
         if (!get_channel_son($id)) {
             $this->error("请先删除本类下面的子栏目!");
         }
         $this->ChannelDB->where('id = ' . $id)->delete();
         $this->deldata($mid, $id);
     }
     $this->create_channel();
     $this->success('批量删除栏目成功!');
 }
Esempio n. 6
0
 public function create_channel()
 {
     $rs = D("Admin.Channel");
     $where['status'] = array('eq', 1);
     $list = $rs->where($where)->order('oid asc')->select();
     foreach ($list as $key => $val) {
         if ($list[$key]['mid'] == 9) {
             $list[$key]['showurl'] = $list[$key]['cwebsite'];
             $list[$key]['showurl_p'] = $list[$key]['cwebsite'];
         } else {
             $list[$key]['showurl'] = str_replace('{!page!}', 1, get_show_url(get_model_name($list[$key]['mid']), array('id' => $list[$key]['id']), 1));
             $list[$key]['showurl_p'] = str_replace('{!page!}', 1, get_show_url(get_model_name($list[$key]['mid']), array('id' => $list[$key]['pid']), 1));
             $list[$key]['cname_p'] = get_channel_name($list[$key]['pid']);
             $list[$key]['limit'] = get_tpl_limit('<gxlist(.*)limit="([0-9]+)"(.*)>', $list[$key]['ctpl']);
         }
     }
     //全部列表二级结构缓存
     F('_gxcms/channeltree', list_to_tree($list, 'id', 'pid', 'son', 0));
     //缓存搜索每页信息
     $list[999]['video'] = get_tpl_limit('<gxsearch(.*)limit="([0-9]+)"(.*)>', 'video_search');
     //缓存影视搜索分页数据
     $list[999]['info'] = get_tpl_limit('<gxsearch(.*)limit="([0-9]+)"(.*)>', 'info_search');
     //缓存新闻搜索分页数据
     $list[999]['special'] = get_tpl_limit('<gxlist(.*)limit="([0-9]+)"(.*)>', 'special_list');
     //缓存专题分页数据
     //全部列表缓存
     F('_gxcms/channel', $list);
     //影视列表缓存
     $where['mid'] = array('EQ', 1);
     $list = $rs->where($where)->order('oid asc')->select();
     F('_gxcms/channelvideo', list_to_tree($list, 'id', 'pid', 'son', 0));
     //文章列表缓存
     $where['mid'] = array('EQ', 2);
     $list = $rs->where($where)->order('oid asc')->select();
     F('_gxcms/channelinfo', list_to_tree($list, 'id', 'pid', 'son', 0));
 }
Esempio n. 7
0
function get_tag_gxsearch($tag)
{
    $table = !empty($tag['name']) ? trim($tag['name']) : 'video';
    $field = !empty($tag['field']) ? trim($tag['field']) : '*';
    $limit = !empty($tag['limit']) ? trim($tag['limit']) : '10';
    $order = !empty($tag['order']) ? trim($tag['order']) . ' desc' : 'addtime desc';
    //从动态配置文件取值;
    $page = C('bdsearch_page');
    $where = C('bdsearch_where');
    $rs = M($table);
    $list = $rs->field($field)->where($where)->limit($limit)->page($page)->order($order)->select();
    if (empty($list)) {
        C($table . 'empty', true);
    }
    foreach ($list as $key => $val) {
        $list[$key]['showname'] = get_channel_name($list[$key]['cid']);
        $list[$key]['showurl'] = get_show_url($table, array('id' => $list[$key]['cid']), 1);
        $list[$key]['readurl'] = get_read_url($table, $list[$key]['id'], $list[$key]['cid'], $list[$key]['jumpurl']);
        $list[$key]['playerurl'] = get_play_url($list[$key]['id'], $list[$key]['cid'], 1);
        $list[$key]['picurl'] = get_img_url($list[$key]['picurl'], $list[$key]['content']);
        $list[$key]['picurl-s'] = get_img_url_s($list[$key]['picurl'], $list[$key]['content']);
    }
    //dump($rs->getLastSql());
    return $list;
}
Esempio n. 8
0
 public function show()
 {
     //get params
     $where = array();
     $cid = $_REQUEST['cid'];
     $status = $_REQUEST['status'];
     $serial = $_REQUEST['serial'];
     $picurl = $_REQUEST['picurl'];
     $keyword = urldecode(trim($_REQUEST['keyword']));
     //search condition
     if ($cid) {
         if (get_channel_son($cid)) {
             $where['cid'] = $cid;
         } else {
             $where['cid'] = get_channel_sqlin($cid);
         }
     }
     if ($status || $status === '0') {
         $where['status'] = array('eq', intval($status));
     }
     if ($serial) {
         $where['serial'] = array('neq', 0);
     }
     if ($picurl) {
         $where['Left(picurl,7)'] = array('eq', 'fail://');
     }
     if ($keyword) {
         $search['title'] = array('like', '%' . $keyword . '%');
         $search['intro'] = array('like', '%' . $keyword . '%');
         $search['actor'] = array('like', '%' . $keyword . '%');
         $search['director'] = array('like', '%' . $keyword . '%');
         $search['_logic'] = 'or';
         $where['_complex'] = $search;
     }
     //
     $video['type'] = !empty($_GET['type']) ? $_GET['type'] : C('web_admin_ordertype');
     $video['order'] = !empty($_GET['order']) ? $_GET['order'] : 'desc';
     $order = $video["type"] . ' ' . $video['order'];
     //
     $video_count = $this->VideoDB->where($where)->count('id');
     $video_page = !empty($_GET['p']) ? intval($_GET['p']) : 1;
     $video_page = get_cms_page_max($video_count, C('web_admin_pagenum'), $video_page);
     $video_url = U('Admin-Video/Show', array('cid' => $cid, 'status' => $status, 'serial' => $serial, 'picurl' => $picurl, 'type' => $video['type'], 'order' => $video['order'], 'keyword' => urlencode($keyword), 'p' => ''), false, false);
     $listpages = get_cms_page($video_count, C('web_admin_pagenum'), $video_page, $video_url, '部影片');
     $_SESSION['video_reurl'] = $video_url . $video_page;
     //
     $list = $this->VideoDB->where($where)->order($order)->limit(C('web_admin_pagenum'))->page($video_page)->select();
     if (empty($list)) {
         if ($status || $serial || $cid || $keyword) {
             $this->assign("jumpUrl", C('cms_admin') . '?s=Admin/Video/Show');
             $this->error('没有查询到您所筛选的影片信息,请重新选择条件!');
         } else {
             $this->assign("jumpUrl", C('cms_admin') . '?s=Admin/Video/Add');
             if (empty($picurl)) {
                 $this->error('还没有任何影片,请先添加一部影片!');
             }
         }
     }
     foreach ($list as $key => $val) {
         $list[$key]['cname'] = get_channel_name($list[$key]['cid']);
         $list[$key]['channelurl'] = U('Admin-Video/Show', array('cid' => $list[$key]['cid']), false, false);
         $list[$key]['videourl'] = get_read_url('video', $list[$key]['id'], $list[$key]['cid']);
         $list[$key]['stararr'] = get_star_arr($list[$key]['stars']);
     }
     //dump($this->VideoDB->getLastSql());
     $this->assign($listpages);
     $this->assign('order', $order);
     $this->assign('cid', $cid);
     $this->assign('keyword', $keyword);
     $this->assign('list_channel_video', F('_gxcms/channelvideo'));
     $this->assign('list_video', $list);
     $this->display('views/admin/video_show.html');
 }
$__LIST__ = get_tag_gxmenu($tag);
if (is_array($__LIST__)) {
    $i = 0;
    if (count($__LIST__) == 0) {
        echo "";
    } else {
        foreach ($__LIST__ as $key => $menu) {
            ++$i;
            $mod = $i % 2;
            if ($menu["mid"] == "1") {
                ?>
<div class="top_table">
          <table width="960" border="0" align="center" cellpadding="5" cellspacing="1" style="background-color:#CCC;">
            <tr>
              <th colspan="5"><?php 
                echo get_channel_name($menu['id']);
                ?>
总人气排行榜</th>
            </tr>
            <tr>
              <td align="center">序号</td>
              <td>电影名称</td>
              <td align="center">点击数</td>
              <td align="center">网友评分</td>
              <td class="nobrd">更新日期</td>
            </tr>
            <?php 
                $tag['name'] = 'video';
                $tag['cid'] = '' . $menu['id'] . '';
                $tag['limit'] = '10';
                $tag['order'] = 'hits desc';
Esempio n. 10
0
require_once './vendor/autoload.php';
require_once 'Activity.php';
require_once 'config.php';
date_default_timezone_set('UTC');
$chat_info = $_POST['chat_info'];
$channel_name = null;
if (!isset($_POST['chat_info'])) {
    header("HTTP/1.0 400 Bad Request");
    echo 'chat_info must be provided';
}
if (!isset($_SERVER['HTTP_REFERER'])) {
    header("HTTP/1.0 400 Bad Request");
    echo 'channel name could not be determined from HTTP_REFERER';
}
$channel_name = get_channel_name($_SERVER['HTTP_REFERER']);
$options = sanitise_input($chat_info);
$activity = new Activity('chat-message', $options['text'], $options);
$pusher = new Pusher(APP_KEY, APP_SECRET, APP_ID);
$data = $activity->getMessage();
$response = $pusher->trigger($channel_name, 'chat_message', $data, null, true);
header('Cache-Control: no-cache, must-revalidate');
header('Content-type: application/json');
$result = array('activity' => $data, 'pusherResponse' => $response);
echo json_encode($result);
function get_channel_name($http_referer)
{
    // not allowed :, / % #
    $pattern = "/(\\W)+/";
    $channel_name = preg_replace($pattern, '-', $http_referer);
    return $channel_name;
 /**
  * //采集获取的栏目分类绑定
  * @param string $getname
  * @param mixed  $nid
  * @return string $cname 系统栏目名称
  */
 function GetCname($getname, $nid = '0')
 {
     $cname = collect::get_syschannel_id($getname, 'cname');
     //默认自动匹配系统分类
     if (!$cname) {
         $cid = collect::get_Autochannel_id($getname, $nid);
         //先检测是否有对应自定义分类
         if ($cid) {
             $cname = get_channel_name($cid);
         } else {
             $cname = collect::get_channel_id($getname, 'cname');
             //自动智能检测
         }
     }
     return $cname;
 }
Esempio n. 12
0
 public function searchSuggest()
 {
     $url = get_url_where();
     $search['title'] = array('like', '%' . $url['wd'] . '%');
     $rs = M('Video');
     $result = $rs->where($search)->field('id,cid,title')->limit('10')->select();
     $count = 0;
     if ($result) {
         $count = count($result);
         foreach ($result as &$v) {
             $v['oldtitle'] = $v['title'];
             $v['title'] = str_replace($url['wd'], '<font color="#FF0000">' . $url['wd'] . '</font>', $v['title']);
             $v['readurl'] = get_read_url('video', $v['id'], $v['cid'], $v['jumpurl']);
             $v['tname'] = get_channel_name($v['cid']);
         }
     }
     die(json_encode(array('result' => $result, 'c' => $count)));
 }
Esempio n. 13
0
 public function createlistwait()
 {
     $_GET['pagecount'] = (int) $_GET['pagecount'];
     $_GET['page'] = (int) $_GET['page'];
     $_GET['count'] = (int) $_GET['count'];
     $_GET['cid'] = (int) $_GET['cid'];
     $_GET['cidList'] = $_GET['cidList'];
     $_GET['go'] = intval($_GET['go']);
     $_GET['key'] = intval($_GET['key']);
     $curpage = (int) $_GET['page'] + 1;
     $this->assign('wait', C('url_create_list_time'));
     $this->assign('start', intval($_GET['start']));
     $this->assign('end', intval($_GET['end']));
     $url = '/index.php?s=Admin/Html/createlist/page/' . $curpage . '/pagecount/' . $_GET['pagecount'] . '/cid/' . $_GET['cid'] . '/count/' . $_GET['count'] . '/cidList/' . $_GET['cidList'] . '/go/' . $_GET['go'] . '/key/' . $_GET['key'];
     if ($curpage <= $_GET['pagecount']) {
         $this->assign("pagecount", $_GET['pagecount']);
         $this->assign("page", $_GET['page']);
         $this->assign("cid", $_GET['cid']);
         $this->assign("curpage", $_GET['curpage']);
         $this->assign("url", $url);
         $this->assign("cname", get_channel_name($_GET['cid']));
         $this->display('./views/admin/createlistwait.html');
     } else {
         //echo '进来了<Br>';
         $cidArray = explode(',', $_GET['cidList']);
         $cidCount = count($cidArray);
         $key = array_search($_GET['cid'], $cidArray);
         if ($key !== false && $_GET['key'] <= $cidCount) {
             $_GET['cid'] = $cidArray[$key + 1];
             $cid = $_GET['cid'];
             $list = list_search(F('_gxcms/channel'), 'id=' . $cid);
             $channel = $list[0];
             //获取当前栏目的缓存信息
             //查询本类及小类共多少条数据
             $rs = M("Video");
             $where['status'] = array('eq', 1);
             if (get_channel_son($cid)) {
                 $where['cid'] = $cid;
             } else {
                 $where['cid'] = get_channel_sqlin($cid);
             }
             $count = $rs->where($where)->count('id');
             //计算出该栏目需要生成的总页数
             $totalpages = ceil($count / $channel['limit']);
             if ($totalpages < 1) {
                 $totalpages = 1;
             }
             $_GET['pagecount'] = $totalpages;
             $_GET['count'] = $count;
             $_GET['page'] = 1;
             $curpage = 1;
             $url = '/index.php?s=Admin/Html/createlist/page/' . $curpage . '/pagecount/' . $_GET['pagecount'] . '/cid/' . $_GET['cid'] . '/count/' . $_GET['count'] . '/cidList/' . $_GET['cidList'] . '/go/' . $_GET['go'] . '/key/' . $_GET['key'];
             $this->assign("pagecount", $_GET['pagecount']);
             $this->assign("page", $_GET['page']);
             $this->assign("cname", get_channel_name($_GET['cid']));
             $this->assign("cid", $_GET['cid']);
             $this->assign("curpage", $_GET['curpage']);
             $this->assign("url", $url);
             $this->display('./views/admin/createlistwait.html');
         } else {
             if ($_GET['go']) {
                 $this->assign("jumpUrl", C('cms_admin') . '?s=Admin/Html/Inforead/go/' . $_GET['go']);
                 $this->success('恭喜您!影视栏目页已经生成完毕,正在准备生成新闻内容页,请稍等!');
             } else {
                 $this->assign("jumpUrl", C('cms_admin') . '?s=Admin/Html/Show');
                 $this->success('恭喜您!您所选择的栏目页已经生成完毕!');
             }
         }
         //echo array_search($_GET['cid'],$cidArray);exit;
     }
 }
Esempio n. 14
0
 /**
  * 采集内容
  * @param arr $source    采集地址 [url/title/picurl]
  * @param array $config  配置参数
  * @param integer $page  分页采集模式  暂无作用
  */
 function GetCon($source, &$config, $page = 0)
 {
     set_time_limit(300);
     static $oldurl = array();
     $page = intval($page) ? intval($page) : 0;
     $url = $source['url'];
     if ($config['picmode'] == '1') {
         $data['picurl'] = $source['picurl'];
     }
     if ($html = collect::get_html($url, $config)) {
         if (empty($page)) {
             if (isset($config['fields'])) {
                 $config['fields'] = collect::string2array($config['fields']);
             }
             //字符串转换为数组
             if (is_array($config['fields'])) {
                 foreach ($config['fields'] as $k => $v) {
                     //匹配规则,获取内容
                     if ($config[$v . '_rule']) {
                         $ArrRule = collect::replace_sg($config[$v . '_rule']);
                         $data[$v] = collect::replace_item(collect::cut_html($html, $ArrRule[0], $ArrRule[1]), $config[$v . '_filter']);
                     }
                 }
             }
             if ($config['menutype'] == '1') {
                 $data['cname'] = get_channel_name(intval($config['cid']));
             }
             /*=================================================*/
             //播放地址
             if ($config['range'] == '1') {
                 //播放列表范围
                 $plist = collect::cut_html($html, $config['playlist_start'], $config['playlist_end']);
             } else {
                 $plist =& $html;
             }
             if ($config['playmode'] == '1') {
                 //播放页获取单集播放url
                 if ($config['playlink_rule']) {
                     $out = $this->MatchAll($plist, $config['playlink_rule']);
                     foreach ($out as $key => $val) {
                         $playlink[$key] = collect::replace_item($val, $config['playlink_filter']);
                         $playlink[$key] = collect::url_check($playlink[$key], $url, $config);
                         $phtml[$key] = collect::get_html($playlink[$key], $config);
                         if ($config['purl_range'] == '1') {
                             $phtml[$key] = collect::cut_html($phtml[$key], $config['playurl_start'], $config['playurl_end']);
                         }
                         //获取播放url
                         if ($config['playurl_rule']) {
                             $ArrRule = collect::replace_sg($config['playurl_rule']);
                             $data['playurl'][$key] = collect::replace_item(collect::cut_html($phtml[$key], $ArrRule[0], $ArrRule[1]), $config['playurl_filter']);
                         }
                     }
                 }
             } else {
                 if ($config['playmode'] == '2') {
                     //播放页获取所有播放url
                     if ($config['playlink_rule']) {
                         $ArrRule = collect::replace_sg($config['playlink_rule']);
                         $playlink = collect::replace_item(collect::cut_html($plist, $ArrRule[0], $ArrRule[1]), $config['playlink_filter']);
                     }
                     $playlink = collect::url_check($playlink, $url, $config);
                     $phtml = collect::get_html($playlink, $config);
                     if ($config['purl_range'] == '1') {
                         $phtml = collect::cut_html($phtml, $config['playurl_start'], $config['playurl_end']);
                     }
                 } else {
                     $phtml =& $plist;
                     //默认内容页获取所有播放url
                 }
                 if ($config['playurl_rule']) {
                     //playurl 单集播放地址
                     $out = $this->MatchAll($phtml, $config['playurl_rule']);
                     foreach ($out as $key => $val) {
                         $data['playurl'][] = collect::replace_item($val, $config['playurl_filter']);
                     }
                 }
             }
             /*================================*/
             //获取分集名称
             if ($config['vnamemode'] == 2) {
                 if ($config['vname_rule']) {
                     $vout = $this->MatchAll($phtml, $config['vname_rule']);
                     foreach ($vout as $key => $val) {
                         $data['vname'][] = collect::replace_item($val, $config['vname_filter']);
                     }
                     foreach ($data['playurl'] as $k => $v) {
                         $data['playurl'][$k] = $data['vname'][$k] . '$' . $v;
                     }
                 }
             }
             /*=================================================*/
             //图片处理
             $data['picurl'] = preg_replace('/<img[^>]*src=[\'"]?([^>\'"\\s]*)[\'"]?[^>]*>/ie', "'\$1'", $data['picurl']);
             if ($config['action'] == 'real') {
                 if (empty($page) && !empty($data['picurl']) && C('upload_http') == 1) {
                     //下载图片
                     $Down = D('Down');
                     $data['picurl'] = $Down->down_img($data['picurl']);
                 }
                 //采集时间
                 if (empty($data['time'])) {
                     $data['time'] = time();
                 }
             }
         }
         /*if ($page == 0) {
         			$data['content'] = preg_replace('/<img[^>]*src=[\'"]?([^>\'"\s]*)[\'"]?[^>]*>/ie', "collect::download_img('$0', '$1')", $data['content']);
         		}*/
         $data['playlists'] = $config['playlists'];
         //添加本次采集针对的播放器
         return $data;
     }
 }
unset($tag);
?>
   
                
                </ul>
            </div>
            <!--综艺 结束-->
         <!--电视剧 开始-->
            <div class="dy dy2">
            	<div class="dy1">
                	<span class="dy1-1"><?php 
echo get_channel_name(2);
?>
</span>
                    <a href="<?php 
echo get_channel_name(2, 'showurl');
?>
" target="_blank" class="more"></a>
                    <p>
                        <?php 
$tag['name'] = 'menu';
$tag['ids'] = '2';
$__LIST__ = get_tag_gxmenu($tag);
if (is_array($__LIST__)) {
    $i = 0;
    if (count($__LIST__) == 0) {
        echo "";
    } else {
        foreach ($__LIST__ as $key => $menu) {
            ++$i;
            $mod = $i % 2;