Exemplo n.º 1
0
 public function index()
 {
     $sort = $this->input->get_post('sort', true);
     $desc = $this->input->get_post('desc', true);
     $zd = $this->input->get_post('zd', true);
     $yid = intval($this->input->get_post('yid'));
     $tid = intval($this->input->get_post('tid'));
     $key = $this->input->get_post('key', true);
     $page = intval($this->input->get('page'));
     if ($page == 0) {
         $page = 1;
     }
     $data['page'] = $page;
     $data['sort'] = $sort;
     $data['zd'] = $zd;
     $data['yid'] = $yid;
     $data['key'] = $key;
     $data['tid'] = $tid;
     if (empty($sort)) {
         $sort = "addtime";
     }
     $sql_string = "SELECT id,name,pic,hits,tid,yid,singerid,addtime FROM " . CS_SqlPrefix . "dance_topic where 1=1";
     if ($yid == 1) {
         $sql_string .= " and yid=0";
     }
     if ($yid == 2) {
         $sql_string .= " and yid=1";
     }
     if (!empty($key)) {
         if ($zd == 'user') {
             $uid = getzd('user', 'id', $key, 'name');
             $sql_string .= " and uid='" . intval($uid) . "'";
         } elseif ($zd == 'singer') {
             $singerid = getzd('singer', 'id', $key, 'name');
             $sql_string .= " and singerid='" . intval($singerid) . "'";
         } else {
             $sql_string .= " and " . $zd . " like '%" . $key . "%'";
         }
     }
     if ($tid > 0) {
         $sql_string .= " and tid=" . ($tid - 1) . "";
     }
     $sql_string .= " order by " . $sort . " desc";
     $query = $this->db->query($sql_string);
     $total = $query->num_rows();
     $base_url = site_url('dance/admin/topic') . "?yid=" . $yid . "&key=" . $key . "&sort=" . $sort . "&tid=" . $tid;
     $per_page = 15;
     $totalPages = ceil($total / $per_page);
     // 总页数
     $data['nums'] = $total;
     if ($total < $per_page) {
         $per_page = $total;
     }
     $sql_string .= ' limit ' . $per_page * ($page - 1) . ',' . $per_page;
     $query = $this->db->query($sql_string);
     $data['topic'] = $query->result();
     $data['pages'] = get_admin_page($base_url, $totalPages, $page, 10);
     //获取分页类
     $this->load->view('topic.html', $data);
 }
Exemplo n.º 2
0
 public function index()
 {
     $sort = $this->input->get_post('sort', true);
     $desc = $this->input->get_post('desc', true);
     $sid = intval($this->input->get_post('sid'));
     $cid = intval($this->input->get_post('cid'));
     $key = str_replace('%', '', $this->input->get_post('key', true));
     $page = intval($this->input->get('page'));
     if ($page == 0) {
         $page = 1;
     }
     if (empty($sort)) {
         $sort = "id";
     }
     if (empty($desc)) {
         $desc = "desc";
     }
     $sql_string = "SELECT * FROM " . CS_SqlPrefix . "link where 1=1";
     if ($cid > 0) {
         $sql_string .= " and cid=" . $cid . "";
     }
     if ($sid > 0) {
         $sql_string .= " and sid=" . $sid . "";
     }
     if (!empty($key)) {
         $sql_string .= " and name like '%" . $key . "%'";
     }
     $sql_string .= " order by " . $sort . " " . $desc;
     $query = $this->db->query($sql_string);
     $total = $query->num_rows();
     $base_url = site_url('links') . "?cid=" . $cid . "&sid=" . $sid . "&sort=" . $sort . "&desc=" . $desc;
     $per_page = 15;
     $totalPages = ceil($total / $per_page);
     // 总页数
     $data['nums'] = $total;
     if ($total < $per_page) {
         $per_page = $total;
     }
     $sql_string .= ' limit ' . $per_page * ($page - 1) . ',' . $per_page;
     $query = $this->db->query($sql_string);
     $data['links'] = $query->result();
     $data['page'] = $page;
     $data['desc'] = $desc;
     $data['pages'] = get_admin_page($base_url, $totalPages, $page, 10);
     //获取分页类
     $this->load->view('links.html', $data);
 }
Exemplo n.º 3
0
 public function index()
 {
     $dir = $this->input->get_post('dir', true);
     $zd = $this->input->get_post('zd', true);
     $key = $this->input->get_post('key', true);
     $page = intval($this->input->get('page'));
     if ($page == 0) {
         $page = 1;
     }
     $data['page'] = $page;
     $data['dir'] = $dir;
     $data['zd'] = $zd;
     $data['key'] = $key;
     $sql_string = "SELECT * FROM " . CS_SqlPrefix . "pl where 1=1";
     if (!empty($dir)) {
         $sql_string .= " and dir='" . $dir . "'";
     }
     if (!empty($key)) {
         if ($zd == 'did') {
             $sql_string .= " and did=" . intval($key) . "";
         } else {
             if ($zd == 'name') {
                 $sql_string .= " and user='******'";
             } else {
                 $sql_string .= " and uid=" . intval($key) . "";
             }
         }
     }
     $sql_string .= " order by addtime desc";
     $query = $this->db->query($sql_string);
     $total = $query->num_rows();
     $base_url = site_url('pl') . "?zd=" . $zd . "&dir=" . $dir . "&key=" . $key;
     $per_page = 15;
     $totalPages = ceil($total / $per_page);
     // 总页数
     $data['nums'] = $total;
     if ($total < $per_page) {
         $per_page = $total;
     }
     $sql_string .= ' limit ' . $per_page * ($page - 1) . ',' . $per_page;
     $query = $this->db->query($sql_string);
     $data['pl'] = $query->result();
     $data['pages'] = get_admin_page($base_url, $totalPages, $page, 10);
     //获取分页类
     $this->load->view('pl.html', $data);
 }
Exemplo n.º 4
0
 public function index()
 {
     $op = $this->input->get_post('op', true);
     $zd = $this->input->get_post('zd', true);
     $key = $this->input->get_post('key', true);
     $page = intval($this->input->get('page'));
     if ($page == 0) {
         $page = 1;
     }
     $data['page'] = $page;
     $data['op'] = $op;
     $data['zd'] = $zd;
     $data['key'] = $key;
     $sql_string = "SELECT * FROM " . CS_SqlPrefix . "gbook where 1=1";
     if ($op == 'web') {
         $sql_string .= " and cid=1";
     }
     if ($op == 'user') {
         $sql_string .= " and cid=0";
     }
     if (!empty($key)) {
         if ($zd == 'name') {
             $uid = $this->CsdjDB->getzd('user', 'id', $key, 'name');
         } else {
             $uid = $key;
         }
         $sql_string .= " and (uida=" . intval($uid) . " or uidb=" . intval($uid) . ")";
     }
     $sql_string .= " order by addtime desc";
     $query = $this->db->query($sql_string);
     $total = $query->num_rows();
     $base_url = site_url('gbook') . "?zd=" . $zd . "&op=" . $op . "&key=" . $key;
     $per_page = 15;
     $totalPages = ceil($total / $per_page);
     // 总页数
     $data['nums'] = $total;
     if ($total < $per_page) {
         $per_page = $total;
     }
     $sql_string .= ' limit ' . $per_page * ($page - 1) . ',' . $per_page;
     $query = $this->db->query($sql_string);
     $data['gbook'] = $query->result();
     $data['pages'] = get_admin_page($base_url, $totalPages, $page, 10);
     //获取分页类
     $this->load->view('gbook.html', $data);
 }
Exemplo n.º 5
0
 public function index()
 {
     $kstime = $this->input->get_post('kstime', true);
     $jstime = $this->input->get_post('jstime', true);
     $key = $this->input->get_post('key', true);
     $page = intval($this->input->get('page'));
     if ($page == 0) {
         $page = 1;
     }
     $kstimes = empty($kstime) ? 0 : strtotime($kstime) - 86400;
     $jstimes = empty($jstime) ? 0 : strtotime($jstime) + 86400;
     if ($kstimes > $jstimes) {
         $kstimes = strtotime($kstime);
     }
     $data['key'] = $key;
     $data['page'] = $page;
     $data['kstime'] = $kstime;
     $data['jstime'] = empty($jstime) ? date('Y-m-d') : $jstime;
     $sql_string = "SELECT * FROM " . CS_SqlPrefix . "news_look where 1=1";
     if (!empty($key)) {
         $sql_string .= " and name like '%" . $key . "%'";
     }
     if ($kstimes > 0) {
         $sql_string .= " and addtime>" . $kstimes . "";
     }
     if ($jstimes > 0) {
         $sql_string .= " and addtime<" . $jstimes . "";
     }
     $sql_string .= " order by addtime desc";
     $query = $this->db->query($sql_string);
     $total = $query->num_rows();
     $base_url = site_url('news/admin/look') . "?key=" . $key . "&kstime=" . $kstime . "&jstime=" . $jstime;
     $per_page = 15;
     $totalPages = ceil($total / $per_page);
     // 总页数
     $data['nums'] = $total;
     if ($total < $per_page) {
         $per_page = $total;
     }
     $sql_string .= ' limit ' . $per_page * ($page - 1) . ',' . $per_page;
     $query = $this->db->query($sql_string);
     $data['look'] = $query->result();
     $data['pages'] = get_admin_page($base_url, $totalPages, $page, 10);
     //获取分页类
     $this->load->view('look.html', $data);
 }
Exemplo n.º 6
0
 public function lists()
 {
     $page = intval($this->input->get('page', TRUE));
     if ($page == 0) {
         $page = 1;
     }
     $strs = $this->smstel->lists(12, $page);
     if (!empty($strs)) {
         $arr = unarraystring($strs);
         $data['lists'] = $arr['lists'];
         $data['pagejs'] = $arr['pagejs'];
         $data['nums'] = $arr['nums'];
         $data['page'] = $page;
         $data['pages'] = get_admin_page(site_url('sms/lists') . '?', $arr['pagejs'], $page);
     } else {
         $data['lists'] = array();
         $data['pagejs'] = 0;
         $data['nums'] = 0;
         $data['page'] = $page;
         $data['pages'] = 0;
     }
     $this->load->view('sms_list.html', $data);
 }
Exemplo n.º 7
0
 public function ruku()
 {
     $page = intval($this->input->get('page'));
     $zid = intval($this->input->get_post('zid'));
     $dir = $this->input->get_post('dir', true);
     if ($page == 0) {
         $page = 1;
     }
     $sql_string = "SELECT * FROM " . CS_SqlPrefix . "cjdata where 1=1";
     if (!empty($dir)) {
         $sql_string .= " and dir='" . $dir . "'";
     }
     if ($zid > 0) {
         $sql_string .= " and zid=" . ($zid - 1) . "";
     }
     $sql_string .= " order by id desc";
     $query = $this->db->query($sql_string);
     $total = $query->num_rows();
     $base_url = site_url('collect/ruku') . '?dir=' . $dir . '&zid=' . $zid;
     $per_page = 15;
     $totalPages = ceil($total / $per_page);
     // 总页数
     $data['nums'] = $total;
     if ($total < $per_page) {
         $per_page = $total;
     }
     $sql_string .= ' limit ' . $per_page * ($page - 1) . ',' . $per_page;
     $query = $this->db->query($sql_string);
     $data['collect'] = $query->result();
     $data['page'] = $page;
     $data['pages'] = get_admin_page($base_url, $totalPages, $page, 10);
     //获取分页类
     $this->load->view('collect_ruku.html', $data);
 }
Exemplo n.º 8
0
 public function res()
 {
     $page = intval($this->input->get('page'));
     $sid = intval($this->uri->segment(4));
     if ($page == 0) {
         $page = 1;
     }
     $data['page'] = $page;
     $data['sid'] = $sid;
     $sql_string = "SELECT * FROM " . CS_SqlPrefix . "pic_type where yid=0 and hid=0 order by id desc";
     $query = $this->db->query($sql_string);
     $total = $query->num_rows();
     $base_url = site_url('pic/admin/pic/res/' . $sid);
     $per_page = 8;
     $totalPages = ceil($total / $per_page);
     // 总页数
     $data['nums'] = $total;
     if ($total < $per_page) {
         $per_page = $total;
     }
     $sql_string .= ' limit ' . $per_page * ($page - 1) . ',' . $per_page;
     $query = $this->db->query($sql_string);
     $data['pic_type'] = $query->result();
     $data['pages'] = get_admin_page($base_url, $totalPages, $page, 10);
     //获取分页类
     $this->load->view('pic_res.html', $data);
 }
Exemplo n.º 9
0
 public function index()
 {
     $sort = $this->input->get_post('sort', true);
     $desc = $this->input->get_post('desc', true);
     $cid = intval($this->input->get_post('cid'));
     $yid = intval($this->input->get_post('yid'));
     $reco = intval($this->input->get_post('reco'));
     $zd = $this->input->get_post('zd', true);
     $key = $this->input->get_post('key', true);
     $page = intval($this->input->get('page'));
     if ($page == 0) {
         $page = 1;
     }
     $data['page'] = $page;
     $data['sort'] = $sort;
     $data['cid'] = $cid;
     $data['yid'] = $yid;
     $data['zd'] = $zd;
     $data['key'] = $key;
     $data['reco'] = $reco;
     if (empty($sort)) {
         $sort = "addtime";
     }
     $sql_string = "SELECT id,name,pic,hits,hid,reco,cid,yid,addtime FROM " . CS_SqlPrefix . "singer where 1=1";
     if ($yid == 1) {
         $sql_string .= " and yid=0";
     }
     if ($yid == 2) {
         $sql_string .= " and yid=1";
     }
     if ($yid == 3) {
         $sql_string .= " and hid=1";
     } else {
         $sql_string .= " and hid=0";
     }
     if ($cid > 0) {
         $sql_string .= " and cid=" . $cid . "";
     }
     if (!empty($key)) {
         if ($zd == 'id') {
             $sql_string .= " and id='" . intval($key) . "'";
         } else {
             $sql_string .= " and " . $zd . " like '%" . $key . "%'";
         }
     }
     if ($reco > 0) {
         $sql_string .= " and reco=" . $reco . "";
     }
     $sql_string .= " order by " . $sort . " desc";
     //exit($sql_string);
     $query = $this->db->query($sql_string);
     $total = $query->num_rows();
     $base_url = site_url('singer/admin/singer') . "?yid=" . $yid . "&zd=" . $zd . "&key=" . $key . "&cid=" . $cid . "&sort=" . $sort . "&reco=" . $reco;
     $per_page = 15;
     $totalPages = ceil($total / $per_page);
     // 总页数
     $data['nums'] = $total;
     if ($total < $per_page) {
         $per_page = $total;
     }
     $sql_string .= ' limit ' . $per_page * ($page - 1) . ',' . $per_page;
     $query = $this->db->query($sql_string);
     $data['singer'] = $query->result();
     $data['pages'] = get_admin_page($base_url, $totalPages, $page, 10);
     //获取分页类
     $this->load->view('singer.html', $data);
 }
Exemplo n.º 10
0
 public function index()
 {
     $ac = $this->input->get('ac', true);
     $op = $this->input->get('op', true);
     $page = intval($this->input->get('page'));
     if ($page == 0) {
         $page = 1;
     }
     if ($op != 'home' && $op != 'user' && $op != 'mobile') {
         $op = 'skins';
     }
     if (empty($ac)) {
         $path = CSCMS . 'tpl/' . $op . '/';
     } else {
         if (!empty($op)) {
             $path = FCPATH . 'plugins/' . $ac . '/tpl/' . $op . '/';
         } else {
             $path = FCPATH . 'plugins/' . $ac . '/tpl/skins/';
         }
     }
     $arrs = directory_map($path, 1);
     $per_page = 10;
     $totalPages = ceil((count($arrs) - 1) / $per_page);
     //总页数
     $base_url = site_url('skin') . '?ac=' . $ac . '&op=' . $op;
     $dir_arr = array_slice($arrs, $per_page * (($page > $totalPages ? $totalPages : $page) - 1), $per_page);
     $dirs = array();
     if ($dir_arr) {
         foreach ($dir_arr as $t) {
             if (is_dir($path . $t)) {
                 $confiles = $path . $t . '/config.php';
                 if (file_exists($confiles)) {
                     $config = (require_once $confiles);
                     if (empty($ac)) {
                         if ($op == 'user') {
                             $plub['User_Dir'] = User_Skins;
                         } elseif ($op == 'home') {
                             $plub['Skins_Dir'] = Home_Skins;
                         } elseif ($op == 'mobile') {
                             $plub['Mobile_Dir'] = Mobile_Skins;
                         } else {
                             $plub['Skins_Dir'] = Web_Skins;
                         }
                         $pic = Web_Path . 'cscms/tpl/' . $op . '/' . $t . '/preview.jpg';
                     } else {
                         $plub = (require FCPATH . 'plugins/' . $ac . '/config/site.php');
                         $pdir = $op;
                         $pic = Web_Path . 'plugins/' . $ac . '/tpl/' . $pdir . '/' . $t . '/preview.jpg';
                     }
                     $pics = Web_Path != '/' ? str_replace(Web_Path, '', $pic) : $pic;
                     if (!file_exists(FCPATH . $pics)) {
                         $pic = Web_Path . 'packs/images/skins.jpg';
                     }
                     if ($op == 'mobile') {
                         $clas = $plub['Mobile_Dir'] == $config['path'] ? 'selected' : '';
                     } elseif ($op == 'user') {
                         $clas = $plub['User_Dir'] == $config['path'] ? 'selected' : '';
                     } elseif ($op == 'home') {
                         $clas = Home_Skins == $config['path'] ? 'selected' : '';
                     } else {
                         $clas = $plub['Skins_Dir'] == $config['path'] ? 'selected' : '';
                     }
                     $dirs[] = array('clas' => $clas, 'pic' => $pic, 'name' => $config['name'], 'path' => $config['path'], 'mid' => $config['mid'], 'author' => $config['author'], 'version' => $config['version'], 'description' => $config['description'], 'link' => site_url('skin/show') . "?ac=" . $ac . "&op=" . $op . "&dirs=" . $t, 'ulink' => site_url('skin/look') . "?ac=" . $ac . "&op=" . $op . "&dirs=" . $t, 'mrlink' => site_url('skin/init') . "?ac=" . $ac . "&op=" . $op . "&dirs=" . $t, 'dellink' => site_url('skin/del') . "?ac=" . $ac . "&op=" . $op . "&dirs=" . $t);
                 }
             }
         }
     }
     $data['skins'] = $dirs;
     $data['nums'] = count($arrs);
     $data['page'] = $page;
     $data['op'] = $op;
     $data['ac'] = $ac;
     $data['pages'] = get_admin_page($base_url, $totalPages, $page, 10);
     //获取分页类
     $data['uplink'] = site_url('skin/upload') . "?ac=" . $ac . "&op=" . $op;
     $this->load->view('skin.html', $data);
 }
Exemplo n.º 11
0
 public function page()
 {
     $page = intval($this->input->get('page'));
     if ($page == 0) {
         $page = 1;
     }
     $sql_string = "SELECT * FROM " . CS_SqlPrefix . "page order by addtime desc";
     $query = $this->db->query($sql_string);
     $total = $query->num_rows();
     $base_url = site_url('label/page');
     $per_page = 15;
     $totalPages = ceil($total / $per_page);
     // 总页数
     $data['nums'] = $total;
     if ($total < $per_page) {
         $per_page = $total;
     }
     $sql_string .= ' limit ' . $per_page * ($page - 1) . ',' . $per_page;
     $query = $this->db->query($sql_string);
     $data['label'] = $query->result();
     $data['page'] = $page;
     $data['pages'] = get_admin_page($base_url, $totalPages, $page, 10);
     //获取分页类
     $this->load->view('label_page.html', $data);
 }
Exemplo n.º 12
0
 public function log()
 {
     $id = intval($this->uri->segment(4));
     $sort = $this->input->get_post('sort', true);
     $desc = $this->input->get_post('desc', true);
     if (empty($sort)) {
         $sort = "id";
     }
     if (empty($desc)) {
         $desc = "desc";
     }
     //删除三个月以前的登录日志记录
     $times = time() - 86400 * 90;
     $this->db->query("delete from " . CS_SqlPrefix . "admin_log where logintime<" . $times . "");
     $this->load->library('ip');
     $page = intval($this->input->get('page'));
     if ($page == 0) {
         $page = 1;
     }
     if ($id > 0) {
         $sql_string = "SELECT * FROM " . CS_SqlPrefix . "admin_log where uid=" . $id . " order by " . $sort . " " . $desc;
     } else {
         $sql_string = "SELECT * FROM " . CS_SqlPrefix . "admin_log order by " . $sort . " " . $desc;
     }
     $query = $this->db->query($sql_string);
     $total = $query->num_rows();
     $base_url = $id == 0 ? site_url('sys/log') . "?sort=" . $sort . "&desc=" . $desc : site_url('sys/log/' . $id) . "?sort=" . $sort . "&desc=" . $desc;
     $per_page = 15;
     $totalPages = ceil($total / $per_page);
     // 总页数
     $data['nums'] = $total;
     if ($total < $per_page) {
         $per_page = $total;
     }
     $sql_string .= ' limit ' . $per_page * ($page - 1) . ',' . $per_page;
     $query = $this->db->query($sql_string);
     $data['log'] = $query->result();
     $data['page'] = $page;
     $data['sort'] = $sort;
     $data['desc'] = $desc;
     $data['pages'] = get_admin_page($base_url, $totalPages, $page, 10);
     //获取分页类
     $this->load->view('admin_log.html', $data);
 }
Exemplo n.º 13
0
 public function card()
 {
     $card = str_replace('%', '', $this->input->get_post('card', true));
     $sid = intval($this->input->get_post('sid'));
     $zd = $this->input->get_post('zd', true);
     $key = $this->input->get_post('key', true);
     $page = intval($this->input->get('page'));
     if ($page == 0) {
         $page = 1;
     }
     $data['page'] = $page;
     $data['sid'] = $sid;
     $data['zd'] = $zd;
     $data['key'] = $key;
     $data['card'] = $card;
     $sql_string = "SELECT * FROM " . CS_SqlPrefix . "paycard where 1=1";
     if (!empty($card)) {
         $sql_string .= " and card like '%" . $card . "%'";
     }
     if ($sid == 1) {
         $sql_string .= " and uid>0";
     }
     if ($sid == 2) {
         $sql_string .= " and uid=0";
     }
     if (!empty($key)) {
         if ($zd == 'name') {
             $uid = $this->CsdjDB->getzd('user', 'id', $key, 'name');
         } else {
             $uid = $key;
         }
         $sql_string .= " and uid=" . intval($uid) . "";
     }
     $sql_string .= " order by addtime desc";
     $query = $this->db->query($sql_string);
     $total = $query->num_rows();
     $base_url = site_url('pay/card') . "?zd=" . $zd . "&card=" . $card . "&key=" . $key . "&sid=" . $sid;
     $per_page = 15;
     $totalPages = ceil($total / $per_page);
     // 总页数
     $data['nums'] = $total;
     if ($total < $per_page) {
         $per_page = $total;
     }
     $sql_string .= ' limit ' . $per_page * ($page - 1) . ',' . $per_page;
     $query = $this->db->query($sql_string);
     $data['paycard'] = $query->result();
     $data['pages'] = get_admin_page($base_url, $totalPages, $page, 10);
     //获取分页类
     $this->load->view('pay_card.html', $data);
 }
Exemplo n.º 14
0
 public function index()
 {
     $yuyan = $this->input->get_post('yuyan', true);
     $diqu = $this->input->get_post('diqu', true);
     $sort = $this->input->get_post('sort', true);
     $desc = $this->input->get_post('desc', true);
     $form = $this->input->get_post('form', true);
     $cid = intval($this->input->get_post('cid'));
     $yid = intval($this->input->get_post('yid'));
     $remark = intval($this->input->get_post('remark'));
     $reco = intval($this->input->get_post('reco'));
     $zd = $this->input->get_post('zd', true);
     $key = $this->input->get_post('key', true);
     $page = intval($this->input->get('page'));
     if ($page == 0) {
         $page = 1;
     }
     $data['page'] = $page;
     $data['sort'] = $sort;
     $data['cid'] = $cid;
     $data['yid'] = $yid;
     $data['zd'] = $zd;
     $data['key'] = $key;
     $data['diqu'] = $diqu;
     $data['yuyan'] = $yuyan;
     $data['remark'] = $remark;
     $data['reco'] = $reco;
     $data['form'] = $form;
     if (empty($sort)) {
         $sort = "addtime";
     }
     $sql_string = "SELECT id,name,pic,remark,hits,hid,reco,cid,yid,addtime FROM " . CS_SqlPrefix . "vod where 1=1";
     if ($yid == 1) {
         $sql_string .= " and yid=0";
     }
     if ($yid == 2) {
         $sql_string .= " and yid=1";
     }
     if ($yid == 3) {
         $sql_string .= " and hid=1";
     } else {
         $sql_string .= " and hid=0";
     }
     if ($cid > 0) {
         $sql_string .= " and cid=" . $cid . "";
     }
     if (!empty($key)) {
         $sql_string .= " and " . $zd . " like '%" . $key . "%'";
     }
     if (!empty($yuyan)) {
         $sql_string .= " and yuyan='" . $yuyan . "'";
     }
     if (!empty($diqu)) {
         $sql_string .= " and diqu='" . $diqu . "'";
     }
     if ($remark == 1) {
         $sql_string .= " and (remark='' or remark='完结')";
     }
     if ($remark == 2) {
         $sql_string .= " and remark!='' and remark!='完结'";
     }
     if ($reco > 0) {
         $sql_string .= " and reco=" . $reco . "";
     }
     if (!empty($form)) {
         $sql_string .= " and purl like '%\$" . $form . "%'";
     }
     $sql_string .= " order by " . $sort . " desc";
     $query = $this->db->query($sql_string);
     $total = $query->num_rows();
     $base_url = site_url('vod/admin/vod') . "?yid=" . $yid . "&remark=" . $remark . "&zd=" . $zd . "&yuyan=" . $yuyan . "&diqu=" . $diqu . "&key=" . $key . "&cid=" . $cid . "&form=" . $form . "&sort=" . $sort . "&reco=" . $reco;
     $per_page = 15;
     $totalPages = ceil($total / $per_page);
     // 总页数
     $data['nums'] = $total;
     if ($total < $per_page) {
         $per_page = $total;
     }
     $sql_string .= ' limit ' . $per_page * ($page - 1) . ',' . $per_page;
     $query = $this->db->query($sql_string);
     $data['vod'] = $query->result();
     $data['pages'] = get_admin_page($base_url, $totalPages, $page, 10);
     //获取分页类
     $this->load->view('vod.html', $data);
 }
Exemplo n.º 15
0
 public function down()
 {
     $kstime = $this->input->get_post('kstime', true);
     $jstime = $this->input->get_post('jstime', true);
     $zd = $this->input->get_post('zd', true);
     $key = $this->input->get_post('key', true);
     $page = intval($this->input->get('page'));
     if ($page == 0) {
         $page = 1;
     }
     $kstimes = empty($kstime) ? 0 : strtotime($kstime) - 86400;
     $jstimes = empty($jstime) ? 0 : strtotime($jstime) + 86400;
     if ($kstimes > $jstimes) {
         $kstimes = strtotime($kstime);
     }
     $data['zd'] = $zd;
     $data['key'] = $key;
     $data['page'] = $page;
     $data['kstime'] = $kstime;
     $data['jstime'] = empty($jstime) ? date('Y-m-d') : $jstime;
     $sql_string = "SELECT * FROM " . CS_SqlPrefix . "dance_down where 1=1";
     if (!empty($key)) {
         if ($zd == 'user') {
             $uid = getzd('user', 'id', $key, 'name');
             $sql_string .= " and uid='" . intval($uid) . "'";
         } else {
             $sql_string .= " and name like '%" . $key . "%'";
         }
     }
     if ($kstimes > 0) {
         $sql_string .= " and addtime>" . $kstimes . "";
     }
     if ($jstimes > 0) {
         $sql_string .= " and addtime<" . $jstimes . "";
     }
     $sql_string .= " order by addtime desc";
     $query = $this->db->query($sql_string);
     $total = $query->num_rows();
     $base_url = site_url('dance/admin/opt/down') . "?zd=" . $zd . "&key=" . $key . "&kstime=" . $kstime . "&jstime=" . $jstime;
     $per_page = 15;
     $totalPages = ceil($total / $per_page);
     // 总页数
     $data['nums'] = $total;
     if ($total < $per_page) {
         $per_page = $total;
     }
     $sql_string .= ' limit ' . $per_page * ($page - 1) . ',' . $per_page;
     $query = $this->db->query($sql_string);
     $data['down'] = $query->result();
     $data['pages'] = get_admin_page($base_url, $totalPages, $page, 10);
     //获取分页类
     $this->load->view('down.html', $data);
 }
Exemplo n.º 16
0
 public function index()
 {
     $ac = $this->input->get('ac', true);
     $op = $this->input->get('op', true);
     $do = $this->input->get('do', true);
     $rid = intval($this->input->get('rid'));
     if ($do == 'caiji') {
         //入库
         $api = $this->input->get('api', TRUE);
         $page = intval($this->input->get('page'));
         $cid = intval($this->input->get('cid'));
         $ac = $this->input->get('ac', TRUE);
         $ops = $this->input->get('op', TRUE);
         $key = $keys = $this->input->get('key', TRUE);
         $ids = $this->input->get('ids', TRUE);
         if ($page == 0) {
             $page = 1;
         }
         if ($ops == '24') {
             $ops = 'day';
         }
         if ($ops == 'day') {
             $op = 24;
         } elseif ($ops == 'week') {
             $op = 98;
         } else {
             $op = 0;
         }
         //绑定分类数组
         $LIST = (require_once APPPATH . 'config/bind.php');
         $api_url = '?api=' . $api . '&rid=' . $rid . '&op=' . $op . '&ac=' . $ac . '&do=caiji&key=' . $key . '&cid=' . $cid;
         if ($api) {
             $API_URL = cs_base64_decode($api) . '?ac=videolist&rid=' . $rid . '&wd=' . $key . '&t=' . $cid . '&h=' . $op . '&ids=' . $ids . '&pg=' . $page;
             $strs = htmlall($API_URL, 'gbk');
             if (empty($strs)) {
                 admin_msg('<font color=red>采集失败,请多试几次,如一直出现该错误,通常为网络不稳定或禁用了采集!</font>', 'javascript:history.go(-1);');
             }
             //组合分页信息
             preg_match('<list page="([0-9]+)" pagecount="([0-9]+)" pagesize="([0-9]+)" recordcount="([0-9]+)">', $strs, $page_array);
             if (!empty($page_array)) {
                 $recordcount = $page_array[4];
                 $pagecount = $page_array[2];
                 $pagesize = $page_array[3];
                 $pageindex = $page_array[1];
             } else {
                 $recordcount = 0;
                 $pagecount = 0;
                 $pagesize = 0;
                 $pageindex = 0;
             }
             echo '<LINK href="' . base_url() . 'packs/admin/css/style.css" type="text/css" rel="stylesheet"><br>';
             echo '<div id="loading" style="display:none;position: absolute;left:40%;top:300px;z-index:10;"><span style="width:100px;height:40px;line-height:40px;background-color:#ccc;">&nbsp;&nbsp;<img align="absmiddle" src="' . Web_Path . 'packs/admin/images/loading.gif">数据加载中</span></div>';
             echo "&nbsp;&nbsp;<b><font color=#0000ff>当前页共有" . $recordcount . "个数据,需要采集" . $pagecount . "次,每一次采集" . $pagesize . "个,正在执行第" . $pageindex . "次采集任务</font></b><br/>";
             //组合列表
             $vod = '';
             preg_match_all('/<video><last>([\\s\\S]*?)<\\/last><id>([0-9]+)<\\/id><tid>([0-9]+)<\\/tid><name><\\!\\[CDATA\\[([\\s\\S]*?)\\]\\]><\\/name><type>([\\s\\S]*?)<\\/type><pic>([\\s\\S]*?)<\\/pic><lang>([\\s\\S]*?)<\\/lang><area>([\\s\\S]*?)<\\/area><year>([\\s\\S]*?)<\\/year><state>([\\s\\S]*?)<\\/state><note><\\!\\[CDATA\\[([\\s\\S]*?)\\]\\]><\\/note><actor><\\!\\[CDATA\\[([\\s\\S]*?)\\]\\]><\\/actor><director><\\!\\[CDATA\\[([\\s\\S]*?)\\]\\]><\\/director><dl>([\\s\\S]*?)<\\/dl><des><\\!\\[CDATA\\[([\\s\\S]*?)\\]\\]><\\/des>([\\s\\S]*?)<\\/video>/', $strs, $vod_array);
             $s = 1;
             foreach ($vod_array[1] as $key => $value) {
                 $p = ($pageindex - 1) * $pagesize + $s;
                 $add['name'] = str_replace("'", "", htmlspecialchars_decode($vod_array[4][$key]));
                 $add['pic'] = $vod_array[6][$key];
                 $add['uid'] = 1;
                 $add['daoyan'] = str_replace(" ", "/", str_replace("'", "", htmlspecialchars_decode($vod_array[13][$key])));
                 $add['zhuyan'] = str_replace(" ", "/", str_replace("'", "", htmlspecialchars_decode($vod_array[12][$key])));
                 $add['year'] = $vod_array[9][$key];
                 $add['diqu'] = $vod_array[8][$key];
                 $add['yuyan'] = $vod_array[7][$key];
                 $add['remark'] = empty($vod_array[10][$key]) ? '完结' : $vod_array[10][$key];
                 $add['text'] = str_replace("'", "", htmlspecialchars_decode($vod_array[15][$key]));
                 $add['addtime'] = time();
                 $add['daoyan'] = str_replace("//", "/", $add['daoyan']);
                 $add['zhuyan'] = str_replace("//", "/", $add['zhuyan']);
                 preg_match_all('/<dd flag="([\\s\\S]*?)"><\\!\\[CDATA\\[([\\s\\S]*?)\\]\\]><\\/dd>/', $vod_array[14][$key], $url_arr);
                 $laiy = $url_arr[1];
                 $purl = implode('#cscms#', $url_arr[2]);
                 $purl = htmlspecialchars_decode($purl);
                 $purl = str_replace("xigua", "xgvod", $purl);
                 $purl = str_replace("xfplay", "yyxf", $purl);
                 $purl = str_replace("yyxf://", "xfplay://", $purl);
                 $purl = str_replace("百度影音", "bdhd", $purl);
                 $purl = str_replace("#", "\n", $purl);
                 $purl = str_replace("\ncscms\n", "#cscms#", $purl);
                 $purl = str_replace("\r", "", $purl);
                 $add['purl'] = $purl;
                 //判断绑定
                 $val = arr_key_value($LIST, $ac . '_' . $vod_array[3][$key]);
                 if (!$val) {
                     echo "&nbsp;&nbsp;&nbsp;第" . $p . "个影片&nbsp;<font color=red>" . $vod_array[4][$key] . "</font>&nbsp;&nbsp;数据没有绑定分类,不进行入库处理!<br/>";
                     //判断数据完整性
                 } elseif (empty($vod_array[4][$key]) || empty($purl)) {
                     echo "&nbsp;&nbsp;&nbsp;第" . $p . "个影片&nbsp;<font color=red>" . $vod_array[4][$key] . "</font>&nbsp;&nbsp;数据不完整,不进行入库处理!<br/>";
                 } else {
                     $add['cid'] = $val;
                     //判断数据是否存在
                     $sql = "SELECT id,purl,remark FROM " . CS_SqlPrefix . "vod where name='" . $add['name'] . "'";
                     $row = $this->db->query($sql)->row();
                     if (!$row) {
                         $this->CsdjDB->get_insert('vod', $add);
                         echo "&nbsp;&nbsp;&nbsp;第" . $p . "个影片&nbsp;<font color=#ff00ff>" . $vod_array[4][$key] . "</font>数据库中没有记录,已入库完成!<br/>";
                     } else {
                         //判断更新状态
                         if ($row->remark == $add['remark'] && strpos($row->purl, '$' . $ac) !== FALSE) {
                             echo "&nbsp;&nbsp;&nbsp;第" . $p . "个影片&nbsp;<font color=#ff6600>" . $vod_array[4][$key] . "</font>&nbsp;&nbsp;数据相同,暂无不需要更新<br/>";
                         } else {
                             //判断来源
                             $lyid = 0;
                             $lyarr = explode("#cscms#", $row->purl);
                             for ($i = 0; $i < count($lyarr); $i++) {
                                 $ly = explode("\$", $lyarr[$i]);
                                 if (in_array($ly[2], $laiy)) {
                                     $lyid = 1;
                                     $laiyname = $ly[2];
                                     break;
                                 }
                             }
                             if ($lyid == 0) {
                                 //来源不存在
                                 $edit['purl'] = $row->purl . '#cscms#' . $purl;
                                 echo "&nbsp;&nbsp;&nbsp;第" . $p . "个影片&nbsp;<font color=#ff00ff>" . $vod_array[4][$key] . "</font>&nbsp;&nbsp;数据存在,增加一组来源数据成功~!<br/>";
                             } else {
                                 $url_all = explode("#cscms#", $row->purl);
                                 $CS_PlayUrl = '';
                                 for ($j = 0; $j < count($url_all); $j++) {
                                     $url_aa = explode("\n", $url_all[$j]);
                                     $url_ss = explode("\$", $url_aa[0]);
                                     if ($url_ss[2] == $laiyname) {
                                         $ji = count($url_aa);
                                         $CS_PlayUrl = $url_all[$j];
                                         break;
                                     }
                                 }
                                 $edit['remark'] = $add['remark'];
                                 $edit['purl'] = str_replace($CS_PlayUrl, $purl, $row->purl);
                                 echo "&nbsp;&nbsp;&nbsp;第" . $p . "个影片&nbsp;<font color=#ff00ff>" . $vod_array[4][$key] . "</font>&nbsp;&nbsp;数据存在,数据更新成功~!<br/>";
                             }
                             //更新数据
                             $edit['addtime'] = time();
                             $this->CsdjDB->get_update('vod', $row->id, $edit);
                         }
                     }
                 }
                 $s++;
             }
             if ($pageindex < $pagecount) {
                 //缓存断点续采
                 $jumpurl = site_url('vod/admin/apiku') . $api_url . '&page=' . ($page + 1);
                 write_file(APPPATH . "config/jumpurl.txt", $jumpurl);
                 //跳转到下一页
                 echo "</br>&nbsp;&nbsp;&nbsp;<a href='" . site_url('vod/admin/apiku') . "?api=" . $api . "&op=" . $ops . "&ac=" . $ac . "&key=" . $keys . "&cid=" . $cid . "'>紧急停止</a>&nbsp;&nbsp;&nbsp;<b>&nbsp;第<font color=red>" . $page . "</font>页入库完毕,暂停<font color=red>3</font>秒继续。。。。。</b><script>setTimeout('updatenext();',3000);\r\n\t\t\t\t\t\t\t\tfunction updatenext(){\r\n\t\t\t\t\t\t\t\t\tdocument.getElementById('loading').style.display = 'block';\r\n\t\t\t\t\t\t\t\t\tlocation.href='" . $api_url . "&page=" . ($page + 1) . "';\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t</script></br></br>";
             } else {
                 //清除断点续采
                 write_file(APPPATH . "config/jumpurl.txt", "0");
                 echo "</br>&nbsp;&nbsp;&nbsp;&nbsp;<b>恭喜您,全部入库完成啦。。。。。</b><script>\r\n\t\t\t\t\t\t\t\tsetTimeout('updatenext();',3000);\r\n\t\t\t\t\t\t\t\tfunction updatenext(){\r\n\t\t\t\t\t\t\t\t\tdocument.getElementById('loading').style.display = 'block';\r\n\t\t\t\t\t\t\t\t\tlocation.href='" . site_url('vod/admin/apiku') . str_replace("&do=caiji", "", $api_url) . "';\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t</script>";
             }
         } else {
             admin_msg('<font color=red>API错误!</font>', 'javascript:history.go(-1);');
         }
     } elseif (!empty($ac)) {
         //资源库查看
         $api = $this->input->get('api', TRUE);
         $page = intval($this->input->get('page'));
         $cid = intval($this->input->get('cid'));
         $ac = $this->input->get('ac', TRUE);
         $op = $this->input->get('op', TRUE);
         $key = $this->input->get('key', TRUE);
         if ($page == 0) {
             $page = 1;
         }
         if ($op == 'all') {
             $op = 0;
         }
         $data['api_url'] = '?api=' . $api . '&rid=' . $rid . '&op=' . $op . '&ac=' . $ac . '&key=' . $key . '&cid=' . $cid;
         $data['key'] = $key;
         $data['op'] = $op;
         $data['cid'] = $cid;
         $data['rid'] = $rid;
         $data['api'] = $api;
         if ($api) {
             $API_URL = cs_base64_decode($api) . '?ac=list&rid=' . $rid . '&wd=' . $key . '&t=' . $cid . '&h=0&ids=&pg=' . $page;
             $strs = htmlall($API_URL, 'gbk');
             if (empty($strs)) {
                 admin_msg('<font color=red>获取列表失败,请多试几次,如一直出现该错误,通常为网络不稳定或禁用了采集!</font>', 'javascript:history.go(-1);');
             }
             //组合分页信息
             preg_match('<list page="([0-9]+)" pagecount="([0-9]+)" pagesize="([0-9]+)" recordcount="([0-9]+)">', $strs, $page_array);
             $data['recordcount'] = $page_array[4];
             $data['pagecount'] = $page_array[2];
             $data['pagesize'] = $page_array[3];
             $data['pageindex'] = $page_array[1];
             $path = site_url('vod/admin/apiku') . $data['api_url'] . '&key=' . $key . '&cid=' . $cid . '&';
             $data['pages'] = get_admin_page($data['api_url'], $data['pagecount'], $page, 10);
             //组合列表
             $vod = '';
             preg_match_all('/<video>([\\s\\S]*?)<\\/video>/', $strs, $vod_array);
             foreach ($vod_array[1] as $key => $value) {
                 preg_match_all('/<last>([\\s\\S]*?)<\\/last>/', $value, $times);
                 preg_match_all('/<id>([0-9]+)<\\/id>/', $value, $ids);
                 preg_match_all('/<tid>([0-9]+)<\\/tid>/', $value, $cids);
                 preg_match_all('/<name><\\!\\[CDATA\\[([\\s\\S]*?)\\]\\]><\\/name>/', $value, $names);
                 preg_match_all('/<type>([\\s\\S]*?)<\\/type>/', $value, $cnames);
                 preg_match_all('/<dt>([\\s\\S]*?)<\\/dt>/', $value, $dts);
                 $vod[$key]['addtime'] = $times[1][0];
                 $vod[$key]['id'] = $ids[1][0];
                 $vod[$key]['cid'] = intval($cids[1][0]);
                 $vod[$key]['name'] = $names[1][0];
                 $vod[$key]['laiy'] = !empty($dts[1][0]) ? Laiyuan($dts[1][0]) : $ac;
                 $vod[$key]['cname'] = $cnames[1][0];
             }
             $data['vod'] = $vod;
             //组合分类
             preg_match_all('/<ty id="([0-9]+)">([\\s\\S]*?)<\\/ty>/', $strs, $list_array);
             foreach ($list_array[1] as $key => $value) {
                 $vod_list[$key]['id'] = $value;
                 $vod_list[$key]['name'] = $list_array[2][$key];
             }
             $data['vod_list'] = $vod_list;
             $data['ac'] = $ac;
             $data['page'] = $page;
             $data['LIST'] = (require_once APPPATH . 'config/bind.php');
             $this->load->view('apiku_list.html', $data);
         } else {
             admin_msg('<font color=red>API错误!</font>', 'javascript:history.go(-1);');
         }
     } elseif (empty($do)) {
         //资源库首页
         $data['jumpurl'] = @file_get_contents(APPPATH . "config/jumpurl.txt");
         $data['api'] = 'http://vod.chshcms.com/api/cscms_zy_4.x_utf8.js?' . rand(1000, 9999);
         $this->load->view('apiku.html', $data);
     }
 }