public function search() { //获取地址栏参数并读取栏目缓存信息 $url = get_url_where(); $list = F('_gxcms/channel'); $channel = $list[999]; //搜索条件 if ($url['wd']) { $search['title'] = array('like', '%' . $url['wd'] . '%'); $search['remark'] = array('like', '%' . $url['wd'] . '%'); $jumpurl['wd'] = urlencode($url['wd']); } if ($url['id']) { if (get_channel_son($url['id'])) { $where['cid'] = $url['id']; } else { $where['cid'] = get_channel_sqlin($url['id']); } $jumpurl['id'] = $url['id']; } if (isset($search)) { $search['_logic'] = 'or'; $where['_complex'] = $search; } if ($url['order'] != 'addtime') { $jumpurl['order'] = $url['order']; } $where['status'] = array('eq', 1); $rs = M('Info'); $count = $rs->where($where)->count('id'); //组合分页信息(强制为动态模式) C('url_html_channel', 0); $jumpurl['p'] = ''; $totalpages = ceil($count / $channel['info']); if ($url['page'] > $totalpages) { $url['page'] = $totalpages; } $pages = '共' . $count . '篇文章 当前:' . $url['page'] . '/' . $totalpages . '页 '; $pages .= get_cms_page_css($url['page'], $totalpages, C('web_home_pagenum'), str_replace('/lists', '/search', get_show_url('info', $jumpurl, 2)), false); //前台模板变量赋值 $channel['cid'] = $url['id']; $channel['keyword'] = $url['wd']; $channel['order'] = $url['order']; $channel['count'] = $count; $channel['page'] = $url['page']; $channel['pages'] = $pages; if ($url['page'] > 1) { $channel['webtitle'] = '搜索 ' . $url['wd'] . ' 的结果列表 -第' . $url['page'] . '页-' . C('web_name'); } else { $channel['webtitle'] = '搜索 ' . $url['wd'] . ' 的结果列表 -' . C('web_name'); } $channel['navtitle'] = '<a href="' . C('web_path') . '">首页</a> > <span>搜索页</span>'; //先给bdsearch标签传值后再输出模板 C('bdsearch_page', $url['page']); C('bdsearch_where', $where); $this->assign($channel); $this->display('info_search'); }
function SearchCon($Get) { if ($Get['cid']) { if (get_channel_son($Get['cid'])) { $where['cid'] = $Get['cid']; } else { $where['cid'] = get_channel_sqlin($Get['cid']); } } if ($Get['status'] || $Get['status'] === '0') { $where['status'] = array('eq', intval($Get['status'])); } if ($Get['keyword']) { $search['title'] = array('like', '%' . $Get['keyword'] . '%'); $search['intro'] = array('like', '%' . $Get['keyword'] . '%'); $search['actor'] = array('like', '%' . $Get['keyword'] . '%'); $search['director'] = array('like', '%' . $Get['keyword'] . '%'); $search['_logic'] = 'or'; $where['_complex'] = $search; } // return $where; }
function get_channel_remove($cids) { foreach ($cids as $key => $value) { if (get_channel_son($value)) { $cid .= ',' . $value; } else { $cidin = get_channel_sqlin($value); $cid .= ',' . $cidin[1]; } } $cidarr = explode(',', $cid); unset($cidarr[0]); $cidarr = array_unique($cidarr); return $cidarr; }
public function changecid() { if (empty($_POST['ids'])) { $this->error('请选择需要转移的影片!'); } $cid = intval($_POST['changecid']); if (get_channel_son($cid)) { $data['cid'] = $cid; $where['id'] = array('in', $_POST['ids']); $this->VideoDB->where($where)->save($data); //$this->assign("jumpUrl",C('cms_admin').'?s=Admin/Video/Show'); //$this->success('批量转移数据成功!'); redirect($_SESSION['video_reurl']); } else { $this->error('请选择当前大类下面的子分类!'); } }
public function setbind() { $rs = M("Channel"); $list = $rs->field('id,pid,mid,cname')->where('mid = 1')->order('id asc')->select(); foreach ($list as $key => $value) { if (!get_channel_son($list[$key]['id'])) { unset($list[$key]); } } $this->assign('list', $list); $this->display('./views/admin/collect_setbind.html'); }
function ChannelManage($act) { $Get = getReq($_REQUEST, array('cname' => 'string', 'reid' => 'int', 'nid' => 'int')); foreach ($Get as $k => $v) { $Get[$k] = trim($v); } $Get['cname'] = urldecode($Get['cname']); $where['id'] = $_GET['id']; if (!empty($Get['reid']) && !get_channel_son($Get['reid'])) { $this->error = '请选择当前分类下面的子类栏目!'; return false; } if ($act == 'add' || $act == 'update') { if (empty($Get['cname'])) { $this->error = '要转换的 栏目 为空'; return false; } if (empty($Get['reid'])) { $this->error = '请选择对应的系统栏目'; return false; } //检测重复性 $id = $this->CDB->field('id')->where($Get)->find(); if ($id && $id['id'] != $_GET['id']) { $this->error = '重复设置'; return false; } } switch ($act) { case 'add': $id = $this->CDB->add($Get); if (!id) { return false; } break; case 'update': $id = $this->CDB->where($where)->data($Get)->save(); if (!id) { return false; } break; case 'del': $this->CDB->where($where)->delete(); break; default: break; } $this->ChanlMemcache(); if ($act == 'add' || $act == 'update') { $up = $this->ColChannelFolow($Get['cname'], $Get['nid'], $Get['reid']); //更新table col_content if ($up) { return true; } } return true; }
?> />关闭</td> </tr> <tr class="tr" id="listpay" style="display:none"> <td class="left">需付费观看的栏目<br><br>用户在观看影片的过程中将保存付费观看记录</td> <td><?php if (is_array($channel_tree)) { $i = 0; $__LIST__ = $channel_tree; if (count($__LIST__) == 0) { echo ""; } else { foreach ($__LIST__ as $key => $gxcms) { ++$i; $mod = $i % 2; if (get_channel_son($gxcms['id']) == 1) { if ($key % 10 == 0) { ?> <br /><?php } ?> <input title="<?php echo $key; ?> " type="checkbox" class="checkbox" value="<?php echo $gxcms["id"]; ?> " name="con[user_paycid][]" <?php if (in_array($gxcms["id"], is_array($user_paycid) ? $user_paycid : explode(',', $user_paycid))) { ?> checked<?php
public function inforead() { $go = intval($_GET['go']); $arid = intval($_REQUEST["arid"]); $this->checkhtml(C('url_html'), '文章内容', '?s=Admin/Html/Infoshow/asid/0/go/' . $go); echo '<div class="htmllist" id="show" style="font-size:12px;">'; $rs = M("Info"); $where['status'] = 1; if ($arid) { if (get_channel_son($arid)) { $where['cid'] = $arid; } else { $where['cid'] = get_channel_sqlin($arid); } } $count = $rs->where($where)->count('id'); $listRows = C('url_create_num'); //每页生成数 $totalpages = ceil($count / $listRows); //总生成页数 //当前页数 $nowpage = !empty($_GET['page']) ? $_GET['page'] : 1; $nowpage = intval($nowpage); if (!empty($totalpages) && $nowpage > $totalpages) { $nowpage = $totalpages; } echo '<li>总共需要生成<span>' . $count . '</span>篇文章,每页生成<span>' . $listRows . '</span>篇,共需要分<span>' . $totalpages . '</span>页生成,当前正在生成第<span>' . $nowpage . '</span>页。</li>'; $list = $rs->where($where)->order('addtime desc')->limit($listRows)->page($nowpage)->select(); foreach ($list as $key => $value) { $this->createinfo($value); } echo '</div><script>document.getElementById("show").style.display="none";</script>'; if ($nowpage < $totalpages) { //是否生成完成 $this->assign("waitSecond", C('url_create_time')); $this->assign("jumpUrl", C('cms_admin') . '?s=Admin/Html/Inforead/arid/' . $arid . '/page/' . ($nowpage + 1) . '/go/' . $go); $this->success('第(' . $nowpage . ')页已经完成,正在准备下一个,请稍等!'); } else { if ($go) { $this->assign("jumpUrl", C('cms_admin') . '?s=Admin/Html/Infoshow/asid/0/go/' . $go); $this->success('恭喜您!所有新闻内容页已经生成完毕,正在准备生成新闻栏目页,请稍等!'); } else { $this->assign("jumpUrl", C('cms_admin') . '?s=Admin/Html/Show'); $this->success('恭喜您!所有静态化网页的任务已经完成!'); } } }
public function status() { $where['id'] = intval($_GET['id']); if (!get_channel_son($where['id'])) { $this->error("该栏目有子类,不可以隐藏!"); } if (intval($_GET['sid'])) { $this->ChannelDB->where($where)->setField('status', 1); } else { $this->ChannelDB->where($where)->setField('status', 0); } $this->create_channel(); $this->redirect('Admin-Channel/Show'); }