Exemple #1
0
 public function index($fid = 'id', $id = 0, $page = 0)
 {
     $id = intval($id);
     //ID
     $page = intval($page);
     //页数
     if ($page == 0) {
         $page = 1;
     }
     //判断ID
     if ($id == 0) {
         msg_url(L('dance_09'), Web_Path);
     }
     //获取数据
     $row = $this->CsdjDB->get_row_arr('dance_list', '*', $id);
     if (!$row || $row['yid'] > 0) {
         msg_url(L('dance_18'), Web_Path);
     }
     //判断运行模式,生成则跳转至静态页面
     $html = config('Html_Uri');
     if (config('Web_Mode') == 3 && $html['lists']['check'] == 1) {
         //获取静态路径
         $Htmllink = LinkUrl('lists', $fid, $id, $page, 'dance');
         header("Location: " . $Htmllink);
         exit;
     }
     //获取当前分类下二级分类ID
     $ids = getChild($id);
     //装载模板并输出
     $skins = empty($row['skins']) ? 'list.html' : $row['skins'];
     $this->CsdjTpl->plub_list($row, $id, $fid, $page, $ids, false, $skins, 'lists', 'dance', $row['name'], $row['name']);
 }
Exemple #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('vod_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 && !defined('MOBILE')) {
         //获取静态路径
         $Htmllink = LinkUrl('topic', 'show', $id, 1, 'vod');
         header("Location: " . $Htmllink);
         exit;
     }
     //装载模板并输出
     $ids['tid'] = $id;
     $Mark_Text = $this->CsdjTpl->plub_show('topic', $row, $ids, true, 'topic-show.html', $row['name'], $row['name']);
     //评论
     $Mark_Text = str_replace("[topic:pl]", get_pl('vod', $id, 1), $Mark_Text);
     //增加人气
     $Mark_Text = hits_js($Mark_Text, hitslink('hits/ids/' . $id . '/topic', 'vod'));
     echo $Mark_Text;
     $this->cache->end();
     //由于前面不是直接输出,所以这里需要加入写缓存
 }
Exemple #3
0
 public function index($fid = 'id', $id = 0, $page = 0)
 {
     $id = intval($id);
     //ID
     $page = intval($page);
     //页数
     if ($page == 0) {
         $page = 1;
     }
     //判断ID
     if ($id == 0) {
         msg_url('出错了,ID不能为空!', Web_Path);
     }
     //获取数据
     $row = $this->CsdjDB->get_row_arr('vod_list', '*', $id);
     if (!$row || $row['yid'] > 0) {
         msg_url('出错了,该分类不存在!', Web_Path);
     }
     //判断运行模式,生成则跳转至静态页面
     $html = config('Html_Uri');
     if (config('Web_Mode') == 3 && $html['lists']['check'] == 1 && !defined('MOBILE')) {
         //获取静态路径
         $Htmllink = LinkUrl('lists', $fid, $id, $page, 'vod');
         header("Location: " . $Htmllink);
         exit;
     }
     //获取当前分类下二级分类ID
     $arr['cid'] = getChild($id);
     $arr['fid'] = $row['fid'] == 0 ? $row['id'] : $row['fid'];
     $arr['sid'] = $arr['fid'];
     //装载模板并输出
     $skins = empty($row['skins']) ? 'list.html' : $row['skins'];
     $this->CsdjTpl->plub_list($row, $id, $fid, $page, $arr, false, $skins, 'lists', 'vod', $row['name'], $row['name']);
 }
Exemple #4
0
 public function index($fid = 'id', $id = 0, $page = 1)
 {
     $id = intval($id);
     //ID
     $page = intval($page);
     //ID
     if (preg_match("/^\\d*\$/", $fid)) {
         $id = intval($fid);
         $page = intval($id);
         $fid = 'id';
     }
     $cid = intval($this->input->get_post('cid'));
     if ($page == 0) {
         $page = 1;
     }
     //判断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('pic', $cid, $id, 0, 'singer');
         header("Location: " . $Htmllink);
         exit;
     }
     if ($cid > 0) {
         $arr['cid'] = getChild($cid);
     }
     $arr['tags'] = $row['tags'];
     $arr['singerid'] = $id;
     //摧毁部分需要超级链接字段数组
     $rows = $row;
     //先保存数组保留下面使用
     unset($row['tags']);
     //装载模板并输出
     $Mark_Text = $this->CsdjTpl->plub_list($row, $id, $fid, $page, $arr, TRUE, 'pic.html', 'pic', 'singer', $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);
     echo $Mark_Text;
     $this->cache->end();
     //由于前面不是直接输出,所以这里需要加入写缓存
 }
Exemple #5
0
 public function album($row)
 {
     if ($row) {
         $id = $row['id'];
         $template = $this->load->view('album.html', '', true);
         $pagesize = 50;
         preg_match_all('/{cscms:([\\S]+)\\s+(.*?pagesize=\\"([\\S]+)\\".*?)}([\\s\\S]+?){\\/cscms:\\1}/', $template, $page_arr);
         if (!empty($page_arr) && !empty($page_arr[3][0])) {
             $pagesize = $page_arr[3][0];
         }
         $datacount = $this->db->query("select id from " . CS_SqlPrefix . "dance_topic where yid=0 and singerid=" . $id . "")->num_rows();
         //总数量
         $pagejs = ceil($datacount / $pagesize);
         if ($pagejs == 0) {
             $pagejs = 1;
         }
         for ($i = 1; $i <= $pagejs; $i++) {
             $fids = array('id', 'hits');
             $arr['cid'] = getChild($row['cid']);
             $arr['tags'] = $row['tags'];
             $arr['singerid'] = $id;
             //摧毁部分需要超级链接字段数组
             $rows = $row;
             //先保存数组保留下面使用
             unset($row['tags']);
             foreach ($fids as $fid) {
                 ob_end_flush();
                 //关闭缓存
                 //获取静态路径
                 $Htmllinks = LinkUrl('album', $fid, $row['id'], $i, 'singer');
                 //转换成生成路径
                 $Htmllink = adminhtml($Htmllinks, 'singer');
                 //装载模板并输出
                 $Mark_Text = $this->CsdjTpl->plub_list($row, $id, $fid, $i, $arr, TRUE, 'album.html', 'album', 'singer', $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 = 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);
                 //生成
                 write_file(FCPATH . $Htmllink, $Mark_Text);
                 echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font style=font-size:10pt;color:#006600>生成专辑页按《<font color=#0000ff>" . $fid . "</font>》排序,完成:<a href=" . $Htmllinks . " target=_blank>" . $Htmllinks . "</a></font><br/>";
                 ob_flush();
                 flush();
             }
         }
     }
 }
Exemple #6
0
 public function index($fid = 'id', $id = 0, $return = FALSE)
 {
     $id = intval($fid) > 0 ? intval($fid) : intval($id);
     //ID
     //判断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);
     }
     //判断运行模式,生成则跳转至静态页面
     $html = config('Html_Uri');
     if (config('Web_Mode') == 3 && $html['show']['check'] == 1 && !defined('MOBILE')) {
         //获取静态路径
         $Htmllink = LinkUrl('show', $fid, $id, 0, 'vod');
         header("Location: " . $Htmllink);
         exit;
     }
     //摧毁部分需要超级链接字段数组
     $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 = getzd('vod_list', 'skins2', $row['cid']);
     if (empty($skins)) {
         $skins = 'show.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: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 = 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']);
     $Mark_Text = Vod_Playlist($Mark_Text, 'down', $id, $row['durl']);
     echo $Mark_Text;
     $this->cache->end();
     //由于前面不是直接输出,所以这里需要加入写缓存
 }
Exemple #7
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();
     //由于前面不是直接输出,所以这里需要加入写缓存
 }
Exemple #8
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();
     //由于前面不是直接输出,所以这里需要加入写缓存
 }
Exemple #9
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['durl'])) {
         msg_url('该视频下载地址不正确!', Web_Path);
     }
     //判断收费
     if ($row['vip'] > 0 || $row['level'] > 0 || $row['cion'] > 0 || User_YkDown == 0) {
         $this->CsdjUser->User_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['dcion'] > 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=1")->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['dcion'] > $rowu['cion']) {
                 msg_url('这部视频下载每集需要' . $row['cion'] . '个金币,您的当前金币不够,请先充值!', 'javascript:window.close();');
             } else {
                 //扣币
                 $edit['cion'] = $rowu['cion'] - $row['dcion'];
                 $this->CsdjDB->get_update('user', $_SESSION['cscms__id'], $edit);
                 //写入消费记录
                 $add2['title'] = '下载视频《' . $row['name'] . '》- 第' . ($ji + 1) . '集';
                 $add2['uid'] = $_SESSION['cscms__id'];
                 $add2['dir'] = 'vod';
                 $add2['nums'] = $row['cion'];
                 $add2['ip'] = getip();
                 $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['dcion'] * $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'] = 1;
             $add['did'] = $did;
             $add['uid'] = $_SESSION['cscms__id'];
             $add['cion'] = $row['dcion'];
             $add['addtime'] = time();
             $this->CsdjDB->get_insert('vod_look', $add);
         }
     }
     //增加下载人气
     $this->db->query("update " . CS_SqlPrefix . "vod set xhits=xhits+1 where id=" . $row['id'] . "");
     //相关搜索数组
     $arr['cid'] = getChild($row['cid']);
     $arr['uid'] = $row['uid'];
     $arr['tags'] = $row['tags'];
     //装载模板并输出
     $Mark_Text = $this->CsdjTpl->plub_show('vod', $row, $arr, TRUE, 'down.html');
     //评论
     $dance_pl = "<div id='cscms_pl'><img src='" . Web_Path . "packs/images/load.gif'>&nbsp;&nbsp;加载评论内容,请稍等......</div>\r\n<script type='text/javascript'>var dir='vod';var did=" . $id . ";var cid=0;cscms_pl(1,0,0);</script>";
     $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);
     //输出下载地址
     $Data_Arr = explode("#cscms#", $row['durl']);
     if ($zu >= count($Data_Arr)) {
         $zu = 0;
     }
     $DataList_Arr = explode("\n", $Data_Arr[$zu]);
     $Dataurl_Arr = explode('$', $DataList_Arr[$ji]);
     $laiyuan = $Dataurl_Arr[2];
     //来源
     $url = $Dataurl_Arr[1];
     //地址
     $pname = $Dataurl_Arr[0];
     //当前集数
     $Mark_Text = str_replace("[down:url]", $url, $Mark_Text);
     //当前集下载地址
     $Mark_Text = str_replace("[down:laiy]", $laiyuan, $Mark_Text);
     //当前集来源
     $Mark_Text = str_replace("[down:ji]", $pname, $Mark_Text);
     //当前集数
     echo $Mark_Text;
 }
Exemple #10
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();
     //由于前面不是直接输出,所以这里需要加入写缓存
 }
Exemple #11
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>";
 }
Exemple #12
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/>";
         }
     }
 }
Exemple #13
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();
     //由于前面不是直接输出,所以这里需要加入写缓存
 }
Exemple #14
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();
     //由于前面不是直接输出,所以这里需要加入写缓存
 }
Exemple #15
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['down']['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['singerid'] = $row['singerid'];
     $arr['tags'] = $rows['tags'];
     //装载模板并输出
     $Mark_Text = $this->CsdjTpl->plub_show('dance', $row, $arr, TRUE, 'down.html', $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);
     }
     //标签加超级连接
     $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'];
         $durl = $row['durl'];
         if ($row['fid'] > 0) {
             $rowf = $this->db->query("Select purl,durl from " . CS_SqlPrefix . "dance_server where id=" . $row['fid'] . "")->row_array();
             if ($rowf) {
                 $purl = $rowf['purl'] . $row['purl'];
                 $durl = $rowf['durl'] . $row['durl'];
             }
         }
         $purl = annexlink($purl);
         $durl = annexlink($durl);
         $Mark_Text = str_replace("[dance:qurl]", $purl, $Mark_Text);
         $Mark_Text = str_replace("[dance:qxurl]", $durl, $Mark_Text);
     }
     unset($arr);
     echo $Mark_Text;
     $this->cache->end();
     //由于前面不是直接输出,所以这里需要加入写缓存
 }
Exemple #16
0
 public function cais()
 {
     header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
     header("Cache-Control: no-cache, must-revalidate");
     header("Pragma: no-cache");
     if (empty($_SERVER['HTTP_REFERER'])) {
         exit('QQ:848769359');
     }
     $id = intval($this->input->get_post('id', TRUE));
     $callback = $this->input->get('callback', true);
     $lists = array();
     $row2 = $this->db->query("select cid from " . CS_SqlPrefix . "dance where id='" . $id . "'")->row();
     $result2 = $this->db->query("select id,singerid,name,tid,fid,purl,sc,lrc from " . CS_SqlPrefix . "dance where cid=" . $row2->cid . " and yid=0 and hid=0 order by rand() desc LIMIT 10");
     $j = 0;
     foreach ($result2->result() as $row) {
         $lrc = str_checkhtml($row->lrc);
         if (empty($lrc)) {
             $lrc = '0';
         }
         $tpic = piclink('dancetopic', '');
         $topic = '-';
         $topiclink = '###';
         if ($row->tid > 0) {
             $rowt = $this->db->query("select id,pic,name from " . CS_SqlPrefix . "dance_topic where id=" . $row->tid . "")->row();
             if ($rowt) {
                 $topiclink = LinkUrl('topic/show', 'id', $row->tid, 1, 'dance');
                 $tpic = piclink('dancetopic', $rowt->pic);
                 $topic = $rowt->name;
             }
         }
         $purl = $row->purl;
         if ($row->fid > 0) {
             $rowf = $this->db->query("Select purl from " . CS_SqlPrefix . "dance_server where id=" . $row->fid . "")->row();
             if ($rowf) {
                 $purl = $rowf->purl . $row->purl;
             }
         }
         $singer = getzd('singer', 'name', $row->singerid);
         $lists[$j]['name'] = get_bm($row->name, 'gbk', 'utf-8');
         $lists[$j]['singer'] = empty($singer) ? '' : get_bm($singer, 'gbk', 'utf-8');
         $lists[$j]['singerlink'] = LinkUrl('show', 'id', $row->singerid, 1, 'singer');
         $lists[$j]['downlink'] = LinkUrl('down', 'id', $row->id, 1, 'dance');
         $lists[$j]['tpic'] = $tpic;
         $lists[$j]['topic'] = get_bm($topic, 'gbk', 'utf-8');
         $lists[$j]['topiclink'] = $topiclink;
         $lists[$j]['url'] = get_bm($purl, 'gbk', 'utf-8');
         $lists[$j]['id'] = $row->id;
         $lists[$j]['time'] = $this->get_time($row->sc);
         $lists[$j]['lrc'] = get_bm($lrc, 'gbk', 'utf-8');
         $j++;
     }
     echo $callback . "(" . json_encode($lists) . ")";
 }
Exemple #17
0
 public function down_save()
 {
     if ($this->huri['down']['check'] == 0) {
         admin_msg(L('plub_47'), '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_48'), site_url('dance/admin/html/down'));
     }
     //公众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_49'), 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('down', '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'];
         //装载模板并输出
         $Mark_Text = $this->CsdjTpl->plub_show('dance', $row, $arr, TRUE, 'down.html', $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]", "未加入", $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'];
             $durl = $row['durl'];
             if ($row['fid'] > 0) {
                 $rowf = $this->db->query("Select purl,durl from " . CS_SqlPrefix . "dance_server where id=" . $row['fid'] . "")->row_array();
                 if ($rowf) {
                     $purl = $rowf['purl'] . $row['purl'];
                     $durl = $rowf['durl'] . $row['durl'];
                 }
             }
             $purl = annexlink($purl);
             $durl = annexlink($durl);
             $Mark_Text = str_replace("[dance:qurl]", $purl, $Mark_Text);
             $Mark_Text = str_replace("[dance:qxurl]", $durl, $Mark_Text);
         }
         unset($arr);
         //生成
         write_file(FCPATH . $Htmllink, $Mark_Text);
         echo "&nbsp;<font style=font-size:10pt;>" . L('plub_50') . "<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/down_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>";
 }