Example #1
0
 public function index()
 {
     $skin = $this->uri->segment(4);
     //模板
     //模板
     $tpl = 'index.html';
     //当前会员
     $uid = get_home_uid();
     $row = $this->CsdjDB->get_row_arr('user', '*', $uid);
     if (empty($row['nichen'])) {
         $row['nichen'] = $row['name'];
     }
     //装载模板
     $title = $row['nichen'] . L('index_01');
     $ids['uid'] = $row['id'];
     $ids['uida'] = $row['id'];
     if (!empty($skin) && file_exists(CSCMS . 'tpl/home/' . $skin . '/config.php')) {
         $arr = (require CSCMS . 'tpl/home/' . $skin . '/config.php');
         $row['skins'] = $arr['path'];
     }
     $Mark_Text = $this->CsdjTpl->home_list($row, 'index', 1, $tpl, $title, $ids, '', '', true, false);
     $Mark_Text = $this->skins->labelif($Mark_Text);
     //增加人气
     $Mark_Text = hits_js($Mark_Text, hitslink('hits/ids/' . $uid, 'home'));
     echo $Mark_Text;
     $this->cache->end();
     //由于前面不是直接输出,所以这里需要加入写缓存
 }
Example #2
0
 public function show($id = 0)
 {
     $id = intval($id);
     //ID
     //判断ID
     if ($id == 0) {
         msg_url('出错了,ID不能为空!', Web_Path);
     }
     //获取数据
     $row = $this->CsdjDB->get_row_arr('news_topic', '*', $id);
     if (!$row || $row['yid'] > 0) {
         msg_url('出错了,该专题不存在!', Web_Path);
     }
     //判断运行模式,生成则跳转至静态页面
     $html = config('Html_Uri');
     if (config('Web_Mode') == 3 && $html['topic/show']['check'] == 1) {
         //获取静态路径
         $Htmllink = LinkUrl('topic', 'show', $id, 1, 'news');
         header("Location: " . $Htmllink);
         exit;
     }
     //装载模板并输出
     $Mark_Text = $this->CsdjTpl->plub_show('topic', $row, $id, true, 'topic-show.html', $row['name'], $row['name']);
     //评论
     $Mark_Text = str_replace("[topic:pl]", get_pl('news', $id, 1), $Mark_Text);
     //增加人气
     $Mark_Text = hits_js($Mark_Text, hitslink('hits/ids/' . $id . '/topic', 'news'));
     echo $Mark_Text;
     $this->cache->end();
     //由于前面不是直接输出,所以这里需要加入写缓存
 }
Example #3
0
 public function index($id = 0)
 {
     $id = intval($id);
     //ID
     //判断ID
     if ($id == 0) {
         msg_url('出错了,ID不能为空!', Web_Path);
     }
     //获取数据
     $row = $this->CsdjDB->get_row_arr('singer', '*', $id);
     if (!$row || $row['yid'] > 0 || $row['hid'] > 0) {
         msg_url('出错了,该歌手不存在!', Web_Path);
     }
     //判断运行模式,生成则跳转至静态页面
     $html = config('Html_Uri');
     if (config('Web_Mode') == 3 && $html['show']['check'] == 1) {
         //获取静态路径
         $Htmllink = LinkUrl('show', 'id', $id, 0, 'singer');
         header("Location: " . $Htmllink);
         exit;
     }
     $arr['cid'] = getChild($row['cid']);
     $arr['tags'] = $row['tags'];
     $arr['singerid'] = $id;
     //摧毁部分需要超级链接字段数组
     $rows = $row;
     //先保存数组保留下面使用
     unset($row['tags']);
     //装载模板并输出
     $Mark_Text = $this->CsdjTpl->plub_show('singer', $row, $arr, TRUE, 'show.html', $row['name'], $row['name']);
     //评论
     $Mark_Text = str_replace("[singer:pl]", get_pl('singer', $id), $Mark_Text);
     //分类地址、名称
     $Mark_Text = str_replace("[singer:link]", LinkUrl('show', 'id', $row['id'], 1, 'singer'), $Mark_Text);
     $Mark_Text = str_replace("[singer:classlink]", LinkUrl('lists', 'id', $row['cid'], 1, 'singer'), $Mark_Text);
     $Mark_Text = str_replace("[singer:classname]", $this->CsdjDB->getzd('singer_list', 'name', $row['cid']), $Mark_Text);
     //标签加超级连接
     $Mark_Text = str_replace("[singer:tags]", SearchLink($rows['tags']), $Mark_Text);
     //增加人气
     $Mark_Text = hits_js($Mark_Text, hitslink('hits/ids/' . $id, 'singer'));
     echo $Mark_Text;
     $this->cache->end();
     //由于前面不是直接输出,所以这里需要加入写缓存
 }
Example #4
0
 public function index($fid = 'id', $id = 0)
 {
     $id = intval($fid) > 0 ? intval($fid) : intval($id);
     //ID
     //判断ID
     if ($id == 0) {
         msg_url(L('dance_09'), Web_Path);
     }
     //获取数据
     $row = $this->CsdjDB->get_row_arr('dance', '*', $id);
     if (!$row || $row['yid'] > 0 || $row['hid'] > 0) {
         msg_url(L('dance_10'), Web_Path);
     }
     //判断运行模式,生成则跳转至静态页面
     $html = config('Html_Uri');
     if (config('Web_Mode') == 3 && $html['play']['check'] == 1) {
         //获取静态路径
         $Htmllink = LinkUrl('play', 'id', $id, 0, 'dance');
         header("Location: " . $Htmllink);
         exit;
     }
     //摧毁部分需要超级链接字段数组
     $rows = $row;
     //先保存数组保留下面使用
     unset($row['tags']);
     //获取当前分类下二级分类ID
     $arr['cid'] = getChild($row['cid']);
     $arr['uid'] = $row['uid'];
     $arr['did'] = $row['id'];
     $arr['singerid'] = $row['singerid'];
     $arr['tags'] = $rows['tags'];
     //装载模板并输出
     $skins = empty($row['skins']) ? 'play.html' : $row['skins'];
     $Mark_Text = $this->CsdjTpl->plub_show('dance', $row, $arr, TRUE, $skins, $row['name'], $row['name']);
     //评论
     $Mark_Text = str_replace("[dance:pl]", get_pl('dance', $id), $Mark_Text);
     //分类地址、名称
     $Mark_Text = str_replace("[dance:link]", LinkUrl('play', 'id', $row['id'], 1, 'news'), $Mark_Text);
     $Mark_Text = str_replace("[dance:classlink]", LinkUrl('lists', 'id', $row['cid'], 1, 'dance'), $Mark_Text);
     $Mark_Text = str_replace("[dance:classname]", $this->CsdjDB->getzd('dance_list', 'name', $row['cid']), $Mark_Text);
     //专辑
     if ($row['tid'] == 0) {
         $Mark_Text = str_replace("[dance:topiclink]", "###", $Mark_Text);
         $Mark_Text = str_replace("[dance:topicname]", L('dance_11'), $Mark_Text);
     } else {
         $Mark_Text = str_replace("[dance:topiclink]", LinkUrl('topic', 'show', $row['tid'], 1, 'dance'), $Mark_Text);
         $Mark_Text = str_replace("[dance:topicname]", $this->CsdjDB->getzd('dance_topic', 'name', $row['tid']), $Mark_Text);
     }
     //获取上下曲
     preg_match_all('/[dance:slink]/', $Mark_Text, $arr);
     if (!empty($arr[0]) && !empty($arr[0][0])) {
         $rowd = $this->db->query("Select id,cid,name from " . CS_SqlPrefix . "dance where yid=0 and hid=0 and id<" . $id . " order by id desc limit 1")->row();
         if ($rowd) {
             $Mark_Text = str_replace("[dance:slink]", LinkUrl('play', 'id', $rowd->id, 1, 'dance'), $Mark_Text);
             $Mark_Text = str_replace("[dance:sname]", $rowd->name, $Mark_Text);
             $Mark_Text = str_replace("[dance:sid]", $rowd->id, $Mark_Text);
         } else {
             $Mark_Text = str_replace("[dance:slink]", "#", $Mark_Text);
             $Mark_Text = str_replace("[dance:sname]", L('dance_20'), $Mark_Text);
             $Mark_Text = str_replace("[dance:sid]", 0, $Mark_Text);
         }
     }
     unset($arr);
     preg_match_all('/[dance:xlink]/', $Mark_Text, $arr);
     if (!empty($arr[0]) && !empty($arr[0][0])) {
         $rowd = $this->db->query("Select id,cid,name from " . CS_SqlPrefix . "dance where yid=0 and hid=0 and id>" . $id . " order by id asc limit 1")->row();
         if ($rowd) {
             $Mark_Text = str_replace("[dance:xlink]", LinkUrl('play', 'id', $rowd->id, 1, 'dance'), $Mark_Text);
             $Mark_Text = str_replace("[dance:xname]", $rowd->name, $Mark_Text);
             $Mark_Text = str_replace("[dance:xid]", $rowd->id, $Mark_Text);
         } else {
             $Mark_Text = str_replace("[dance:xlink]", "#", $Mark_Text);
             $Mark_Text = str_replace("[dance:xname]", L('dance_20'), $Mark_Text);
             $Mark_Text = str_replace("[dance:xid]", 0, $Mark_Text);
         }
     }
     unset($arr);
     //标签加超级连接
     $Mark_Text = str_replace("[dance:tags]", SearchLink($rows['tags']), $Mark_Text);
     //歌曲完整试听地址
     preg_match_all('/[dance:qurl]/', $Mark_Text, $arr);
     if (!empty($arr[0]) && !empty($arr[0][0])) {
         $purl = $row['purl'];
         if ($row['fid'] > 0) {
             $rowf = $this->db->query("Select purl from " . CS_SqlPrefix . "dance_server where id=" . $row['fid'] . "")->row_array();
             if ($rowf) {
                 $purl = $rowf['purl'] . $row['purl'];
             }
         }
         $purl = annexlink($purl);
         $Mark_Text = str_replace("[dance:qurl]", $purl, $Mark_Text);
     }
     unset($arr);
     //cmp音频播放器
     $player = "<script type='text/javascript'>\r\n\t\t\tvar mp3_w='" . CS_Play_w . "';\r\n\t\t\tvar mp3_h='" . CS_Play_h . "';\r\n\t\t\tvar mp3_i='" . $id . "';\r\n\t\t\tvar mp3_p='" . hitslink('play', 'dance') . "';\r\n\t\t\tvar mp3_t='" . Web_Path . "';\r\n\t\t\tmp3_play();\r\n\t\t\t</script>";
     $Mark_Text = str_replace("[dance:player]", $player, $Mark_Text);
     //jp音频播放器
     $jplayer = "<script type='text/javascript'>\r\n\t\t\tvar mp3_i='" . $id . "';\r\n\t\t\tvar mp3_p='" . hitslink('play', 'dance') . "';\r\n\t\t\tvar mp3_n='" . str_replace("'", "", $row['name']) . "';\r\n\t\t\tvar mp3_x='" . LinkUrl('down', 'id', $row['id'], 1, 'dance') . "';\r\n\t\t\tvar mp3_l='" . LinkUrl('down', 'lrc', $row['id'], 1, 'dance') . "';\r\n\t\t\tmp3_jplayer();\r\n\t\t\t</script>";
     $Mark_Text = str_replace("[dance:jplayer]", $jplayer, $Mark_Text);
     //增加人气
     $Mark_Text = hits_js($Mark_Text, hitslink('hits/ids/' . $id, 'dance'));
     echo $Mark_Text;
     $this->cache->end();
     //由于前面不是直接输出,所以这里需要加入写缓存
 }
Example #5
0
 public function index($fid = 'id', $id = 0)
 {
     $id = intval($fid) > 0 ? intval($fid) : intval($id);
     //ID
     //判断ID
     if ($id == 0) {
         msg_url('出错了,ID不能为空!', Web_Path);
     }
     //获取数据
     $row = $this->CsdjDB->get_row_arr('news', '*', $id);
     if (!$row || $row['yid'] > 0 || $row['hid'] > 0) {
         msg_url('出错了,该数据不存在或者没有审核!', Web_Path);
     }
     //判断运行模式,生成则跳转至静态页面
     $html = config('Html_Uri');
     if (config('Web_Mode') == 3 && $html['show']['check'] == 1) {
         //获取静态路径
         $Htmllink = LinkUrl('show', $fid, $id, 0, 'news');
         header("Location: " . $Htmllink);
         exit;
     }
     //摧毁部分需要超级链接字段数组
     $rows = $row;
     //先保存数组保留下面使用
     unset($row['tags']);
     unset($row['content']);
     //获取当前分类下二级分类ID
     $arr['cid'] = getChild($row['cid']);
     $arr['uid'] = $row['uid'];
     $arr['tags'] = $rows['tags'];
     //默认模板
     $skins = empty($row['skins']) ? 'show.html' : $row['skins'];
     //装载模板并输出
     $Mark_Text = $this->CsdjTpl->plub_show('news', $row, $arr, TRUE, $skins, $row['name'], $row['name']);
     //评论
     $Mark_Text = str_replace("[news:pl]", get_pl('news', $id), $Mark_Text);
     //分类地址、名称
     $Mark_Text = str_replace("[news:link]", LinkUrl('show', 'id', $row['id'], 1, 'news'), $Mark_Text);
     $Mark_Text = str_replace("[news:classlink]", LinkUrl('lists', 'id', $row['cid'], 1, 'news'), $Mark_Text);
     $Mark_Text = str_replace("[news:classname]", $this->CsdjDB->getzd('news_list', 'name', $row['cid']), $Mark_Text);
     //获取上下篇
     preg_match_all('/[news:slink]/', $Mark_Text, $arr);
     if (!empty($arr[0]) && !empty($arr[0][0])) {
         $rowd = $this->db->query("Select id,cid,name from " . CS_SqlPrefix . "news where yid=0 and hid=0 and id<" . $id . " order by id desc limit 1")->row();
         if ($rowd) {
             $Mark_Text = str_replace("[news:slink]", LinkUrl('show', 'id', $rowd->id, 1, 'news'), $Mark_Text);
             $Mark_Text = str_replace("[news:sname]", $rowd->name, $Mark_Text);
             $Mark_Text = str_replace("[news:sid]", $rowd->id, $Mark_Text);
         } else {
             $Mark_Text = str_replace("[news:slink]", "#", $Mark_Text);
             $Mark_Text = str_replace("[news:sname]", "没有了", $Mark_Text);
             $Mark_Text = str_replace("[news:sid]", 0, $Mark_Text);
         }
     }
     unset($arr);
     preg_match_all('/[news:xlink]/', $Mark_Text, $arr);
     if (!empty($arr[0]) && !empty($arr[0][0])) {
         $rowd = $this->db->query("Select id,cid,name from " . CS_SqlPrefix . "news where yid=0 and hid=0 and id>" . $id . " order by id asc limit 1")->row();
         if ($rowd) {
             $Mark_Text = str_replace("[news:xlink]", LinkUrl('show', 'id', $rowd->id, 1, 'news'), $Mark_Text);
             $Mark_Text = str_replace("[news:xname]", $rowd->name, $Mark_Text);
             $Mark_Text = str_replace("[news:xid]", $rowd->id, $Mark_Text);
         } else {
             $Mark_Text = str_replace("[news:xlink]", "#", $Mark_Text);
             $Mark_Text = str_replace("[news:xname]", "没有了", $Mark_Text);
             $Mark_Text = str_replace("[news:xid]", 0, $Mark_Text);
         }
     }
     unset($arr);
     //标签加超级连接
     $Mark_Text = str_replace("[news:tags]", SearchLink($rows['tags']), $Mark_Text);
     //文章内容,判断是否是收费文章
     if ($row['vip'] > 0 || $row['level'] > 0 || $row['cion'] > 0) {
         $content = "<div id='cscms_content'></div>";
         if (config('Ym_Mode', 'news') == 1) {
             $content .= "<script type='text/javascript' src='http://" . config('Ym_Url', 'news') . Web_Path . "index.php/show/pay/" . $id . "'></script>";
         } else {
             $content .= "<script type='text/javascript' src='http://" . Web_Url . Web_Path . "index.php/news/show/pay/" . $id . "'></script>";
         }
     } else {
         $content = $rows['content'];
     }
     $Mark_Text = str_replace("[news:content]", $content, $Mark_Text);
     //增加人气
     $Mark_Text = hits_js($Mark_Text, hitslink('hits/ids/' . $id, 'news'));
     echo $Mark_Text;
     $this->cache->end();
     //由于前面不是直接输出,所以这里需要加入写缓存
 }
Example #6
0
 public function index($fid = 'id', $id = 0)
 {
     $id = intval($fid) > 0 ? intval($fid) : intval($id);
     //ID
     //判断ID
     if ($id == 0) {
         msg_url('出错了,ID不能为空!', Web_Path);
     }
     //获取数据
     $row = $this->CsdjDB->get_row_arr('pic_type', '*', $id);
     if (!$row || $row['yid'] > 0 || $row['hid'] > 0) {
         msg_url('出错了,该数据不存在或者没有审核!', Web_Path);
     }
     //判断运行模式,生成则跳转至静态页面
     $html = config('Html_Uri');
     if (config('Web_Mode') == 3 && $html['show']['check'] == 1) {
         //获取静态路径
         $Htmllink = LinkUrl('show', $fid, $id, 0, 'pic');
         header("Location: " . $Htmllink);
         exit;
     }
     //摧毁部分需要超级链接字段数组
     $rows = $row;
     //先保存数组保留下面使用
     unset($row['tags']);
     //获取当前分类下二级分类ID
     $arr['cid'] = getChild($row['cid']);
     $arr['uid'] = $row['uid'];
     $arr['tags'] = $rows['tags'];
     $arr['sid'] = $row['id'];
     //默认模板
     $skins = empty($row['skins']) ? 'show.html' : $row['skins'];
     //装载模板并输出
     $Mark_Text = $this->CsdjTpl->plub_show('pic', $row, $arr, TRUE, $skins, $row['name'], $row['name']);
     //评论
     $Mark_Text = str_replace("[pic:pl]", get_pl('pic', $id), $Mark_Text);
     //分类地址、名称
     $Mark_Text = str_replace("[pic:link]", LinkUrl('show', 'id', $row['id'], 1, 'pic'), $Mark_Text);
     $Mark_Text = str_replace("[pic:classlink]", LinkUrl('lists', 'id', $row['cid'], 1, 'pic'), $Mark_Text);
     $Mark_Text = str_replace("[pic:classname]", $this->CsdjDB->getzd('pic_list', 'name', $row['cid']), $Mark_Text);
     //获取上下张
     preg_match_all('/[pic:slink]/', $Mark_Text, $arr);
     if (!empty($arr[0]) && !empty($arr[0][0])) {
         $rowd = $this->db->query("Select id,cid,pic,name from " . CS_SqlPrefix . "pic_type where yid=0 and hid=0 and id<" . $id . " order by id desc limit 1")->row();
         if ($rowd) {
             $Mark_Text = str_replace("[pic:slink]", LinkUrl('show', 'id', $rowd->id, 1, 'pic'), $Mark_Text);
             $Mark_Text = str_replace("[pic:sname]", $rowd->name, $Mark_Text);
             $Mark_Text = str_replace("[pic:sid]", $rowd->id, $Mark_Text);
             $Mark_Text = str_replace("[pic:spic]", piclink('pic', $rowd->pic), $Mark_Text);
         } else {
             $Mark_Text = str_replace("[pic:slink]", "#", $Mark_Text);
             $Mark_Text = str_replace("[pic:sname]", "没有了", $Mark_Text);
             $Mark_Text = str_replace("[pic:sid]", 0, $Mark_Text);
             $Mark_Text = str_replace("[pic:spic]", piclink('pic', ''), $Mark_Text);
         }
     }
     unset($arr);
     preg_match_all('/[pic:xlink]/', $Mark_Text, $arr);
     if (!empty($arr[0]) && !empty($arr[0][0])) {
         $rowd = $this->db->query("Select id,cid,pic,name from " . CS_SqlPrefix . "pic_type where yid=0 and hid=0 and id>" . $id . " order by id asc limit 1")->row();
         if ($rowd) {
             $Mark_Text = str_replace("[pic:xlink]", LinkUrl('show', 'id', $rowd->id, 1, 'pic'), $Mark_Text);
             $Mark_Text = str_replace("[pic:xname]", $rowd->name, $Mark_Text);
             $Mark_Text = str_replace("[pic:xid]", $rowd->id, $Mark_Text);
             $Mark_Text = str_replace("[pic:xpic]", piclink('pic', $rowd->pic), $Mark_Text);
         } else {
             $Mark_Text = str_replace("[pic:xlink]", "#", $Mark_Text);
             $Mark_Text = str_replace("[pic:xname]", "没有了", $Mark_Text);
             $Mark_Text = str_replace("[pic:xid]", 0, $Mark_Text);
             $Mark_Text = str_replace("[pic:xpic]", piclink('pic', ''), $Mark_Text);
         }
     }
     unset($arr);
     //标签加超级连接
     $Mark_Text = str_replace("[pic:tags]", SearchLink($rows['tags']), $Mark_Text);
     //获取当前相册总数
     $pcount = $this->db->query("Select id from " . CS_SqlPrefix . "pic where sid=" . $id . " and hid=0 and yid=0")->num_rows();
     $Mark_Text = str_replace("[pic:count]", $pcount, $Mark_Text);
     //第一张图片
     $rowp = $this->db->query("Select pic,content from " . CS_SqlPrefix . "pic where sid=" . $id . " and hid=0 and yid=0 order by id desc limit 1")->row();
     $pics = $rowp ? $rowp->pic : '';
     $content = $rowp ? $rowp->content : '';
     $Mark_Text = str_replace("[pic:url]", piclink('pic', $pics), $Mark_Text);
     $Mark_Text = str_replace("[pic:content]", $content, $Mark_Text);
     //增加人气
     $Mark_Text = hits_js($Mark_Text, hitslink('hits/ids/' . $id, 'pic'));
     echo $Mark_Text;
     $this->cache->end();
     //由于前面不是直接输出,所以这里需要加入写缓存
 }
Example #7
0
 public function show_save()
 {
     if ($this->huri['show']['check'] == 0) {
         admin_msg('相册内容页未开启生成~!', 'javascript:history.back();', 'no');
     }
     $day = intval($this->input->get_post('day', true));
     //最近几天
     $ids = $this->input->get_post('ids', true);
     //需要生成的数据ID
     $cid = $this->input->get_post('cid', true);
     //需要生成的分类ID
     $newid = intval($this->input->get_post('newid'));
     //最新个数
     $ksid = intval($this->input->get_post('ksid'));
     //开始ID
     $jsid = intval($this->input->get_post('jsid'));
     //结束ID
     $kstime = $this->input->get_post('kstime', true);
     //开始日期
     $jstime = $this->input->get_post('jstime', true);
     //结束日期
     $pagesize = intval($this->input->get('pagesize'));
     //每页多少条
     $pagejs = intval($this->input->get('pagejs'));
     //总页数
     $datacount = intval($this->input->get('datacount'));
     //数据总数
     $page = intval($this->input->get('page'));
     //当前页
     if ($page == 0) {
         $page = 1;
     }
     $str = '';
     //将数组转换成字符
     if (is_array($cid)) {
         $cid = implode(',', $cid);
     }
     if (is_array($ids)) {
         $ids = implode(',', $ids);
     }
     if ($day > 0) {
         $times = time() - 86400 * $day;
         $str .= ' and addtime>' . $times . '';
     }
     if (!empty($cid)) {
         $str .= ' and cid in (' . $cid . ')';
     }
     if (!empty($ids)) {
         $str .= ' and id in (' . $ids . ')';
     }
     if ($ksid > 0 && $jsid > 0) {
         $str .= ' and id>' . ($ksid - 1) . ' and id<' . ($jsid + 1) . '';
     }
     if (!empty($kstime) && !empty($jstime)) {
         $ktime = strtotime($kstime) - 86400;
         $jtime = strtotime($jstime) + 86400;
         $str .= ' and addtime>' . $ktime . ' and addtime<' . $jtime . '';
     }
     $limit = '';
     if ($newid > 0) {
         $limit = ' order by id desc limit ' . $newid;
     }
     if ($datacount == 0) {
         $sqlstr = "select id from " . CS_SqlPrefix . "pic_type where yid=0 and hid=0 " . $str . $limit;
         $datacount = $this->db->query($sqlstr)->num_rows();
         //总数量
         $pagejs = ceil($datacount / Html_PageNum);
     }
     if ($datacount == 0) {
         $pagejs = 1;
     }
     $pagesize = Html_PageNum;
     if ($datacount < $pagesize) {
         $pagesize = $datacount;
     }
     //全部生成完毕
     if ($page > $pagejs) {
         admin_msg('所有内容页全部生成完毕~!', site_url('pic/admin/html/show'));
     }
     //公众URI
     $uri = '?day=' . $day . '&cid=' . $cid . '&ids=' . $ids . '&newid=' . $newid . '&ksid=' . $ksid . '&jsid=' . $jsid . '&kstime=' . $kstime . '&jstime=' . $jstime . '&pagesize=' . $pagesize . '&pagejs=' . $pagejs . '&datacount=' . $datacount;
     //重新定义模板路径
     $this->load->get_templates('pic', 2);
     echo '<LINK href="' . base_url() . 'packs/admin/css/style.css" type="text/css" rel="stylesheet"><br>';
     echo '&nbsp;&nbsp;<b>正在开始生成相册内容,分<font color=red>' . $pagejs . '</font>次生成,当前第<font color=red>' . $page . '</font>次</b><br/>';
     $sql_string = "select * from " . CS_SqlPrefix . "pic_type where yid=0 and hid=0 " . $str . " order by id desc";
     $sql_string .= ' limit ' . $pagesize * ($page - 1) . ',' . $pagesize;
     $query = $this->db->query($sql_string);
     //获取内容页是否需要生成
     $html = config('Html_Uri', 'pic');
     foreach ($query->result_array() as $row) {
         ob_end_flush();
         //关闭缓存
         $id = $row['id'];
         //获取静态路径
         $Htmllinks = LinkUrl('show', 'id', $row['id'], 0, 'pic');
         //转换成生成路径
         $Htmllink = adminhtml($Htmllinks, 'pic');
         //摧毁部分需要超级链接字段数组
         $rows = $row;
         //先保存数组保留下面使用
         unset($row['tags']);
         unset($row['hits']);
         unset($row['yhits']);
         unset($row['zhits']);
         unset($row['rhits']);
         unset($row['dhits']);
         unset($row['chits']);
         unset($row['content']);
         //默认模板
         $skins = empty($row['skins']) ? 'show.html' : $row['skins'];
         $arr['cid'] = getChild($row['cid']);
         $arr['uid'] = $row['uid'];
         $arr['tags'] = $rows['tags'];
         $arr['sid'] = $row['id'];
         //装载模板并输出
         $Mark_Text = $this->CsdjTpl->plub_show('pic', $row, $arr, TRUE, $skins, $row['name'], $row['name']);
         //评论
         $Mark_Text = str_replace("[pic:pl]", get_pl('pic', $id), $Mark_Text);
         //分类地址、名称
         $Mark_Text = str_replace("[pic:link]", LinkUrl('show', 'id', $row['id'], 1, 'pic'), $Mark_Text);
         $Mark_Text = str_replace("[pic:classlink]", LinkUrl('lists', 'id', $row['cid'], 1, 'pic'), $Mark_Text);
         $Mark_Text = str_replace("[pic:classname]", $this->CsdjDB->getzd('pic_list', 'name', $row['cid']), $Mark_Text);
         //获取上下篇
         preg_match_all('/[pic:slink]/', $Mark_Text, $arr);
         if (!empty($arr[0]) && !empty($arr[0][0])) {
             $rowd = $this->db->query("Select id,cid,pic,name from " . CS_SqlPrefix . "pic_type where yid=0 and hid=0 and id<" . $id . " order by id desc limit 1")->row();
             if ($rowd) {
                 $Mark_Text = str_replace("[pic:slink]", LinkUrl('show', 'id', $rowd->id, 1, 'pic'), $Mark_Text);
                 $Mark_Text = str_replace("[pic:sname]", $rowd->name, $Mark_Text);
                 $Mark_Text = str_replace("[pic:sid]", $rowd->id, $Mark_Text);
                 $Mark_Text = str_replace("[pic:spic]", piclink('pic', $rowd->pic), $Mark_Text);
             } else {
                 $Mark_Text = str_replace("[pic:slink]", "#", $Mark_Text);
                 $Mark_Text = str_replace("[pic:sname]", "没有了", $Mark_Text);
                 $Mark_Text = str_replace("[pic:sid]", 0, $Mark_Text);
                 $Mark_Text = str_replace("[pic:spic]", piclink('pic', ''), $Mark_Text);
             }
         }
         unset($arr);
         preg_match_all('/[pic:xlink]/', $Mark_Text, $arr);
         if (!empty($arr[0]) && !empty($arr[0][0])) {
             $rowd = $this->db->query("Select id,cid,pic,name from " . CS_SqlPrefix . "pic_type where yid=0 and hid=0 and id>" . $id . " order by id asc limit 1")->row();
             if ($rowd) {
                 $Mark_Text = str_replace("[pic:xlink]", LinkUrl('show', 'id', $rowd->id, 1, 'pic'), $Mark_Text);
                 $Mark_Text = str_replace("[pic:xname]", $rowd->name, $Mark_Text);
                 $Mark_Text = str_replace("[pic:xid]", $rowd->id, $Mark_Text);
                 $Mark_Text = str_replace("[pic:xpic]", piclink('pic', $rowd->pic), $Mark_Text);
             } else {
                 $Mark_Text = str_replace("[pic:xlink]", "#", $Mark_Text);
                 $Mark_Text = str_replace("[pic:xname]", "没有了", $Mark_Text);
                 $Mark_Text = str_replace("[pic:xid]", 0, $Mark_Text);
                 $Mark_Text = str_replace("[pic:xpic]", piclink('pic', ''), $Mark_Text);
             }
         }
         unset($arr);
         //标签加超级连接
         $Mark_Text = str_replace("[pic:tags]", SearchLink($rows['tags']), $Mark_Text);
         //动态人气
         $Mark_Text = str_replace("[pic:hits]", "<script src='" . hitslink('hits/dt/hits/' . $id, 'pic') . "'></script>", $Mark_Text);
         $Mark_Text = str_replace("[pic:yhits]", "<script src='" . hitslink('hits/dt/yhits/' . $id, 'pic') . "'></script>", $Mark_Text);
         $Mark_Text = str_replace("[pic:zhits]", "<script src='" . hitslink('hits/dt/zhits/' . $id, 'pic') . "'></script>", $Mark_Text);
         $Mark_Text = str_replace("[pic:rhits]", "<script src='" . hitslink('hits/dt/rhits/' . $id, 'pic') . "'></script>", $Mark_Text);
         $Mark_Text = str_replace("[pic:dhits]", "<script src='" . hitslink('hits/dt/dhits/' . $id, 'pic') . "'></script>", $Mark_Text);
         $Mark_Text = str_replace("[pic:chits]", "<script src='" . hitslink('hits/dt/chits/' . $id, 'pic') . "'></script>", $Mark_Text);
         //获取当前相册总数
         $pcount = $this->db->query("Select id from " . CS_SqlPrefix . "pic where sid=" . $id . " and hid=0 and yid=0")->num_rows();
         $Mark_Text = str_replace("[pic:count]", $pcount, $Mark_Text);
         //第一张图片
         $rowp = $this->db->query("Select pic,content from " . CS_SqlPrefix . "pic where sid=" . $id . " and hid=0 and yid=0 order by id desc limit 1")->row();
         $pics = $rowp ? $rowp->pic : '';
         $content = $rowp ? $rowp->content : '';
         $Mark_Text = str_replace("[pic:url]", piclink('pic', $pics), $Mark_Text);
         $Mark_Text = str_replace("[pic:content]", $content, $Mark_Text);
         //增加人气
         $Mark_Text = hits_js($Mark_Text, hitslink('hits/ids/' . $id, 'pic'));
         //生成
         write_file(FCPATH . $Htmllink, $Mark_Text);
         echo "&nbsp;<font style=font-size:10pt;>生成相册:<font color=red>" . $row['name'] . "</font>成功:<a href=" . $Htmllinks . " target=_blank>" . $Htmllinks . "</a></font><br/>";
         ob_flush();
         flush();
     }
     if (!empty($ids)) {
         $url = 'javascript:history.back();';
         $str = "&nbsp;&nbsp;<b>全部生成完毕&nbsp;>>>>&nbsp;&nbsp;<a href='" . $url . "'>如果您的 浏览器没有跳转,请点击继续...</a></b>";
     } else {
         $url = site_url('pic/admin/html/show_save') . $uri . '&page=' . ($page + 1);
         $str = "&nbsp;&nbsp;<b>暂停" . Html_StopTime . "秒后继续&nbsp;>>>>&nbsp;&nbsp;<a href='" . $url . "'>如果您的 浏览器没有跳转,请点击继续...</a></b>";
     }
     echo "</br>" . $str . "<script>setTimeout('updatenext();'," . Html_StopTime . "000);function updatenext(){location.href='" . $url . "';}</script>";
 }
Example #8
0
 public function getplay($row)
 {
     //评论
     $dance_pl = get_pl('vod', $row['id']);
     $rows = $row;
     //先保存数组保留下面使用
     $id = $rows['id'];
     //播放页
     if (!empty($row['purl'])) {
         $Data_Arr = explode("#cscms#", $row['purl']);
         for ($i = 0; $i < count($Data_Arr); $i++) {
             $DataList_Arr = explode("\n", $Data_Arr[$i]);
             for ($j = 0; $j < count($DataList_Arr); $j++) {
                 //摧毁部分需要超级链接字段数组
                 unset($row['zhuyan']);
                 unset($row['daoyan']);
                 unset($row['yuyan']);
                 unset($row['diqu']);
                 unset($row['tags']);
                 unset($row['year']);
                 //动态人气
                 unset($row['hits']);
                 unset($row['yhits']);
                 unset($row['zhits']);
                 unset($row['rhits']);
                 unset($row['dhits']);
                 unset($row['chits']);
                 unset($row['xhits']);
                 unset($row['shits']);
                 $arr['cid'] = getChild($row['cid']);
                 $arr['uid'] = $row['uid'];
                 $arr['singerid'] = $row['singerid'];
                 $arr['tags'] = $rows['tags'];
                 $skins = $row['skins'];
                 if (empty($skins) || $skins == 'play.html') {
                     $skins = getzd('vod_list', 'skins3', $row['cid']);
                 }
                 if (empty($skins)) {
                     $skins = 'play.html';
                 }
                 //装载模板并输出
                 $Mark_Text = $this->CsdjTpl->plub_show('vod', $row, $arr, TRUE, $skins, $row['name'], $row['name']);
                 $Mark_Text = str_replace("[vod:pl]", $dance_pl, $Mark_Text);
                 //分类地址、名称
                 $Mark_Text = str_replace("[vod:link]", LinkUrl('show', 'id', $row['id'], 1, 'vod'), $Mark_Text);
                 $Mark_Text = str_replace("[vod:classlink]", LinkUrl('lists', 'id', $row['cid'], 1, 'vod'), $Mark_Text);
                 $Mark_Text = str_replace("[vod:classname]", $this->CsdjDB->getzd('vod_list', 'name', $row['cid']), $Mark_Text);
                 //主演、导演、标签、年份、地区、语言加超级连接
                 $Mark_Text = str_replace("[vod:zhuyan]", SearchLink($rows['zhuyan'], 'zhuyan'), $Mark_Text);
                 $Mark_Text = str_replace("[vod:daoyan]", SearchLink($rows['daoyan'], 'daoyan'), $Mark_Text);
                 $Mark_Text = str_replace("[vod:yuyan]", SearchLink($rows['yuyan'], 'yuyan'), $Mark_Text);
                 $Mark_Text = str_replace("[vod:diqu]", SearchLink($rows['diqu'], 'diqu'), $Mark_Text);
                 $Mark_Text = str_replace("[vod:tags]", SearchLink($rows['tags']), $Mark_Text);
                 $Mark_Text = str_replace("[vod:year]", SearchLink($rows['year'], 'year'), $Mark_Text);
                 $Mark_Text = Vod_Playlist($Mark_Text, 'play', $id, $row['purl']);
                 //播放器
                 if ($i >= count($Data_Arr)) {
                     $i = 0;
                 }
                 $DataList_Arr = explode("\n", $Data_Arr[$i]);
                 $Dataurl_Arr = explode('$', $DataList_Arr[$j]);
                 $laiyuan = str_replace("\r", "", @$Dataurl_Arr[2]);
                 //来源
                 $url = $Dataurl_Arr[1];
                 //地址
                 $pname = $Dataurl_Arr[0];
                 //当前集数
                 $Mark_Text = str_replace("[vod:qurl]", $url, $Mark_Text);
                 $Mark_Text = str_replace("[vod:laiy]", $laiyuan, $Mark_Text);
                 $Mark_Text = str_replace("[vod:ji]", $pname, $Mark_Text);
                 if (count($DataList_Arr) > $j + 1) {
                     $DataNext = $DataList_Arr[$j + 1];
                     $DataNextArr = explode('$', $DataNext);
                     if (count($DataNextArr) == 2) {
                         $DataNext = $DataNextArr[1];
                     }
                     $xurl = VodPlayUrl('play', $id, $i, $j + 1);
                     $Dataurl_Arr2 = explode('$', $DataList_Arr[$j + 1]);
                 } else {
                     $DataNext = $DataList_Arr[$j];
                     $DataNextArr = explode('$', $DataNext);
                     if (count($DataNextArr) == 2) {
                         $DataNext = $DataNextArr[1];
                     }
                     $xurl = VodPlayUrl('play', $id, $i, $j);
                 }
                 if ($j == 0) {
                     $surl = VodPlayUrl('play', $id, $i, $j);
                 } else {
                     $surl = VodPlayUrl('play', $id, $i, $j - 1);
                 }
                 $psname = '';
                 for ($a = 0; $a < count($Data_Arr); $a++) {
                     $jis = '';
                     $Ji_Arr = explode("\n", $Data_Arr[$a]);
                     for ($k = 0; $k < count($Ji_Arr); $k++) {
                         $Ly_Arr = explode('$', $Ji_Arr[$k]);
                         $jis .= $Ly_Arr[0] . '$$' . @$Ly_Arr[2] . '====';
                     }
                     $psname .= substr($jis, 0, -4) . '#cscms#';
                 }
                 $player_arr = str_replace("\r", "", substr($psname, 0, -7));
                 if ($laiyuan == 'xgvod' || $laiyuan == 'jjvod' || $laiyuan == 'yyxf' || $laiyuan == 'bdhd' || $laiyuan == 'qvod') {
                     $url = str_replace("+", "__", base64_encode($url));
                 } else {
                     $url = escape($url);
                 }
                 $player = "<script type='text/javascript' src='" . site_url('vod/play/pay/' . $id . '/' . $i . '/' . $j) . "'></script><script type='text/javascript' src='" . hitslink('play/form', 'vod') . "'></script><script type='text/javascript'>var cs_playlink='" . VodPlayUrl('play', $id, $i, $j, 1) . "';var cs_did='" . $id . "';var player_name='" . $player_arr . "';var cs_pid='" . $j . "';var cs_zid='" . $i . "';var cs_vodname='" . $row['name'] . " - " . $pname . "';var cs_root='http://" . Web_Url . Web_Path . "';var cs_width=" . CS_Play_sw . ";var cs_height=" . CS_Play_sh . ";var cs_surl='" . $surl . "';var cs_xurl='" . $xurl . "';var cs_laiy='" . $laiyuan . "';var cs_adloadtime='" . CS_Play_AdloadTime . "';</script>\r\n\t\t\t\t\t\t\t\t   <iframe border=\"0\" name=\"cscms_vodplay\" id=\"cscms_vodplay\" src=\"" . Web_Path . "packs/vod_player/play.html\" marginwidth=\"0\" framespacing=\"0\" marginheight=\"0\" noresize=\"\" vspale=\"0\" style=\"z-index: 9998;\" frameborder=\"0\" height=\"" . (CS_Play_sh + 30) . "\" scrolling=\"no\" width=\"100%\"></iframe>";
                 $Mark_Text = str_replace("[vod:player]", $player, $Mark_Text);
                 $Mark_Text = str_replace("[vod:surl]", $surl, $Mark_Text);
                 $Mark_Text = str_replace("[vod:xurl]", $xurl, $Mark_Text);
                 //解析动态人气标签
                 $Mark_Text = str_replace("[vod:hits]", "<script src='" . hitslink('hits/dt/hits/' . $id, 'vod') . "'></script>", $Mark_Text);
                 $Mark_Text = str_replace("[vod:yhits]", "<script src='" . hitslink('hits/dt/yhits/' . $id, 'vod') . "'></script>", $Mark_Text);
                 $Mark_Text = str_replace("[vod:zhits]", "<script src='" . hitslink('hits/dt/zhits/' . $id, 'vod') . "'></script>", $Mark_Text);
                 $Mark_Text = str_replace("[vod:rhits]", "<script src='" . hitslink('hits/dt/rhits/' . $id, 'vod') . "'></script>", $Mark_Text);
                 $Mark_Text = str_replace("[vod:shits]", "<script src='" . hitslink('hits/dt/shits/' . $id, 'vod') . "'></script>", $Mark_Text);
                 $Mark_Text = str_replace("[vod:xhits]", "<script src='" . hitslink('hits/dt/xhits/' . $id, 'vod') . "'></script>", $Mark_Text);
                 $Mark_Text = str_replace("[vod:dhits]", "<script src='" . hitslink('hits/dt/dhits/' . $id, 'vod') . "'></script>", $Mark_Text);
                 $Mark_Text = str_replace("[vod:chits]", "<script src='" . hitslink('hits/dt/chits/' . $id, 'vod') . "'></script>", $Mark_Text);
                 $Mark_Text = str_replace("[vod:pfen]", "<script src='" . hitslink('hits/dt/pfen/' . $id, 'vod') . "'></script>", $Mark_Text);
                 $Mark_Text = str_replace("[vod:pfenbi]", "<script src='" . hitslink('hits/dt/pfenbi/' . $id, 'vod') . "'></script>", $Mark_Text);
                 //增加人气
                 $Mark_Text = hits_js($Mark_Text, hitslink('hits/ids/' . $id, 'vod'));
                 //替换后台控制器
                 $Mark_Text = str_replace(SELF, 'index.php', $Mark_Text);
                 //获取静态路径
                 $Htmllinks = VodPlayUrl('play', $id, $i, $j);
                 //生成地址转换
                 $Htmllink = adminhtml($Htmllinks, 'vod');
                 //生成
                 write_file(FCPATH . $Htmllink, $Mark_Text);
             }
             echo "&nbsp;&nbsp;&nbsp;<font style=font-size:9pt;color:red;>--生成第" . ($i + 1) . "组播放器:<a href=" . $Htmllinks . " target=_blank>" . $Htmllinks . "</a></font><br/>";
         }
     }
 }
Example #9
0
 public function show($fid = 'id', $id = 0)
 {
     $id = intval($fid) > 0 ? intval($fid) : intval($id);
     //ID
     //判断ID
     if ($id == 0) {
         msg_url(L('dance_09'), Web_Path);
     }
     //获取数据
     $row = $this->CsdjDB->get_row_arr('dance_topic', '*', $id);
     if (!$row || $row['yid'] > 0) {
         msg_url(L('dance_23'), Web_Path);
     }
     //判断运行模式,生成则跳转至静态页面
     $html = config('Html_Uri');
     if (config('Web_Mode') == 3 && $html['topic/show']['check'] == 1) {
         //获取静态路径
         $Htmllink = LinkUrl('topic/show', $id, 1, 'dance');
         header("Location: " . $Htmllink);
         exit;
     }
     //装载模板并输出
     $ids['tid'] = $id;
     $ids['singerid'] = $row['singerid'];
     $ids['uid'] = $row['uid'];
     $Mark_Text = $this->CsdjTpl->plub_show('topic', $row, $ids, true, 'topic-show.html', $row['name'] . ' - ' . L('dance_22'), $row['name']);
     //评论
     $Mark_Text = str_replace("[topic:pl]", get_pl('dance', $id, 1), $Mark_Text);
     $Mark_Text = hits_js($Mark_Text, hitslink('hits/ids/' . $id . '/topic', 'dance'));
     echo $Mark_Text;
     $this->cache->end();
     //由于前面不是直接输出,所以这里需要加入写缓存
 }
Example #10
0
 public function play_save()
 {
     if ($this->huri['play']['check'] == 0) {
         admin_msg(L('plub_41'), 'javascript:history.back();', 'no');
     }
     $day = intval($this->input->get_post('day', true));
     //最近几天
     $ids = $this->input->get_post('ids', true);
     //需要生成的数据ID
     $cid = $this->input->get_post('cid', true);
     //需要生成的分类ID
     $newid = intval($this->input->get_post('newid'));
     //最新个数
     $ksid = intval($this->input->get_post('ksid'));
     //开始ID
     $jsid = intval($this->input->get_post('jsid'));
     //结束ID
     $kstime = $this->input->get_post('kstime', true);
     //开始日期
     $jstime = $this->input->get_post('jstime', true);
     //结束日期
     $pagesize = intval($this->input->get('pagesize'));
     //每页多少条
     $pagejs = intval($this->input->get('pagejs'));
     //总页数
     $datacount = intval($this->input->get('datacount'));
     //数据总数
     $page = intval($this->input->get('page'));
     //当前页
     if ($page == 0) {
         $page = 1;
     }
     $str = '';
     //将数组转换成字符
     if (is_array($cid)) {
         $cid = implode(',', $cid);
     }
     if (is_array($ids)) {
         $ids = implode(',', $ids);
     }
     if ($day > 0) {
         $times = time() - 86400 * $day;
         $str .= ' and addtime>' . $times . '';
     }
     if (!empty($cid)) {
         $str .= ' and cid in (' . $cid . ')';
     }
     if (!empty($ids)) {
         $str .= ' and id in (' . $ids . ')';
     }
     if ($ksid > 0 && $jsid > 0) {
         $str .= ' and id>' . ($ksid - 1) . ' and id<' . ($jsid + 1) . '';
     }
     if (!empty($kstime) && !empty($jstime)) {
         $ktime = strtotime($kstime) - 86400;
         $jtime = strtotime($jstime) + 86400;
         $str .= ' and addtime>' . $ktime . ' and addtime<' . $jtime . '';
     }
     $limit = '';
     if ($newid > 0) {
         $limit = ' order by id desc limit ' . $newid;
     }
     if ($datacount == 0) {
         $sqlstr = "select id from " . CS_SqlPrefix . "dance where yid=0 and hid=0 " . $str . $limit;
         $datacount = $this->db->query($sqlstr)->num_rows();
         //总数量
         $pagejs = ceil($datacount / Html_PageNum);
     }
     if ($datacount == 0) {
         $pagejs = 1;
     }
     $pagesize = Html_PageNum;
     if ($datacount < $pagesize) {
         $pagesize = $datacount;
     }
     //全部生成完毕
     if ($page > $pagejs) {
         admin_msg(L('plub_42'), site_url('dance/admin/html/play'));
     }
     //公众URI
     $uri = '?day=' . $day . '&cid=' . $cid . '&ids=' . $ids . '&newid=' . $newid . '&ksid=' . $ksid . '&jsid=' . $jsid . '&kstime=' . $kstime . '&jstime=' . $jstime . '&pagesize=' . $pagesize . '&pagejs=' . $pagejs . '&datacount=' . $datacount;
     //重新定义模板路径
     $this->load->get_templates('dance', 2);
     echo '<LINK href="' . base_url() . 'packs/admin/css/style.css" type="text/css" rel="stylesheet"><br>';
     echo vsprintf(L('plub_43'), array($pagejs, $page));
     $sql_string = "select * from " . CS_SqlPrefix . "dance where yid=0 and hid=0 " . $str . " order by id desc";
     $sql_string .= ' limit ' . $pagesize * ($page - 1) . ',' . $pagesize;
     $query = $this->db->query($sql_string);
     //获取播放页是否需要生成
     $html = config('Html_Uri', 'dance');
     foreach ($query->result_array() as $row) {
         ob_end_flush();
         //关闭缓存
         $id = $row['id'];
         //获取静态路径
         $Htmllinks = LinkUrl('play', 'id', $row['id'], 0, 'dance', $row['name']);
         //转换成生成路径
         $Htmllink = adminhtml($Htmllinks, 'dance');
         //摧毁部分需要超级链接字段数组
         $rows = $row;
         //先保存数组保留下面使用
         unset($row['tags']);
         unset($row['hits']);
         unset($row['yhits']);
         unset($row['zhits']);
         unset($row['rhits']);
         unset($row['dhits']);
         unset($row['chits']);
         unset($row['shits']);
         unset($row['xhits']);
         //获取当前分类下二级分类ID
         $arr['cid'] = getChild($row['cid']);
         $arr['uid'] = $row['uid'];
         $arr['did'] = $row['id'];
         $arr['singerid'] = $row['singerid'];
         $arr['tags'] = $rows['tags'];
         //装载模板并输出
         $skins = empty($row['skins']) ? 'play.html' : $row['skins'];
         $Mark_Text = $this->CsdjTpl->plub_show('dance', $row, $arr, TRUE, $skins, $row['name'], $row['name']);
         //评论
         $Mark_Text = str_replace("[dance:pl]", get_pl('dance', $id), $Mark_Text);
         //分类地址、名称
         $Mark_Text = str_replace("[dance:link]", LinkUrl('play', 'id', $row['id'], 1, 'dance'), $Mark_Text);
         $Mark_Text = str_replace("[dance:classlink]", LinkUrl('lists', 'id', $row['cid'], 1, 'dance'), $Mark_Text);
         $Mark_Text = str_replace("[dance:classname]", $this->CsdjDB->getzd('dance_list', 'name', $row['cid']), $Mark_Text);
         //专辑
         if ($row['tid'] == 0) {
             $Mark_Text = str_replace("[dance:topiclink]", "###", $Mark_Text);
             $Mark_Text = str_replace("[dance:topicname]", L('plub_44'), $Mark_Text);
         } else {
             $Mark_Text = str_replace("[dance:topiclink]", LinkUrl('topic', 'show', $row['tid'], 1, 'dance'), $Mark_Text);
             $Mark_Text = str_replace("[dance:topicname]", $this->CsdjDB->getzd('dance_topic', 'name', $row['tid']), $Mark_Text);
         }
         //获取上下曲
         preg_match_all('/[dance:slink]/', $Mark_Text, $arr);
         if (!empty($arr[0]) && !empty($arr[0][0])) {
             $rowd = $this->db->query("Select id,cid,name from " . CS_SqlPrefix . "dance where yid=0 and hid=0 and id<" . $id . " order by id desc limit 1")->row();
             if ($rowd) {
                 $Mark_Text = str_replace("[dance:slink]", LinkUrl('play', 'id', $rowd->id, 1, 'dance'), $Mark_Text);
                 $Mark_Text = str_replace("[dance:sname]", $rowd->name, $Mark_Text);
                 $Mark_Text = str_replace("[dance:sid]", $rowd->id, $Mark_Text);
             } else {
                 $Mark_Text = str_replace("[dance:slink]", "#", $Mark_Text);
                 $Mark_Text = str_replace("[dance:sname]", L('plub_45'), $Mark_Text);
                 $Mark_Text = str_replace("[dance:sid]", 0, $Mark_Text);
             }
         }
         unset($arr);
         preg_match_all('/[dance:xlink]/', $Mark_Text, $arr);
         if (!empty($arr[0]) && !empty($arr[0][0])) {
             $rowd = $this->db->query("Select id,cid,name from " . CS_SqlPrefix . "dance where yid=0 and hid=0 and id>" . $id . " order by id asc limit 1")->row();
             if ($rowd) {
                 $Mark_Text = str_replace("[dance:xlink]", LinkUrl('play', 'id', $rowd->id, 1, 'dance'), $Mark_Text);
                 $Mark_Text = str_replace("[dance:xname]", $rowd->name, $Mark_Text);
                 $Mark_Text = str_replace("[dance:xid]", $rowd->id, $Mark_Text);
             } else {
                 $Mark_Text = str_replace("[dance:xlink]", "#", $Mark_Text);
                 $Mark_Text = str_replace("[dance:xname]", L('plub_45'), $Mark_Text);
                 $Mark_Text = str_replace("[dance:xid]", 0, $Mark_Text);
             }
         }
         unset($arr);
         //标签加超级连接
         $Mark_Text = str_replace("[dance:tags]", SearchLink($rows['tags']), $Mark_Text);
         //动态人气
         $Mark_Text = str_replace("[dance:hits]", "<script src='" . hitslink('hits/dt/hits/' . $id, 'dance') . "'></script>", $Mark_Text);
         $Mark_Text = str_replace("[dance:yhits]", "<script src='" . hitslink('hits/dt/yhits/' . $id, 'dance') . "'></script>", $Mark_Text);
         $Mark_Text = str_replace("[dance:zhits]", "<script src='" . hitslink('hits/dt/zhits/' . $id, 'dance') . "'></script>", $Mark_Text);
         $Mark_Text = str_replace("[dance:rhits]", "<script src='" . hitslink('hits/dt/rhits/' . $id, 'dance') . "'></script>", $Mark_Text);
         $Mark_Text = str_replace("[dance:dhits]", "<script src='" . hitslink('hits/dt/dhits/' . $id, 'dance') . "'></script>", $Mark_Text);
         $Mark_Text = str_replace("[dance:chits]", "<script src='" . hitslink('hits/dt/chits/' . $id, 'dance') . "'></script>", $Mark_Text);
         $Mark_Text = str_replace("[dance:shits]", "<script src='" . hitslink('hits/dt/shits/' . $id, 'dance') . "'></script>", $Mark_Text);
         $Mark_Text = str_replace("[dance:xhits]", "<script src='" . hitslink('hits/dt/xhits/' . $id, 'dance') . "'></script>", $Mark_Text);
         //歌曲完整试听地址
         preg_match_all('/[dance:qurl]/', $Mark_Text, $arr);
         if (!empty($arr[0]) && !empty($arr[0][0])) {
             $purl = $row['purl'];
             if ($row['fid'] > 0) {
                 $rowf = $this->db->query("Select purl from " . CS_SqlPrefix . "dance_server where id=" . $row['fid'] . "")->row_array();
                 if ($rowf) {
                     $purl = $rowf['purl'] . $row['purl'];
                 }
             }
             $purl = annexlink($purl);
             $Mark_Text = str_replace("[dance:qurl]", $purl, $Mark_Text);
         }
         unset($arr);
         //cmp音频播放器
         $player = "<script type='text/javascript'>\r\n\t\t\t\t  var mp3_w='" . CS_Play_w . "';\r\n\t\t\t\t  var mp3_h='" . CS_Play_h . "';\r\n\t\t\t\t  var mp3_i='" . $id . "';\r\n\t\t\t\t  var mp3_p='" . hitslink('play', 'dance') . "';\r\n\t\t\t\t  var mp3_t='" . Web_Path . "';\r\n\t\t\t\t  mp3_play();\r\n\t\t\t\t  </script>";
         $Mark_Text = str_replace("[dance:player]", $player, $Mark_Text);
         //jp音频播放器
         $jplayer = "<script type='text/javascript'>\r\n\t\t\t\t  var mp3_i='" . $id . "';\r\n\t\t\t\t  var mp3_p='" . hitslink('play', 'dance') . "';\r\n\t\t\t\t  var mp3_n='" . str_replace("'", "", $row['name']) . "';\r\n\t\t\t\t  var mp3_x='" . LinkUrl('down', 'id', $row['id'], 1, 'dance') . "';\r\n\t\t\t\t  mp3_jplayer();\r\n\t\t\t\t  </script>";
         $Mark_Text = str_replace("[dance:jplayer]", $jplayer, $Mark_Text);
         //增加人气
         $Mark_Text = hits_js($Mark_Text, hitslink('hits/ids/' . $id, 'dance'));
         //生成
         write_file(FCPATH . $Htmllink, $Mark_Text);
         echo "&nbsp;<font style=font-size:10pt;>" . L('plub_46') . "<font color=red>" . $row['name'] . "</font>" . L('plub_36') . "<a href=" . $Htmllinks . " target=_blank>" . $Htmllinks . "</a></font><br/>";
         ob_flush();
         flush();
     }
     if (!empty($ids)) {
         $url = 'javascript:history.back();';
         $str = "&nbsp;&nbsp;<b>" . L('plub_66') . "&nbsp;>>>>&nbsp;&nbsp;<a href='" . $url . "'>" . L('plub_28') . "</a></b>";
     } else {
         $url = site_url('dance/admin/html/play_save') . $uri . '&page=' . ($page + 1);
         $str = "&nbsp;&nbsp;<b>" . vsprintf(L('plub_27'), array(Html_StopTime)) . "&nbsp;>>>>&nbsp;&nbsp;<a href='" . $url . "'>" . L('plub_28') . "</a></b>";
     }
     echo "</br>" . $str . "<script>setTimeout('updatenext();'," . Html_StopTime . "000);function updatenext(){location.href='" . $url . "';}</script>";
 }
Example #11
0
 public function index($a1, $a2 = 0, $a3 = 0, $a4 = 0)
 {
     if (intval($a1) > 0) {
         $id = intval($a1);
         //ID
         $zu = intval($a2);
         //组
         $ji = intval($a3);
         //集数
     } else {
         $id = intval($a2);
         //ID
         $zu = intval($a3);
         //组
         $ji = intval($a4);
         //集数
     }
     $login = '******';
     //判断ID
     if ($id == 0) {
         msg_url('出错了,ID不能为空!', Web_Path);
     }
     //获取数据
     $row = $this->CsdjDB->get_row_arr('vod', '*', $id);
     if (!$row || $row['yid'] > 0 || $row['hid'] > 0) {
         msg_url('出错了,该数据不存在或者没有审核!', Web_Path);
     }
     if (empty($row['purl'])) {
         msg_url('该视频播放地址不正确!', Web_Path);
     }
     //判断运行模式,生成则跳转至静态页面
     $html = config('Html_Uri');
     if (config('Web_Mode') == 3 && $html['play']['check'] == 1 && !defined('MOBILE')) {
         //获取静态路径
         $Htmllink = VodPlayUrl('play', $id, $zu, $ji);
         header("Location: " . $Htmllink);
         exit;
     }
     //判断收费
     if ($row['vip'] > 0 || $row['level'] > 0 || $row['cion'] > 0) {
         if (!$this->CsdjUser->User_Login(1)) {
             msg_url('观看这部视频需要登录,请先登录!', spacelink('login'));
         }
         $rowu = $this->CsdjDB->get_row_arr('user', 'vip,level,cion', $_SESSION['cscms__id']);
     }
     //判断会员组下载权限
     if ($row['vip'] > 0 && $row['uid'] != $_SESSION['cscms__id']) {
         if ($row['vip'] > $rowu['vip']) {
             msg_url('抱歉,您所在的会员组不能观看该视频,请先升级!', 'javascript:window.close();');
         }
     }
     //判断会员等级下载权限
     if ($row['level'] > 0 && $row['uid'] != $_SESSION['cscms__id']) {
         if ($row['level'] > $rowu['level']) {
             msg_url('抱歉,您等级不够,不能观看该视频!', 'javascript:window.close();');
         }
     }
     //判断金币下载
     $down = 0;
     if ($row['cion'] > 0 && $row['uid'] != $_SESSION['cscms__id']) {
         //判断是否下载过
         $did = $id . '-' . $zu . '-' . $ji;
         $rowd = $this->db->query("SELECT id,addtime FROM " . CS_SqlPrefix . "vod_look where did='" . $did . "' and uid='" . $_SESSION['cscms__id'] . "' and sid=0")->row_array();
         if ($rowd) {
             $down = 1;
             //数据已经存在
             $downtime = User_Downtime * 3600 + $rowd['addtime'];
             if ($downtime > time()) {
                 $down = 2;
                 //在多少时间内不重复扣币
             }
         }
         //判断会员组下载权限
         $rowz = $this->db->query("SELECT id,did FROM " . CS_SqlPrefix . "userzu where id='" . $rowu['vip'] . "'")->row_array();
         if ($rowz && $rowz['did'] == 1) {
             //有免费下载权限
             $down = 2;
             //该会员下载不收费
         }
         if ($down < 2) {
             //判断扣币
             if ($row['cion'] > $rowu['cion']) {
                 msg_url('这部视频观看每集需要' . $row['cion'] . '个金币,您的当前金币不够,请先充值!', 'javascript:window.close();');
             } else {
                 //扣币
                 $edit['cion'] = $rowu['cion'] - $row['cion'];
                 $this->CsdjDB->get_update('user', $_SESSION['cscms__id'], $edit);
                 //写入消费记录
                 $add2['title'] = '观看视频《' . $row['name'] . '》- 第' . ($ji + 1) . '集';
                 $add2['uid'] = $_SESSION['cscms__id'];
                 $add2['nums'] = $row['cion'];
                 $add2['ip'] = getip();
                 $add2['dir'] = 'vod';
                 $add2['addtime'] = time();
                 $this->CsdjDB->get_insert('spend', $add2);
                 //判断分成
                 if (User_DownFun == 1 && $row['uid'] > 0) {
                     //分成比例
                     $bi = User_Downcion < 10 ? '0.0' . User_Downcion : '0.' . User_Downcion;
                     $scion = intval($row['cion'] * $bi);
                     if ($scion > 0) {
                         $this->db->query("update " . CS_SqlPrefix . "user set cion=cion+" . $scion . " where id=" . $row['uid'] . "");
                         //写入分成记录
                         $add3['title'] = '视频《' . $row['name'] . '》- 第' . ($ji + 1) . '集 - 观看分成';
                         $add3['uid'] = $row['uid'];
                         $add3['dir'] = 'vod';
                         $add3['nums'] = $scion;
                         $add3['ip'] = getip();
                         $add3['addtime'] = time();
                         $this->CsdjDB->get_insert('income', $add3);
                     }
                 }
             }
         }
         //增加观看记录
         if ($down == 0) {
             $add['name'] = $row['name'];
             $add['cid'] = $row['cid'];
             $add['sid'] = 0;
             $add['did'] = $did;
             $add['uid'] = $_SESSION['cscms__id'];
             $add['cion'] = $row['cion'];
             $add['addtime'] = time();
             $this->CsdjDB->get_insert('vod_look', $add);
         }
     }
     //摧毁部分需要超级链接字段数组
     $rows = $row;
     //先保存数组保留下面使用
     unset($row['zhuyan']);
     unset($row['daoyan']);
     unset($row['yuyan']);
     unset($row['diqu']);
     unset($row['tags']);
     unset($row['year']);
     unset($row['pfen']);
     unset($row['phits']);
     //获取当前分类下二级分类ID
     $arr['cid'] = getChild($row['cid']);
     $arr['uid'] = $row['uid'];
     $arr['singerid'] = $row['singerid'];
     $arr['tags'] = $rows['tags'];
     $skins = $row['skins'];
     if (empty($skins) || $skins == 'play.html') {
         $skins = getzd('vod_list', 'skins3', $row['cid']);
     }
     if (empty($skins)) {
         $skins = 'play.html';
     }
     //装载模板并输出
     $Mark_Text = $this->CsdjTpl->plub_show('vod', $row, $arr, TRUE, $skins, $row['name'], $row['name']);
     //评论
     $Mark_Text = str_replace("[vod:pl]", get_pl('vod', $id), $Mark_Text);
     //分类地址、名称
     $Mark_Text = str_replace("[vod:zu]", $zu + 1, $Mark_Text);
     $Mark_Text = str_replace("[vod:ji]", $ji + 1, $Mark_Text);
     $Mark_Text = str_replace("[vod:link]", LinkUrl('show', 'id', $row['id'], 1, 'vod'), $Mark_Text);
     $Mark_Text = str_replace("[vod:playlink]", VodPlayUrl('play', $id, $zu, $ji), $Mark_Text);
     $Mark_Text = str_replace("[vod:classlink]", LinkUrl('lists', 'id', $row['cid'], 1, 'vod'), $Mark_Text);
     $Mark_Text = str_replace("[vod:classname]", $this->CsdjDB->getzd('vod_list', 'name', $row['cid']), $Mark_Text);
     //主演、导演、标签、年份、地区、语言加超级连接
     $Mark_Text = str_replace("[vod:zhuyan]", SearchLink($rows['zhuyan'], 'zhuyan'), $Mark_Text);
     $Mark_Text = str_replace("[vod:daoyan]", SearchLink($rows['daoyan'], 'daoyan'), $Mark_Text);
     $Mark_Text = str_replace("[vod:yuyan]", SearchLink($rows['yuyan'], 'yuyan'), $Mark_Text);
     $Mark_Text = str_replace("[vod:diqu]", SearchLink($rows['diqu'], 'diqu'), $Mark_Text);
     $Mark_Text = str_replace("[vod:tags]", SearchLink($rows['tags']), $Mark_Text);
     $Mark_Text = str_replace("[vod:year]", SearchLink($rows['year'], 'year'), $Mark_Text);
     //评分
     $Mark_Text = str_replace("[vod:pfen]", getpf($rows['pfen'], $rows['phits']), $Mark_Text);
     $Mark_Text = str_replace("[vod:pfenbi]", getpf($rows['pfen'], $rows['phits'], 2), $Mark_Text);
     //解析播放地址
     $Mark_Text = Vod_Playlist($Mark_Text, 'play', $id, $row['purl']);
     //播放器
     $Data_Arr = explode("#cscms#", $row['purl']);
     if ($zu >= count($Data_Arr)) {
         $zu = 0;
     }
     $DataList_Arr = explode("\n", $Data_Arr[$zu]);
     $Dataurl_Arr = explode('$', $DataList_Arr[$ji]);
     $xpurl = "";
     //下集播放地址
     $laiyuan = str_replace("\r", "", @$Dataurl_Arr[2]);
     //来源
     $url = $Dataurl_Arr[1];
     //地址
     $pname = $Dataurl_Arr[0];
     //当前集数
     $Mark_Text = str_replace("[vod:qurl]", $url, $Mark_Text);
     $Mark_Text = str_replace("[vod:laiy]", $laiyuan, $Mark_Text);
     $Mark_Text = str_replace("[vod:ji]", $pname, $Mark_Text);
     //手机播放地址
     if (substr($url, 0, 7) == 'http://') {
         $wapurl = $url;
     } else {
         $wapurl = 'http://download.chshcms.com/mp4/' . $laiyuan . '/' . cs_base64_encode($url) . '/cscms.mp4';
     }
     $Mark_Text = str_replace("[vod:wapurl]", $wapurl, $Mark_Text);
     if (count($DataList_Arr) > $ji + 1) {
         $DataNext = $DataList_Arr[$ji + 1];
         $DataNextArr = explode('$', $DataNext);
         if (count($DataNextArr) == 2) {
             $DataNext = $DataNextArr[1];
         }
         $xurl = VodPlayUrl('play', $id, $zu, $ji + 1);
         $Dataurl_Arr2 = explode('$', $DataList_Arr[$ji + 1]);
         $xpurl = @$Dataurl_Arr2[1];
         //下集播放地址
     } else {
         $DataNext = $DataList_Arr[$ji];
         $DataNextArr = explode('$', $DataNext);
         if (count($DataNextArr) == 2) {
             $DataNext = $DataNextArr[1];
         }
         $xurl = '#';
         $xpurl = '';
         //下集播放地址
     }
     if ($ji == 0) {
         $surl = '#';
     } else {
         $surl = VodPlayUrl('play', $id, $zu, $ji - 1);
     }
     $psname = '';
     for ($j = 0; $j < count($Data_Arr); $j++) {
         $jis = '';
         $Ji_Arr = explode("\n", $Data_Arr[$j]);
         for ($k = 0; $k < count($Ji_Arr); $k++) {
             $Ly_Arr = explode('$', $Ji_Arr[$k]);
             $jis .= $Ly_Arr[0] . '$$' . @$Ly_Arr[2] . '====';
         }
         $psname .= substr($jis, 0, -4) . '#cscms#';
     }
     $player_arr = str_replace("\r", "", substr($psname, 0, -7));
     if ($laiyuan == 'xgvod' || $laiyuan == 'jjvod' || $laiyuan == 'yyxf' || $laiyuan == 'bdhd' || $laiyuan == 'qvod') {
         $xpurl = str_replace("+", "__", base64_encode($xpurl));
         $url = str_replace("+", "__", base64_encode($url));
     } else {
         $xpurl = escape($xpurl);
         $url = escape($url);
     }
     $player = "<script type='text/javascript' src='" . hitslink('play/form', 'vod') . "'></script><script type='text/javascript'>var cs_playlink='" . VodPlayUrl('play', $id, $zu, $ji, 1) . "';var cs_did='" . $id . "';var player_name='" . $player_arr . "';var cs_pid='" . $ji . "';var cs_zid='" . $zu . "';var cs_vodname='" . $row['name'] . " - " . $pname . "';var cs_root='" . Web_Path . "';var cs_width=" . CS_Play_sw . ";var cs_height=" . CS_Play_sh . ";var cs_surl='" . $surl . "';var cs_xurl='" . $xurl . "';var cs_url='" . $url . "';var cs_xpurl='" . $xpurl . "';var cs_laiy='" . $laiyuan . "';var cs_adloadtime='" . CS_Play_AdloadTime . "';</script><iframe border=\"0\" name=\"cscms_vodplay\" id=\"cscms_vodplay\" src=\"" . Web_Path . "packs/vod_player/play.html\" marginwidth=\"0\" framespacing=\"0\" marginheight=\"0\" noresize=\"\" vspale=\"0\" style=\"z-index: 9998;\" frameborder=\"0\" height=\"" . (CS_Play_sh + 30) . "\" scrolling=\"no\" width=\"100%\"></iframe>";
     $Mark_Text = str_replace("[vod:player]", $player, $Mark_Text);
     $Mark_Text = str_replace("[vod:surl]", $surl, $Mark_Text);
     $Mark_Text = str_replace("[vod:xurl]", $xurl, $Mark_Text);
     //增加人气
     $Mark_Text = hits_js($Mark_Text, hitslink('hits/ids/' . $id, 'vod'));
     echo $Mark_Text;
     $this->cache->end();
     //由于前面不是直接输出,所以这里需要加入写缓存
 }
Example #12
0
 public function shows($row)
 {
     if ($row) {
         ob_end_flush();
         //关闭缓存
         $id = $row['id'];
         //获取静态路径
         $Htmllinks = LinkUrl('show', '', $row['id'], 0, 'singer');
         //转换成生成路径
         $Htmllink = adminhtml($Htmllinks, 'singer');
         $rows = $row;
         //先保存数组保留下面使用
         //摧毁动态人气字段
         unset($row['tags']);
         unset($row['hits']);
         unset($row['yhits']);
         unset($row['zhits']);
         unset($row['rhits']);
         $arr['cid'] = getChild($row['cid']);
         $arr['tags'] = $rows['tags'];
         $arr['singerid'] = $id;
         //装载模板并输出
         $Mark_Text = $this->CsdjTpl->plub_show('singer', $row, $arr, TRUE, 'show.html', $row['name'], $row['name']);
         //评论
         $Mark_Text = str_replace("[singer:pl]", get_pl('singer', $id), $Mark_Text);
         //分类地址、名称
         $Mark_Text = str_replace("[singer:link]", LinkUrl('show', 'id', $row['id'], 1, 'singer'), $Mark_Text);
         $Mark_Text = str_replace("[singer:classlink]", LinkUrl('lists', 'id', $row['cid'], 1, 'singer'), $Mark_Text);
         $Mark_Text = str_replace("[singer:classname]", $this->CsdjDB->getzd('singer_list', 'name', $row['cid']), $Mark_Text);
         //动态人气
         $Mark_Text = str_replace("[singer:hits]", "<script src='" . hitslink('hits/dt/hits/' . $id, 'singer') . "'></script>", $Mark_Text);
         $Mark_Text = str_replace("[singer:yhits]", "<script src='" . hitslink('hits/dt/yhits/' . $id, 'singer') . "'></script>", $Mark_Text);
         $Mark_Text = str_replace("[singer:zhits]", "<script src='" . hitslink('hits/dt/zhits/' . $id, 'singer') . "'></script>", $Mark_Text);
         $Mark_Text = str_replace("[singer:rhits]", "<script src='" . hitslink('hits/dt/rhits/' . $id, 'singer') . "'></script>", $Mark_Text);
         //标签加超级连接
         $Mark_Text = str_replace("[singer:tags]", SearchLink($rows['tags']), $Mark_Text);
         //增加人气
         $Mark_Text = hits_js($Mark_Text, hitslink('hits/ids/' . $id, 'singer'));
         //生成
         write_file(FCPATH . $Htmllink, $Mark_Text);
         echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font style=font-size:10pt;color:#006600>生成主页完成:<a href=" . $Htmllinks . " target=_blank>" . $Htmllinks . "</a></font><br/>";
         ob_flush();
         flush();
     }
 }