/**
  * 影片重名检测
  * @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 show()
 {
     $request['wd'] = urldecode(trim($_REQUEST['wd']));
     $request['status'] = intval($_GET['status']);
     if (!empty($request['wd'])) {
         $where[C('db_prefix') . 'comment.ip'] = array('like', '%' . $request["wd"] . '%');
         $where[C('db_prefix') . 'comment.content'] = array('like', '%' . $request["wd"] . '%');
         $where[C('db_prefix') . 'user.username'] = array('like', '%' . $request["wd"] . '%');
         $where[C('db_prefix') . 'video.title'] = array('like', '%' . $request["wd"] . '%');
         $where['_logic'] = 'or';
     }
     if ($request['status']) {
         $where[C('db_prefix') . 'comment.status'] = 0;
     }
     $join = C('db_prefix') . 'user on ' . C('db_prefix') . 'comment.uid = ' . C('db_prefix') . 'user.id';
     //查询影片名称
     $join_video = C('db_prefix') . 'video on ' . C('db_prefix') . 'comment.did = ' . C('db_prefix') . 'video.id';
     $field = C('db_prefix') . 'comment.*,' . C('db_prefix') . 'user.id as userid,' . C('db_prefix') . 'user.username,' . C('db_prefix') . 'video.title';
     $order = C('db_prefix') . 'comment.id desc';
     $cm_count = $this->CommDB->field($field)->where($where)->join($join)->join($join_video)->count();
     $cm_page = !empty($_GET['p']) ? intval($_GET['p']) : 1;
     $cm_page = get_cms_page_max($cm_count, C('web_admin_pagenum'), $cm_page);
     $cm_url = U('Admin-Comment/Show', array('status' => $request['status'], 'wd' => urlencode($request['wd']), 'p' => ''), false, false);
     $listpages = get_cms_page($cm_count, C('web_admin_pagenum'), $cm_page, $cm_url, '条评论');
     $list_comment = $this->CommDB->field($field)->where($where)->join($join)->join($join_video)->order($order)->limit(C('web_admin_pagenum'))->page($cm_page)->select();
     //
     $_SESSION['comment_reurl'] = $cm_url . $cm_page;
     $this->assign($listpages);
     $this->assign('wd', $request['wd']);
     $this->assign('list_comment', $list_comment);
     $this->display('./views/admin/comment_show.html');
 }
 public function mana()
 {
     $status = $_REQUEST['status'];
     if ($status) {
         $where['status'] = $status;
     }
     if (isset($_GET['cid'])) {
         $where['cid'] = $_GET['cid'];
     }
     $special['type'] = !empty($_GET['type']) ? $_GET['type'] : C('web_admin_ordertype');
     $special['order'] = !empty($_GET['order']) ? $_GET['order'] : 'desc';
     $order = $special['type'] . ' ' . $special['order'];
     //分页开始
     $special_count = $this->SelfDB->where($where)->count('id');
     $special_page = !empty($_GET['p']) ? intval($_GET['p']) : 1;
     $special_page = get_cms_page_max($special_count, C('web_admin_pagenum'), $special_page);
     $special_url = U('Admin-Self/Mana', array('status' => $status, 'type' => $video['type'], 'order' => $video['order'], 'p' => ''), false, false);
     $listpages = get_cms_page($special_count, C('web_admin_pagenum'), $special_page, $special_url, '篇专辑');
     $list = $this->SelfDB->where($where)->order('id DESC')->limit(C('web_admin_pagenum'))->page($special_page)->select();
     //var_dump(C('web_admin_pagenum'));
     $_SESSION['special_reurl'] = $special_url . $special_page;
     foreach ($list as $key => $val) {
         $list[$key]['countvideo'] = !empty($val['mids']) ? count(explode(',', $val['mids'])) : 0;
         $list[$key]['countinfo'] = !empty($val['aids']) ? count(explode(',', $val['aids'])) : 0;
         $list[$key]['specialurl'] = get_read_url('special', $list[$key]['id']);
         $list[$key]['cname'] = $this->getType($list[$key]['cid']);
     }
     $this->assign($listpages);
     $this->assign('order', $order);
     $this->assign('list_special', $list);
     $this->assign('list_type', $this->getType(NULL));
     //var_dump($this->getType(NULL));
     $this->display('views/admin/self_show.html');
 }
Exemple #4
0
 public function replaceKey()
 {
     $keyword = trim($_REQUEST['keyword']);
     if ($keyword) {
         $where['name'] = $keyword;
     }
     $this->weiDB = M('replacekeys');
     $treecount = $this->weiDB->where($where)->count('id');
     $link_page = !empty($_GET['p']) ? $_GET['p'] : 1;
     $link_url = U('Admin-Wei/replaceKey', array('keyword' => urlencode($keyword), 'p' => ''), false, false);
     $listpages = get_cms_page($treecount, C('web_admin_pagenum'), $link_page, $link_url, '条替换关键词');
     $list = $this->weiDB->where($where)->limit(C('web_admin_pagenum'))->page($link_page)->select();
     if (empty($list)) {
         //	$this->error('没有查询到您所筛选的内链关键词!');
     }
     $this->assign('keyword', $keyword);
     $this->assign($listpages);
     $this->assign('tree', $list);
     $this->assign('treecount', $treecount);
     $this->display('./views/admin/replacekey_show.html');
 }
 public function show()
 {
     $join = C('db_prefix') . 'video on ' . C('db_prefix') . 'userview.did = ' . C('db_prefix') . 'video.id';
     $join2 = C('db_prefix') . 'user on ' . C('db_prefix') . 'userview.uid = ' . C('db_prefix') . 'user.id';
     $field = C('db_prefix') . 'userview.*,' . C('db_prefix') . 'video.id as videoid,' . C('db_prefix') . 'video.title,' . C('db_prefix') . 'user.username';
     $order = C('db_prefix') . 'video.id desc';
     //
     $user_count = $this->UserVDB->field($field)->join($join)->join($join2)->count();
     $user_page = !empty($_GET['p']) ? intval($_GET['p']) : 1;
     $totalPages = ceil($user_count / C('web_admin_pagenum'));
     if ($user_page > $totalPages) {
         $user_page = $totalPages;
     }
     $user_url = U('Admin-Userview/Show', array('p' => ''), false, false);
     $listpages = get_cms_page($user_count, C('web_admin_pagenum'), $user_page, $user_url, '条记录');
     //
     $list_view = $this->UserVDB->field($field)->join($join)->join($join2)->order($order)->limit(C('web_admin_pagenum'))->page($user_page)->select();
     $this->assign($listpages);
     $this->assign('list_view', $list_view);
     $this->assign('list_channel_video', F('_gxcms/channelvideo'));
     $this->display('./views/admin/userview_show.html');
 }
 public function show()
 {
     $keyword = trim($_REQUEST['keyword']);
     if ($keyword) {
         $where['username'] = array('like', '%' . $keyword . '%');
         $where['binary email'] = array('like', '%' . $keyword . '%');
         $where['_logic'] = 'or';
     }
     $user_count = $this->UserDB->where($where)->count('id');
     $user_page = !empty($_GET['p']) ? $_GET['p'] : 1;
     $user_url = U('Admin-User/Show', array('keyword' => urlencode($keyword), 'p' => ''), false, false);
     $listpages = get_cms_page($user_count, C('web_admin_pagenum'), $user_page, $user_url, '位用户');
     //
     $list = $this->UserDB->where($where)->order('jointime desc')->limit(C('web_admin_pagenum'))->page($user_page)->select();
     if (empty($list)) {
         $this->error('没有查询到您所筛选的用户!');
     }
     $this->assign('keyword', $keyword);
     $this->assign($listpages);
     $this->assign('list_user', $list);
     $this->display('./views/admin/user_show.html');
 }
 public function show()
 {
     $request['eid'] = $_REQUEST['eid'];
     $request['wd'] = urldecode(trim($_REQUEST['wd']));
     $request['status'] = intval($_GET['status']);
     if ($request['eid']) {
         $where[C('db_prefix') . 'gbook.errid'] = array('gt', 0);
         $request['showname'] = '报错';
     } else {
         $where[C('db_prefix') . 'gbook.errid'] = array('eq', 0);
         $request['showname'] = '留言';
     }
     if ($request['status']) {
         $where[C('db_prefix') . 'gbook.status'] = array('eq', 0);
     }
     if (!empty($request['wd'])) {
         $search[C('db_prefix') . 'gbook.ip'] = array('like', '%' . $request['wd'] . '%');
         $search[C('db_prefix') . 'gbook.content'] = array('like', '%' . $request['wd'] . '%');
         $search[C('db_prefix') . 'user.username'] = array('like', '%' . $request['wd'] . '%');
         $search['_logic'] = 'or';
         $where['_complex'] = $search;
     }
     $join = C('db_prefix') . 'user on ' . C('db_prefix') . 'gbook.uid = ' . C('db_prefix') . 'user.id';
     $field = C('db_prefix') . 'gbook.*,' . C('db_prefix') . 'user.id as userid,' . C('db_prefix') . 'user.username';
     $order = C('db_prefix') . 'gbook.id desc';
     $gb_count = $this->GbookDB->field($field)->where($where)->join($join)->count();
     $gb_page = !empty($_GET['p']) ? intval($_GET['p']) : 1;
     $gb_page = get_cms_page_max($gb_count, C('web_admin_pagenum'), $gb_page);
     $gb_url = U('Admin-Guestbook/Show', array('status' => $request['status'], 'eid' => $request['eid'], 'wd' => urlencode($request['wd']), 'p' => ''), false, false);
     $listpages = get_cms_page($gb_count, C('web_admin_pagenum'), $gb_page, $gb_url, '条留言');
     $list_gbook = $this->GbookDB->field($field)->where($where)->join($join)->order($order)->limit(C('web_admin_pagenum'))->page($gb_page)->select();
     //
     $_SESSION['guestbook_reurl'] = $gb_url . $gb_page;
     $this->assign($listpages);
     $this->assign($request);
     $this->assign('list_gbook', $list_gbook);
     $this->display('./views/admin/guestbook_show.html');
 }
 public function showspecial()
 {
     $specialid = intval($_REQUEST['id']);
     $keyword = urldecode(trim($_REQUEST['keyword']));
     if ($keyword) {
         $search['title'] = array('like', '%' . $keyword . '%');
         $search['intro'] = array('like', '%' . $keyword . '%');
         $search['actor'] = array('like', '%' . $keyword . '%');
         $map = $search;
         $map['_logic'] = 'or';
         $where['_complex'] = $map;
     }
     $where['status'] = 1;
     $video_count = $this->VideoDB->where($where)->count('id');
     $video_page = !empty($_GET['p']) ? intval($_GET['p']) : 1;
     $video_url = U('Admin-Video/Showspecial', array('id' => $specialid, 'keyword' => urlencode($keyword), 'p' => ''), false, false);
     $listpages = get_cms_page($video_count, C('web_admin_pagenum'), $video_page, $video_url, '部影片');
     $list = $this->VideoDB->field('id,cid,title,intro,actor')->where($where)->limit(C('web_admin_pagenum'))->page($video_page)->order('addtime desc')->select();
     $this->assign($listpages);
     $this->assign('list_video', $list);
     $this->assign('keyword', $keyword);
     $this->display('views/admin/special_video.html');
 }
 public function comment()
 {
     $arr = $this->checklogin();
     $where['uid'] = $arr['id'];
     $rs = M('Comment');
     $comment_count = $rs->where($where)->count('id');
     $comment_page = !empty($_GET['p']) ? $_GET['p'] : 1;
     $comment_page = intval($comment_page);
     $comment_url = U('User/Comment', array('p' => ''), false, false);
     $listpages = get_cms_page($comment_count, C('user_page_cm'), $comment_page, $comment_url, '条评论', false);
     $listcomment = $rs->where($where)->order('addtime desc,id desc')->limit(C('user_page_cm'))->page($comment_page)->select();
     $this->assign('pages', $listpages['listpages']);
     $this->assign('list_comment', $listcomment);
     $this->assign('count_comment', $comment_count);
     $this->display('./views/user/comment.html');
 }
 function ChannelList($where)
 {
     $count = $this->CDB->where($where)->count('id');
     $page = !empty($_GET['p']) ? intval($_GET['p']) : 1;
     $page = get_cms_page_max($count, C('web_admin_pagenum'), $page);
     $url = U('Admin-CustomCollect/AutoChannel', array('cname' => $where['cname'], 'reid' => $where['reid'], 'nid' => $where['nid'], 'p' => ''), false, false);
     $pagelist = get_cms_page($count, C('web_admin_pagenum'), $page, $url, '条记录');
     $_SESSION['reurl'] = $url . $page;
     $Arr = $this->CDB->where($where)->order('id desc')->limit(C('web_admin_pagenum'))->page($page)->select();
     $CacheData = F('_gxcms/channel_999');
     if (!empty($CacheData)) {
         foreach ($CacheData as $key => $val) {
             $Cache[] = explode('_', $val['cname']);
         }
         $Cache = array_unique($Cache);
         foreach ($Cache as $k => $v) {
             $Cache[$k][1] = collect::get_node_name($v[1]);
         }
     }
     $Result = array('arr' => $Arr, 'cache' => $Cache, 'pagelist' => $pagelist, 'search' => $where);
     return $Result;
 }
 /**
  * 采集影片入库list
  * @param $where
  */
 function ColVideoList($where)
 {
     if (!empty($where['title'])) {
         $title = $where['title'];
         $where['title'] = array('like', '%' . $title . '%');
     }
     $order = empty($_GET['order']) ? 'addtime' : $_GET['order'];
     $sort = empty($_GET['sort']) ? 'desc' : $_GET['sort'];
     $order = $order . ' ' . $sort;
     $where['status'] = array('neq', 0);
     $video_count = $this->ContDB->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-CustomCollect/ColVideo', array('nid' => urlencode($where['nid']), 'title' => urlencode($title), 'p' => ''), false, false);
     $pagelist = get_cms_page($video_count, C('web_admin_pagenum'), $video_page, $video_url, '条记录');
     $_SESSION['video_reurl'] = $video_url . $video_page;
     $Arr = $this->ContDB->field(C('db_prefix') . 'co_content.id,nid,name,status,url,data,addtime')->join(C('db_prefix') . 'co_node on ' . C('db_prefix') . 'co_node.id=nid')->where($where)->order(C('db_prefix') . 'co_content.' . $order)->limit(C('web_admin_pagenum'))->page($video_page)->select();
     //echo $this->ContDB->getLastSql();
     foreach ($Arr as $key => $val) {
         if (!empty($val['data'])) {
             $val['data'] = stripslashes($val['data']);
             $Arr[$key]['data'] = collect::string2array($val['data']);
             $Arr[$key]['base'] = $this->ConvShow($Arr[$key]['data']);
         }
     }
     $ArrReturn = array('video' => $Arr, 'pagelist' => $pagelist, 'order' => $order, 'title' => $title, 'nid' => $where['nid']);
     return $ArrReturn;
 }