Beispiel #1
0
 public function log()
 {
     $ac = $this->uri->segment(4);
     $user = $this->uri->segment(5);
     $this->load->model('CsdjUser');
     $callback = $this->input->get('callback', true);
     //判断会员是否关闭
     if (User_Mode == 0) {
         $Mark_Text = get_bm(User_No_info, 'gbk', 'utf-8');
         echo $callback . "({str:" . json_encode($Mark_Text) . "})";
         exit;
     }
     $ucid = 'logout';
     $login = $this->CsdjUser->User_Login(1);
     $template = !$login ? 'ulogin.html' : 'uinfo.html';
     if (!empty($ac) && is_file(FCPATH . 'plugins/' . $ac . '/config/site.php')) {
         $skins = '';
         if (!empty($user)) {
             if (!defined('HOMEPATH')) {
                 define('HOMEPATH', 'home');
             }
             $skins = Home_Fs == 1 ? getzd('user', 'skins', $user, 'name') : getzd('user', 'skins', $user);
         }
         $this->load->get_templates($ac, 1, $skins, 1);
     } elseif ($ac == 'home') {
         if (!defined('HOMEPATH')) {
             define('HOMEPATH', 'home');
         }
         $skins = Home_Fs == 1 ? getzd('user', 'skins', $user, 'name') : getzd('user', 'skins', $user);
         $this->load->get_templates($ac, 0, $skins, 1);
     } elseif ($ac != 'index') {
         $this->load->get_templates($ac);
     }
     $Mark_Text = $this->load->view($template, '', true);
     $Mark_Text = str_replace("{cscms:logadd}", "cscms_logadd();", $Mark_Text);
     $Mark_Text = str_replace("{cscms:logout}", "cscms_logout();", $Mark_Text);
     if (defined('HOMEPATH')) {
         $Mark_Text = $this->skins->cscms_common($Mark_Text, $skins);
     }
     if ($login) {
         $row = $this->CsdjDB->get_row_arr('user', '*', $_SESSION['cscms__id']);
         if (empty($row['nichen'])) {
             $row['nichen'] = $row['name'];
         }
         $Mark_Text = $this->skins->cscms_skins('user', $Mark_Text, $Mark_Text, $row);
         $ucid = $row['uid'];
     }
     $Mark_Text = $this->skins->template_parse($Mark_Text, false);
     //同步UC,解决高速浏览器不兼容
     if (User_Uc_Mode == 1) {
         $Mark_Text .= "<iframe marginwidth=\"0\" marginheight=\"0\" src=\"" . site_url('api/ulog/uclog') . "?uid=" . $ucid . "\" frameborder=\"0\" width=\"1\" scrolling=\"no\" height=\"1\" leftmargin=\"0\" topmargin=\"0\"></iframe>";
     }
     $Mark_Text = get_bm($Mark_Text, 'gbk', 'utf-8');
     echo $callback . "({str:" . json_encode($Mark_Text) . "})";
 }
function get_home_uid()
{
    if (Home_Ym == 1) {
        $arr = explode('.', $_SERVER['HTTP_HOST']);
        $uid = $arr[0];
    } else {
        $ci =& get_instance();
        $uid = $ci->uri->segment(1);
    }
    if (Home_Fs == 1) {
        $uid = getzd('user', 'id', $uid, 'name');
    }
    return (int) $uid;
}
Beispiel #3
0
 public function index()
 {
     if (!$this->CsdjUser->User_Login(1)) {
         exit('No Login');
     }
     //检测会员组上传附件权限
     $zuid = getzd('user', 'zid', $_SESSION['cscms__id']);
     $rowu = $this->CsdjDB->get_row('userzu', 'fid', $zuid);
     if ($rowu->fid == 0) {
         exit(L('up_01'));
     }
     $nums = intval($this->input->get('nums'));
     //支持数量
     $types = $this->input->get('type', true);
     //支持格式
     $data['tsid'] = $this->input->get('tsid', true);
     //返回提示ID
     $data['sid'] = intval($this->input->get('sid'));
     //返回输入框方法,0替换、1换行增加
     $data['dir'] = $this->input->get('dir', true);
     //上传目录
     $data['fid'] = $this->input->get('fid', true);
     //返回ID,一个页面多个返回可以用到
     $data['upsave'] = site_url('upload/up_save');
     $data['size'] = UP_Size;
     $data['types'] = empty($types) ? "*" : $types;
     $data['nums'] = $nums == 0 ? 1 : $nums;
     if ($data['fid'] == 'undefined') {
         $data['fid'] = '';
     }
     if ($data['tsid'] == 'undefined') {
         $data['tsid'] = '';
     }
     if ($data['types'] == 'undefined') {
         $data['types'] = '*';
     }
     if ($data['dir'] == 'undefined') {
         $data['dir'] = 'other';
     }
     $str['fid'] = $rowu->fid;
     $str['id'] = $_SESSION['cscms__id'];
     $str['login'] = $_SESSION['cscms__login'];
     $data['key'] = sys_auth(addslashes(serialize($str)), 'E');
     $this->load->get_templates('common');
     $this->load->view('upload.html', $data);
 }
Beispiel #4
0
    public function picsave()
    {
        $filename = $this->upload('bgpic');
        $bgpic = getzd('user', 'bgpic', $_SESSION['cscms__id']);
        //删除原来的图片
        $this->load->library('csup');
        $this->csup->del($bgpic, 'bgpic');
        //删除附件
        $edit['bgpic'] = date('Ym') . '/' . date('d') . '/' . $filename;
        $this->CsdjDB->get_update('user', $_SESSION['cscms__id'], $edit);
        $pic = piclink('bgpic', $edit['bgpic']) . '?size=720*186';
        echo '<script type="text/javascript">
				  parent.do_alert("' . L('web_04') . '");
				  parent.$(".file_working").hide();
				  parent.$(".banner_clip").show();
				  parent.$(".banner_clip").css("background","url(' . $pic . ')");
				  </script>';
    }
Beispiel #5
0
 public function index()
 {
     $data['zhuyan'] = $this->input->get_post('zhuyan', true, true);
     //主演
     $data['daoyan'] = $this->input->get_post('daoyan', true, true);
     //导演
     $data['yuyan'] = $this->input->get_post('yuyan', true, true);
     //语言
     $data['diqu'] = $this->input->get_post('diqu', true, true);
     //地区
     $data['year'] = $this->input->get_post('year', true, true);
     //年份
     $data['tags'] = $this->input->get_post('tags', true, true);
     //TAGS标签
     $data['type'] = $this->input->get_post('type', true, true);
     //剧情
     $data['key'] = $this->input->get_post('key', true, true);
     //关键字
     $data['cid'] = intval($this->input->get_post('cid', true));
     //分类ID
     $page = intval($this->input->get_post('page', true));
     //页数
     if ($page == 0) {
         $page = 1;
     }
     //搜索字母
     $zm = $this->input->get_post('zm', true, true);
     $data['zm']['zd'] = 'name';
     //要搜索的字母的字段
     $data['zm']['zm'] = $zm;
     //要搜索的字母
     //剧情分类ID
     $data['sid'] = $data['cid'];
     if ($data['cid'] > 0) {
         $fid = getzd('vod_list', 'fid', $data['cid']);
         $data['sid'] = $fid == 0 ? $data['cid'] : $fid;
     }
     //装载模板并输出
     $this->CsdjTpl->plub_search('vod', $data, $page);
 }
Beispiel #6
0
 public function changesave()
 {
     $token = $this->input->post('token', TRUE);
     if ($token != $_SESSION['token']) {
         msg_url(L('pay_06'), 'javascript:history.back();');
     }
     $rmb = intval($this->input->post('rmb'));
     if ($rmb < 1 || $rmb > 99999) {
         msg_url(L('pay_21'), 'javascript:history.back();');
     }
     //判断余额是否够
     $urmb = getzd('user', 'rmb', $_SESSION['cscms__id']);
     if ($urmb < $rmb) {
         msg_url(L('pay_22', array($rmb)), 'javascript:history.back();');
     }
     $cion = $rmb * User_RmbToCion;
     //修改入库
     $this->db->query("update " . CS_SqlPrefix . "user set rmb=rmb-" . $rmb . ",cion=cion+" . $cion . " where id=" . $_SESSION['cscms__id'] . "");
     //写入消费记录
     $add2['title'] = L('pay_23', array($cion));
     $add2['uid'] = $_SESSION['cscms__id'];
     $add2['dir'] = 'user';
     $add2['nums'] = $rmb;
     $add2['sid'] = 1;
     $add2['ip'] = getip();
     $add2['addtime'] = time();
     $this->CsdjDB->get_insert('spend', $add2);
     //发送通知
     $add['uida'] = $_SESSION['cscms__id'];
     $add['uidb'] = 0;
     $add['name'] = L('pay_24');
     $add['neir'] = L('pay_25', array($rmb, $cion));
     $add['addtime'] = time();
     $this->CsdjDB->get_insert('msg', $add);
     msg_url(L('pay_26', array($cion)), spacelink('pay/change'));
 }
Beispiel #7
0
 public function save()
 {
     $token = $this->input->post('token', TRUE);
     if ($token != $_SESSION['token']) {
         msg_url('非法提交~!', 'javascript:history.back();');
     }
     //检测发表权限
     $zuid = getzd('user', 'zid', $_SESSION['cscms__id']);
     $rowu = $this->CsdjDB->get_row('userzu', 'aid,sid', $zuid);
     if (!$rowu || $rowu->aid == 0) {
         msg_url('您所在会员组没有权限发表歌曲~!', 'javascript:history.back();');
     }
     //检测发表数据是否需要审核
     $music['yid'] = $rowu->sid == 1 ? 0 : 1;
     //必填字段
     $music['name'] = $this->input->post('name', TRUE, TRUE);
     $music['cid'] = intval($this->input->post('cid'));
     $music['purl'] = $this->input->post('purl', TRUE, TRUE);
     //检测必须字段
     if ($music['cid'] == 0) {
         msg_url('请选择歌曲分类~!', 'javascript:history.back();');
     }
     if (empty($music['name'])) {
         msg_url('歌曲名称不能为空~!', 'javascript:history.back();');
     }
     if (empty($music['purl'])) {
         msg_url('歌曲地址不能为空~!', 'javascript:history.back();');
     }
     //选填字段
     if (substr($music['purl'], 0, 7) != 'http://') {
         $music['purl'] = str_replace('//', '/', '/attachment/music/' . $music['purl']);
     }
     $music['tid'] = intval($this->input->post('tid'));
     $music['cion'] = intval($this->input->post('cion'));
     $music['text'] = str_replace("\r\n", "<br>", str_encode($_POST['text']));
     $music['lrc'] = $this->input->post('lrc', TRUE, TRUE);
     $music['pic'] = $this->input->post('pic', TRUE, TRUE);
     $music['tags'] = $this->input->post('tags', TRUE, TRUE);
     $music['zc'] = $this->input->post('zc', TRUE, TRUE);
     $music['zq'] = $this->input->post('zq', TRUE, TRUE);
     $music['bq'] = $this->input->post('bq', TRUE, TRUE);
     $music['hy'] = $this->input->post('hy', TRUE, TRUE);
     $music['durl'] = $music['purl'];
     $music['uid'] = $_SESSION['cscms__id'];
     $music['addtime'] = time();
     $singer = $this->input->post('singer', TRUE, TRUE);
     //判断歌手是否存在
     if (!empty($singer)) {
         $row = $this->CsdjDB->get_row('singer', 'id', $singer, 'name');
         if ($row) {
             $music['singerid'] = $row->id;
         }
     }
     //获取大小、音质、时长
     if (substr($music['purl'], 0, 7) != 'http://' && UP_Mode == 1) {
         if (UP_Pan == '') {
             $params['filename'] = FCPATH . $music['purl'];
         } else {
             $params['filename'] = UP_Pan . $music['purl'];
         }
         $this->load->library('mp3file', $params);
         $arr = $this->mp3file->get_metadata();
         $music['dx'] = !empty($arr['Filesize']) ? formatsize($arr['Filesize']) : '';
         $music['yz'] = !empty($arr['Bitrate']) ? $arr['Bitrate'] . ' Kbps' : '';
         $music['sc'] = !empty($arr['Length mm:ss']) ? $arr['Length mm:ss'] : '';
     }
     //增加到数据库
     $did = $this->CsdjDB->get_insert('dance', $music);
     if (intval($did) == 0) {
         msg_url('歌曲发布失败,请稍候再试~!', 'javascript:history.back();');
     }
     //摧毁token
     unset($_SESSION['token']);
     //增加动态
     $dt['dir'] = 'dance';
     $dt['uid'] = $_SESSION['cscms__id'];
     $dt['did'] = $did;
     $dt['yid'] = $music['yid'];
     $dt['title'] = '发布了歌曲';
     $dt['name'] = $music['name'];
     $dt['link'] = linkurl('play', 'id', $did, 1, 'dance');
     $dt['addtime'] = time();
     $this->CsdjDB->get_insert('dt', $dt);
     //如果免审核,则给会员增加相应金币、积分
     if ($music['yid'] == 0) {
         $addhits = getzd('user', 'addhits', $_SESSION['cscms__id']);
         if ($addhits < User_Nums_Add) {
             $this->db->query("update " . CS_SqlPrefix . "user set cion=cion+" . User_Cion_Add . ",jinyan=jinyan+" . User_Jinyan_Add . ",addhits=addhits+1 where id=" . $_SESSION['cscms__id'] . "");
         }
         msg_url('恭喜您,歌曲发布成功~!', spacelink('dance', 'dance'));
     } else {
         msg_url('恭喜您,歌曲发布成功,请等待管理员审核~!', spacelink('dance/verify', 'dance'));
     }
 }
Beispiel #8
0
 public function dt($id)
 {
     $sid = getzd('pic', 'sid', $id);
     $dt = $this->db->query("SELECT id,name FROM " . CS_SqlPrefix . "dt where link='" . linkurl('show', 'id', $sid, 1, 'pic') . "' and yid=1")->row();
     if ($dt) {
         $uid = getzd('pic', 'uid', $id);
         $addhits = getzd('user', 'addhits', $uid);
         $str = '';
         if ($addhits < User_Nums_Add) {
             $this->db->query("update " . CS_SqlPrefix . "user set cion=cion+" . User_Cion_Add . ",jinyan=jinyan+" . User_Jinyan_Add . ",addhits=addhits+1 where id=" . $uid . "");
             $str .= '同时为您增加' . User_Cion_Add . '个金币,' . User_Jinyan_Add . '个经验值,';
         }
         $this->db->query("update " . CS_SqlPrefix . "dt set yid=0,addtime='" . time() . "' where id=" . $dt->id . "");
         //发送歌曲审核通知
         $add['uida'] = $uid;
         $add['uidb'] = 0;
         $add['name'] = '图片审核通知';
         $add['neir'] = '恭喜您,您的图片《' . $dt->name . '》已经审核通过,' . $str . '感谢您的支持~~';
         $add['addtime'] = time();
         $this->CsdjDB->get_insert('msg', $add);
     }
 }
Beispiel #9
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/>";
         }
     }
 }
Beispiel #10
0
 public function pl($dir, $did, $cid = 0, $page = 1)
 {
     if (Pl_Modes == 1) {
         //友言
         return '<div id="uyan_frame"></div><script type="text/javascript" src="http://v2.uyan.cc/code/uyan.js?uid=' . Pl_Yy_Name . '"></script>';
     }
     if (Pl_Modes == 2) {
         //多说
         return "<div class='ds-thread' data-thread-key='" . $dir . "-" . $did . "'></div><script type='text/javascript'>var duoshuoQuery={short_name:\"" . Pl_Ds_Name . "\"};(function(){var ds=document.createElement('script');ds.type='text/javascript';ds.async=true;ds.src=(document.location.protocol=='https:'?'https:':'http:')+'//static.duoshuo.com/embed.js';ds.charset='UTF-8';(document.getElementsByTagName('head')[0]||document.getElementsByTagName('body')[0]).appendChild(ds)})();</script>";
     }
     if (Pl_Modes == 3) {
         //畅言
         return "<div id='SOHUCS' sid='" . $dir . "-" . $did . "'></div><script>(function(){var appid='" . Pl_Cy_Id . "',conf='prod_28f42ecbb9691ec71b9dcc68742151c2';var doc=document,s=doc.createElement('script'),h=doc.getElementsByTagName('head')[0]||doc.head||doc.documentElement;s.type='text/javascript';s.charset='utf-8';s.src='http://assets.changyan.sohu.com/upload/changyan.js?conf='+conf+'&appid='+appid;h.insertBefore(s,h.firstChild)})()</script>";
     }
     if (Pl_Modes == 4) {
         //网站关闭评论
         return "<div id='cscms_pl' style='text-align:center;'><b>网站已经关闭了评论~!</b></div>";
     }
     if ($did == 0) {
         //参数错误
         return "<div id='cscms_pl' style='text-align:center;'><b>参数错误,数据ID为空~!</b></div>";
     }
     $data_content = '';
     //Token
     $this->load->helper('string');
     $token = random_string('alnum', 10);
     $_SESSION['pltoken'] = $token;
     //装载模板
     if ($dir == 'blog') {
         $skins = getzd('user', 'skins', getzd('blog', 'uid', $did));
         $this->load->get_templates('home', 0, $skins);
     } else {
         $this->load->get_templates($dir, 1);
     }
     $Mark_Text = $this->load->view('pl.html', '', true);
     //预先除了分页
     $pagenum = getpagenum($Mark_Text);
     preg_match_all('/{cscms:([\\S]+)\\s+(.*?pagesize=\\"([\\S]+)\\".*?)}([\\s\\S]+?){\\/cscms:\\1}/', $Mark_Text, $page_arr);
     if (!empty($page_arr) && !empty($page_arr[2])) {
         $field = $page_arr[1][0];
         //前缀名
         //组装SQL数据
         $arr['did'] = $did;
         $sql = "SELECT {field} FROM " . CS_SqlPrefix . "pl where dir='" . $dir . "'";
         $sqlstr = $this->skins->cscms_sql($page_arr[1][0], $page_arr[2][0], $page_arr[0][0], $page_arr[3][0], 'id', $arr, $cid, $sql);
         $nums = $this->db->query($sqlstr)->num_rows();
         //总数量
         $Arr = spanajaxpage($sqlstr, $nums, $page_arr[3][0], $pagenum, 'cscms_pl', $page);
         if ($nums == 0) {
             $data_content .= "";
         } else {
             $sorti = 1;
             $result_array = $this->db->query($Arr[0])->result_array();
             foreach ($result_array as $row2) {
                 $datatmp = $this->skins->cscms_skins($field, $page_arr[0][0], $page_arr[4][0], $row2, $sorti);
                 $sorti++;
                 $data_content .= $datatmp;
             }
         }
         $Mark_Text = page_mark($Mark_Text, $Arr);
         //分页解析
         $Mark_Text = str_replace($page_arr[0][0], $data_content, $Mark_Text);
     }
     unset($page_arr);
     $Mark_Text = str_replace("[pl:token]", $token, $Mark_Text);
     //表情
     $plfaces = "";
     for ($i = 1; $i <= 56; $i++) {
         $plfaces .= "<img style='cursor:pointer;' src=\"" . Web_Path . "packs/images/faces/e" . $i . ".gif\" onclick=\"\$('#cscms_pl_content').val(\$('#cscms_pl_content').val()+'[em:" . $i . "]');\$('#cscms_faces').hide();\" />";
     }
     $Mark_Text = str_replace("[pl:faces]", $plfaces, $Mark_Text);
     //判断登录
     $login = '******';
     if (Pl_Youke == 0) {
         if (!$this->CsdjUser->User_Login(1)) {
             $login = '******';
         }
     }
     $Mark_Text = str_replace("[pl:login]", $login, $Mark_Text);
     $Mark_Text = $this->skins->template_parse($Mark_Text, false);
     return $Mark_Text;
 }
Beispiel #11
0
 public function add()
 {
     $callback = $this->input->get('callback', true);
     $token = $this->input->get_post('token', TRUE);
     $add['dir'] = $this->input->get_post('dir', TRUE);
     $add['content'] = $this->input->get_post('neir', TRUE);
     $add['content'] = facehtml(filter(get_bm($add['content'])));
     //转化回复
     $hf = 0;
     preg_match_all('/回复@(.*)@:/i', $add['content'], $bs);
     if (!empty($bs[0][0]) && !empty($bs[1][0])) {
         $uid = getzd('user', 'id', $bs[1][0], 'name');
         $nichen = getzd('user', 'nichen', $bs[1][0], 'name');
         $ulink = userlink('index', $uid, $bs[1][0]);
         if (empty($nichen)) {
             $nichen = $bs[1][0];
         }
         $b = '回复<a target="_blank" href="' . $ulink . '">@' . $nichen . '@</a>:';
         $add['content'] = str_replace($bs[0][0], $b, $add['content']);
         $hf = 1;
     }
     unset($bs);
     $add['did'] = intval($this->input->get_post('did'));
     if (Pl_Modes == 3) {
         $error = '10000';
     } elseif ($add['did'] == 0) {
         $error = '10001';
     } elseif (!isset($_SESSION['pltoken']) || $token != $_SESSION['pltoken']) {
         $error = '10002';
     } elseif (isset($_SESSION['pladdtime']) && time() < $_SESSION['pladdtime'] + 60) {
         $error = '10007';
     } elseif (empty($add['content'])) {
         $error = '10003';
     } elseif (Pl_Youke == 0 && empty($_SESSION['cscms__id'])) {
         //关闭游客评论
         $error = '10004';
     } else {
         $add['uid'] = isset($_SESSION['cscms__id']) ? intval($_SESSION['cscms__id']) : 0;
         $add['user'] = isset($_SESSION['cscms__name']) ? $_SESSION['cscms__name'] : '游客';
         $add['cid'] = intval($this->input->get_post('cid'));
         $add['fid'] = intval($this->input->get_post('fid'));
         $add['ip'] = getip();
         $add['addtime'] = time();
         $ids = $this->CsdjDB->get_insert('pl', $add);
         if (intval($ids) == 0) {
             $error = '10005';
             //失败
         } else {
             //摧毁token
             unset($_SESSION['token']);
             $error = '10006';
             $_SESSION['pladdtime'] = time();
             //发送通知
             if ($add['dir'] != 'singer') {
                 $dirname = getzd('plugins', 'name', $add['dir'], 'dir');
                 if ($add['dir'] == 'dance') {
                     $link = linkurl('play', 'id', $add['did'], 1, 'dance');
                 } elseif ($add['dir'] != 'blog') {
                     $link = linkurl('show', 'id', $add['did'], 1, $add['dir']);
                 }
                 if ($add['dir'] == 'pic') {
                     $dataname = getzd('pic_type', 'name', $add['did']);
                     $pluid = getzd('pic_type', 'uid', $add['did']);
                 } elseif ($add['dir'] == 'blog') {
                     $pluid = getzd('blog', 'uid', $add['did']);
                     $dataname = getzd('blog', 'neir', $add['did']);
                     $dirname = '说说';
                     $username = getzd('user', 'name', $pluid);
                     $link = userlink('blog', $pluid, $username, $add['did']);
                 } else {
                     $dataname = getzd($add['dir'], 'name', $add['did']);
                     $pluid = getzd($add['dir'], 'uid', $add['did']);
                 }
                 if ($hf == 0) {
                     $pltitle = vsprintf(L('pl_01'), array($dirname));
                     $plneir = vsprintf(L('pl_03'), array($_SESSION['cscms__name'], $dirname, $link, $dataname));
                 } else {
                     $pltitle = L('pl_02');
                     $plneir = vsprintf(L('pl_04'), array($_SESSION['cscms__name'], $link, $dataname));
                     $pluid = $uid;
                 }
                 if ($pluid > 0) {
                     $addm['uida'] = $pluid;
                     $addm['uidb'] = $_SESSION['cscms__id'];
                     $addm['name'] = $pltitle;
                     $addm['neir'] = $plneir;
                     $addm['addtime'] = time();
                     $this->CsdjDB->get_insert('msg', $addm);
                 }
             }
         }
     }
     echo $callback . "({error:" . $error . "})";
 }
Beispiel #12
0
 public function add()
 {
     $callback = $this->input->get('callback', true);
     $token = $this->input->get_post('token', TRUE);
     $add['uida'] = (int) $this->input->get_post('uid', TRUE);
     $add['neir'] = $this->input->get_post('neir', TRUE);
     $add['neir'] = facehtml(filter(get_bm($add['neir'])));
     //转化回复
     preg_match_all('/' . L('gbook_02') . '@(.*)@:/i', $add['neir'], $bs);
     if (!empty($bs[0][0]) && !empty($bs[1][0])) {
         $uid = getzd('user', 'id', $bs[1][0], 'name');
         $nichen = getzd('user', 'nichen', $bs[1][0], 'name');
         $ulink = userlink('index', $uid, $bs[1][0]);
         if (empty($nichen)) {
             $nichen = $bs[1][0];
         }
         $b = L('gbook_02') . '<a target="_blank" href="' . $ulink . '">@' . $nichen . '@</a>:';
         $add['neir'] = str_replace($bs[0][0], $b, $add['neir']);
     }
     unset($bs);
     if ($add['uida'] == 0) {
         $error = '10000';
     } elseif (!isset($_SESSION['gbooktoken']) || $token != $_SESSION['gbooktoken']) {
         $error = '10001';
     } elseif (isset($_SESSION['gbookaddtime']) && time() < $_SESSION['gbookaddtime'] + 30) {
         $error = '10006';
     } elseif (empty($add['neir'])) {
         $error = '10002';
     } elseif (empty($_SESSION['cscms__id'])) {
         $error = '10003';
     } else {
         $add['uidb'] = $_SESSION['cscms__id'];
         $add['fid'] = intval($this->input->get_post('fid'));
         $add['ip'] = getip();
         $add['addtime'] = time();
         $ids = $this->CsdjDB->get_insert('gbook', $add);
         if (intval($ids) == 0) {
             $error = '10004';
             //失败
         } else {
             //摧毁token
             unset($_SESSION['token']);
             $error = '10005';
             $_SESSION['gbookaddtime'] = time();
             //发送通知
             $addm['uida'] = $add['uida'];
             $addm['uidb'] = $_SESSION['cscms__id'];
             $addm['name'] = L('gbook_03');
             $addm['neir'] = vsprintf(L('ajax_04'), array($_SESSION['cscms__name']));
             $addm['addtime'] = time();
             $this->CsdjDB->get_insert('msg', $addm);
         }
     }
     echo $callback . "({error:" . $error . "})";
 }
Beispiel #13
0
 public function save()
 {
     $token = $this->input->post('token', TRUE);
     if ($token != $_SESSION['token']) {
         msg_url('非法提交~!', 'javascript:history.back();');
     }
     //检测发表权限
     $zuid = getzd('user', 'zid', $_SESSION['cscms__id']);
     $rowu = $this->CsdjDB->get_row('userzu', 'aid,sid', $zuid);
     if (!$rowu || $rowu->aid == 0) {
         msg_url('您所在会员组没有权限发表文章~!', 'javascript:history.back();');
     }
     //检测发表数据是否需要审核
     $news['yid'] = $rowu->sid == 1 ? 0 : 1;
     //选填字段
     $news['cion'] = intval($this->input->post('cion'));
     $news['pic'] = $this->input->post('pic', TRUE, TRUE);
     $news['tags'] = $this->input->post('tags', TRUE, TRUE);
     $news['info'] = $this->input->post('info', TRUE, TRUE);
     $news['uid'] = $_SESSION['cscms__id'];
     $news['addtime'] = time();
     //必填字段
     $news['name'] = $this->input->post('name', TRUE, TRUE);
     $news['cid'] = intval($this->input->post('cid'));
     $news['content'] = remove_xss($this->input->post('content'));
     //检测必须字段
     if ($news['cid'] == 0) {
         msg_url('请选择文章分类~!', 'javascript:history.back();');
     }
     if (empty($news['name'])) {
         msg_url('文章名称不能为空~!', 'javascript:history.back();');
     }
     if (empty($news['content'])) {
         msg_url('文章内容不能为空~!', 'javascript:history.back();');
     }
     //截取概述
     $news['info'] = sub_str(str_checkhtml($news['content']), 120);
     //增加到数据库
     $did = $this->CsdjDB->get_insert('news', $news);
     if (intval($did) == 0) {
         msg_url('文章发布失败,请稍候再试~!', 'javascript:history.back();');
     }
     //摧毁token
     unset($_SESSION['token']);
     //增加动态
     $dt['dir'] = 'news';
     $dt['uid'] = $_SESSION['cscms__id'];
     $dt['did'] = $did;
     $dt['yid'] = $news['yid'];
     $dt['title'] = '发布了文章';
     $dt['name'] = $news['name'];
     $dt['link'] = linkurl('show', 'id', $did, 1, 'news');
     $dt['addtime'] = time();
     $this->CsdjDB->get_insert('dt', $dt);
     //如果免审核,则给会员增加相应金币、积分
     if ($news['yid'] == 0) {
         $addhits = getzd('user', 'addhits', $_SESSION['cscms__id']);
         if ($addhits < User_Nums_Add) {
             $this->db->query("update " . CS_SqlPrefix . "user set cion=cion+" . User_Cion_Add . ",jinyan=jinyan+" . User_Jinyan_Add . ",addhits=addhits+1 where id=" . $_SESSION['cscms__id'] . "");
         }
         msg_url('恭喜您,文章发布成功~!', spacelink('news', 'news'));
     } else {
         msg_url('恭喜您,文章发布成功,请等待管理员审核~!', spacelink('news/verify', 'news'));
     }
 }
Beispiel #14
0
 public function save()
 {
     $token = $this->input->post('token', TRUE);
     if ($token != $_SESSION['token']) {
         msg_url('非法提交~!', 'javascript:history.back();');
     }
     //检测发表权限
     $zuid = getzd('user', 'zid', $_SESSION['cscms__id']);
     $rowu = $this->CsdjDB->get_row('userzu', 'aid,sid', $zuid);
     if (!$rowu || $rowu->aid == 0) {
         msg_url('您所在会员组没有权限发表视频~!', 'javascript:history.back();');
     }
     //检测发表数据是否需要审核
     $vod['yid'] = $rowu->sid == 1 ? 0 : 1;
     //选填字段
     $vod['cion'] = intval($this->input->post('cion'));
     $vod['dcion'] = intval($this->input->post('dcion'));
     $vod['text'] = str_replace("\r\n", "<br>", str_encode($_POST['text']));
     $vod['pic'] = $this->input->post('pic', TRUE, TRUE);
     $vod['tags'] = $this->input->post('tags', TRUE, TRUE);
     $vod['daoyan'] = $this->input->post('daoyan', TRUE, TRUE);
     $vod['zhuyan'] = $this->input->post('zhuyan', TRUE, TRUE);
     $vod['yuyan'] = $this->input->post('yuyan', TRUE, TRUE);
     $vod['diqu'] = $this->input->post('diqu', TRUE, TRUE);
     $vod['year'] = $this->input->post('year', TRUE, TRUE);
     $vod['info'] = $this->input->post('info', TRUE, TRUE);
     $vod['uid'] = $_SESSION['cscms__id'];
     $vod['addtime'] = time();
     $down = $this->input->post('down', TRUE, TRUE);
     $durl = $this->input->post('durl', TRUE, TRUE);
     //必填字段
     $vod['name'] = $this->input->post('name', TRUE, TRUE);
     $vod['cid'] = intval($this->input->post('cid'));
     $play = $this->input->post('play', TRUE, TRUE);
     $purl = $this->input->post('purl', TRUE, TRUE);
     //检测必须字段
     if ($vod['cid'] == 0) {
         msg_url('请选择视频分类~!', 'javascript:history.back();');
     }
     if (empty($vod['name'])) {
         msg_url('视频名称不能为空~!', 'javascript:history.back();');
     }
     if (empty($play)) {
         msg_url('视频播放来源不能为空~!', 'javascript:history.back();');
     }
     if (empty($purl)) {
         msg_url('视频播放地址不能为空~!', 'javascript:history.back();');
     }
     //播放地址组合
     if ($play != 'flv' && $play != 'media') {
         if (substr($purl, 0, 7) != 'http://') {
             msg_url('视频播放地址不正确~!', 'javascript:history.back();');
         }
         $arr = caiji($purl, 1);
         $form = $arr['laiy'];
         $purl = $arr['url'];
         if (empty($vod['pic'])) {
             $vod['pic'] = $arr['pic'];
         }
         $vod['purl'] = '第01集$' . $purl . '$' . $form;
     } else {
         $vod['purl'] = '第01集$' . $purl . '$' . $play;
     }
     //下载地址组合
     if (!empty($down) && !empty($durl)) {
         $vod['durl'] = '第01集$' . $durl . '$' . $down;
     }
     $singer = $this->input->post('singer', TRUE, TRUE);
     //判断歌手是否存在
     if (!empty($singer)) {
         $row = $this->CsdjDB->get_row('singer', 'id', $singer, 'name');
         if ($row) {
             $vod['singerid'] = $row->id;
         }
     }
     //增加到数据库
     $did = $this->CsdjDB->get_insert('vod', $vod);
     if (intval($did) == 0) {
         msg_url('视频发布失败,请稍候再试~!', 'javascript:history.back();');
     }
     //摧毁token
     unset($_SESSION['token']);
     //增加动态
     $dt['dir'] = 'vod';
     $dt['uid'] = $_SESSION['cscms__id'];
     $dt['did'] = $did;
     $dt['yid'] = $vod['yid'];
     $dt['title'] = '发布了视频';
     $dt['name'] = $vod['name'];
     $dt['link'] = linkurl('show', 'id', $did, 1, 'vod');
     $dt['addtime'] = time();
     $this->CsdjDB->get_insert('dt', $dt);
     //如果免审核,则给会员增加相应金币、积分
     if ($vod['yid'] == 0) {
         $addhits = getzd('user', 'addhits', $_SESSION['cscms__id']);
         if ($addhits < User_Nums_Add) {
             $this->db->query("update " . CS_SqlPrefix . "user set cion=cion+" . User_Cion_Add . ",jinyan=jinyan+" . User_Jinyan_Add . ",addhits=addhits+1 where id=" . $_SESSION['cscms__id'] . "");
         }
         msg_url('恭喜您,视频发布成功~!', spacelink('vod', 'vod'));
     } else {
         msg_url('恭喜您,视频发布成功,请等待管理员审核~!', spacelink('vod/verify', 'vod'));
     }
 }
Beispiel #15
0
 public function cscms_web($web, $content, $str)
 {
     $dir = CSCMS . 'tpl/home/';
     $newweb = '';
     if (is_dir($dir)) {
         if ($dh = opendir($dir)) {
             while (($file = readdir($dh)) != false) {
                 $filePath = $dir . $file;
                 if (is_dir($filePath)) {
                     $confiles = $filePath . '/config.php';
                     if (file_exists($confiles)) {
                         $con = (require_once $confiles);
                         $vip = '全部级别';
                         if ($con['vip'] > 0) {
                             $vip = getzd('userzu', 'name', $con['vip']);
                         }
                         $level = '全部等级';
                         if ($con['level'] > 0) {
                             $level = getzd('userlevel', 'name', $con['level']);
                         }
                         $pic = file_exists($filePath . '/preview.jpg') ? Web_Path . 'cscms/tpl/home/' . $con['dir'] . '/preview.jpg' : Web_Path . 'packs/images/skins.jpg';
                         $ystr = array('[web:pic]', '[web:name]', '[web:dir]', '[web:path]', '[web:vip]', '[web:level]', '[web:cion]');
                         $xstr = array($pic, $con['name'], $con['dir'], $con['path'], $vip, $level, $con['cion']);
                         $newweb .= str_replace($ystr, $xstr, $content);
                     }
                 }
             }
             closedir($dh);
         }
     }
     $str = str_replace($web, $newweb, $str);
     return $str;
 }
Beispiel #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) . ")";
 }
Beispiel #17
0
 public function save()
 {
     $token = $this->input->post('token', TRUE);
     if ($token != $_SESSION['token']) {
         msg_url('非法提交~!', 'javascript:history.back();');
     }
     //检测发表权限
     $zuid = getzd('user', 'zid', $_SESSION['cscms__id']);
     $rowu = $this->CsdjDB->get_row('userzu', 'aid,sid', $zuid);
     if ($rowu->aid == 0) {
         msg_url('您所在会员组没有权限创建专辑~!', 'javascript:history.back();');
     }
     //检测发表数据是否需要审核
     $album['yid'] = $rowu->sid == 1 ? 0 : 1;
     //必填字段
     $album['name'] = $this->input->post('name', TRUE, TRUE);
     $album['cid'] = intval($this->input->post('cid'));
     $album['pic'] = $this->input->post('pic', TRUE, TRUE);
     $album['neir'] = str_replace("\r\n", "<br>", str_encode(trim($_POST['neir'])));
     //检测必须字段
     if ($album['cid'] == 0) {
         msg_url('请选择专辑分类~!', 'javascript:history.back();');
     }
     if (empty($album['name'])) {
         msg_url('专辑名称不能为空~!', 'javascript:history.back();');
     }
     if (empty($album['pic'])) {
         msg_url('专辑图片不能为空~!', 'javascript:history.back();');
     }
     if (empty($album['neir'])) {
         msg_url('专辑介绍不能为空~!', 'javascript:history.back();');
     }
     //选填字段
     $album['yuyan'] = $this->input->post('yuyan', TRUE, TRUE);
     $album['diqu'] = $this->input->post('diqu', TRUE, TRUE);
     $album['tags'] = $this->input->post('tags', TRUE, TRUE);
     $album['fxgs'] = $this->input->post('fxgs', TRUE, TRUE);
     $album['year'] = $this->input->post('year', TRUE, TRUE);
     $album['uid'] = $_SESSION['cscms__id'];
     $album['addtime'] = time();
     $singer = $this->input->post('singer', TRUE, TRUE);
     //判断歌手是否存在
     if (!empty($singer)) {
         $row = $this->CsdjDB->get_row('singer', 'id', $singer, 'name');
         if ($row) {
             $album['singerid'] = $row->id;
         }
     }
     //增加到数据库
     $did = $this->CsdjDB->get_insert('dance_topic', $album);
     if (intval($did) == 0) {
         msg_url('专辑制作失败,请稍候再试~!', 'javascript:history.back();');
     }
     //摧毁token
     unset($_SESSION['token']);
     //增加动态
     $dt['dir'] = 'dance';
     $dt['uid'] = $_SESSION['cscms__id'];
     $dt['did'] = $did;
     $dt['yid'] = $album['yid'];
     $dt['title'] = '制作了专辑';
     $dt['name'] = $album['name'];
     $dt['link'] = linkurl('topic/show', 'id', $did, 1, 'dance');
     $dt['addtime'] = time();
     $this->CsdjDB->get_insert('dt', $dt);
     //如果免审核,则给会员增加相应金币、积分
     if ($album['yid'] == 0) {
         $addhits = getzd('user', 'addhits', $_SESSION['cscms__id']);
         if ($addhits < User_Nums_Add) {
             $this->db->query("update " . CS_SqlPrefix . "user set cion=cion+" . User_Cion_Add . ",jinyan=jinyan+" . User_Jinyan_Add . ",addhits=addhits+1 where id=" . $_SESSION['cscms__id'] . "");
         }
         msg_url('恭喜您,专辑制作成功~!', spacelink('album', 'dance'));
     } else {
         msg_url('恭喜您,专辑制作成功,请等待管理员审核~!', spacelink('album/verify', 'dance'));
     }
 }
Beispiel #18
0
 public function logo_save()
 {
     $uid = isset($_SESSION['cscms__id']) ? intval($_SESSION['cscms__id']) : intval($this->cookie->get_cookie('user_id'));
     $tempFile = file_get_contents("php://input");
     $picname = $uid . ".jpg";
     $picdirs = date('Ym') . "/" . date('d') . "/" . $uid . ".jpg";
     $filename = FCPATH . "attachment/logo/" . $picdirs;
     $filepath = UP_Mode == 1 ? '/' . date('Ym') . '/' . date('d') . '/' . $picname : '/' . date('Ymd') . '/' . $picname;
     if (!empty($tempFile) && $uid > 0) {
         //创建当前文件件
         $dir = FCPATH . "attachment/logo/" . date('Ym') . "/" . date('d');
         mkdirss($dir);
         if ($handle = fopen($filename, "w+")) {
             if (!fwrite($handle, $tempFile) == FALSE) {
                 fclose($handle);
             }
         }
         list($width, $height, $type, $attr) = getimagesize($filename);
         if (intval($width) < 10 || intval($height) < 10 || $type == 4) {
             @unlink($filename);
             exit('UploadPicError');
         }
         //判断水印
         if (CS_WaterMark == 1) {
             $this->load->library('watermark');
             $this->watermark->imagewatermark($filename);
         }
         //判断上传方式
         $this->load->library('csup');
         $res = $this->csup->up($filename, $picname);
         if (!$res) {
             @unlink($filename);
             exit('UploadPicError');
         }
         //删除原来的图片
         $pic = getzd('user', 'logo', $uid);
         if ($pic != $filepath) {
             $this->csup->del($pic, 'logo');
         }
         //写入数据库
         $this->db->query("update " . CS_SqlPrefix . "user set logo='" . $filepath . "' where id=" . $uid . "");
         exit('UploadPicSucceed');
     } else {
         exit('UploadPicError');
     }
 }
Beispiel #19
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();
     //由于前面不是直接输出,所以这里需要加入写缓存
 }
Beispiel #20
0
 public function get_templates($dir = NULL, $plubs = 0, $skins = NULL, $ulog = 0)
 {
     if (!defined('IS_ADMIN') && strpos(REQUEST_URI, 'index.php/install/') === FALSE && !file_exists(FCPATH . 'packs/install/plub_install.lock')) {
         msg_txt(L('plub_no_instal'), Web_Path . 'admin.php');
     }
     if (!defined('PLUBPATH') && $plubs == 0) {
         //系统默认视图路径
         $path = str_replace("\\", "/", CSCMS);
         if (!$dir) {
             $dirs = 'tpl/skins/' . Web_Skins;
         } else {
             if ($dir == 'user') {
                 $dirs = 'tpl/' . $dir . '/' . User_Skins;
                 //会员中心默认视图
             } elseif ($dir == 'home') {
                 if (!empty($skins)) {
                     $dirs = 'tpl/' . $dir . '/' . $skins;
                     //会员空间默认视图
                 } else {
                     $dirs = 'tpl/' . $dir . '/' . Home_Skins;
                     //会员空间默认视图
                 }
             } else {
                 $dirs = 'tpl/' . $dir . '/';
                 //系统后台视图
             }
         }
         if (defined('MOBILE') && Mobile_Is == 1) {
             //手机门户视图
             if ($dir == 'user') {
                 $dirs = 'tpl/mobile/' . Mobile_Skins . 'user/';
             } elseif ($dir == 'home') {
                 $dirs = 'tpl/mobile/' . Mobile_Skins . 'home/';
             } elseif ($dir != 'admin') {
                 $dirs = 'tpl/mobile/' . Mobile_Skins;
             }
         }
     } else {
         //版块视图路径
         $path = str_replace("\\", "/", APPPATH);
         $dir_file = APPPATH . 'config/site.php';
         if ($plubs == 1 && !defined('PLUBPATH')) {
             define('PLUBPATH', $dir);
             $path = FCPATH . 'plugins/' . $dir . '/';
             $dir_file = FCPATH . 'plugins/' . $dir . '/config/site.php';
         }
         $ak = getzd('plugins', 'ak', PLUBPATH, 'dir');
         if (empty($ak)) {
             msg_txt(vsprintf(L('plub_key_err1'), array(PLUBPATH)), Web_Path);
         }
         $arrs = unarraystring(sys_auth($ak, 'D'));
         if ($arrs == '' || empty($arrs['md5']) || md5(PLUBPATH . $arrs['key'] . host_ym(1)) != $arrs['md5']) {
             msg_txt(vsprintf(L('plub_key_err2'), array(PLUBPATH)), Web_Path);
         }
         $dirs = 'tpl/skins/default/';
         if (is_file($dir_file)) {
             $plub = (require $dir_file);
             if (is_array($plub)) {
                 //后台视图
                 if (defined('IS_ADMIN') && $plubs < 2) {
                     $dirs = 'tpl/admin/';
                     //手机视图
                 } elseif (!defined('IS_ADMIN') && defined('MOBILE') && $plub['Mobile_Is'] == 1) {
                     $dirs = 'tpl/mobile/' . $plub['Mobile_Dir'];
                     if (defined('HOMEPATH')) {
                         $dirs .= 'home/';
                     }
                     if (defined('USERPATH')) {
                         $dirs .= 'user/';
                     }
                     //前台视图
                 } else {
                     if (defined('HOMEPATH')) {
                         if ($ulog == 1) {
                             $path = str_replace("\\", "/", CSCMS);
                         }
                         if (!empty($skins)) {
                             $dirs = 'tpl/home/' . $skins;
                         } else {
                             $dirs = 'tpl/home/' . Home_Skins;
                         }
                     } elseif (defined('USERPATH')) {
                         $dirs = 'tpl/user/' . $plub['User_Dir'];
                     } else {
                         $dirs = 'tpl/skins/' . $plub['Skins_Dir'];
                     }
                 }
             }
         }
     }
     if (substr($dirs, -1) != '/') {
         $dirs .= '/';
     }
     $this->_ci_view_paths = array($path . $dirs => TRUE);
 }
Beispiel #21
0
 public function save()
 {
     $token = $this->input->post('token', TRUE);
     if ($token != $_SESSION['token']) {
         msg_url('非法提交~!', 'javascript:history.back();');
     }
     //检测发表权限
     $zuid = getzd('user', 'zid', $_SESSION['cscms__id']);
     $rowu = $this->CsdjDB->get_row('userzu', 'aid,sid', $zuid);
     if (!$rowu || $rowu->aid == 0) {
         msg_url('您所在会员组没有权限上传图片~!', 'javascript:history.back();');
     }
     //检测发表数据是否需要审核
     $pic['yid'] = $rowu->sid == 1 ? 0 : 1;
     //选填字段
     $pic['content'] = str_replace("\r\n", "<br>", str_encode($_POST['content']));
     $pic['uid'] = $_SESSION['cscms__id'];
     $pic['addtime'] = time();
     $name = $this->input->post('name', TRUE, TRUE);
     //必填字段
     $pic['sid'] = intval($this->input->post('sid'));
     $pic['cid'] = intval($this->input->post('cid'));
     $pic['pic'] = $this->input->post('pic', TRUE, TRUE);
     //检测必须字段
     if ($pic['cid'] == 0) {
         msg_url('请选择图片分类~!', 'javascript:history.back();');
     }
     if ($pic['sid'] == 0) {
         msg_url('请选择图片所属相册~!', 'javascript:history.back();');
     }
     if (empty($pic['pic'])) {
         msg_url('图片地址不能为空~!', 'javascript:history.back();');
     }
     //增加到数据库
     $did = $this->CsdjDB->get_insert('pic', $pic);
     if (intval($did) == 0) {
         msg_url('图片上传失败,请稍候再试~!', 'javascript:history.back();');
     }
     //摧毁token
     unset($_SESSION['token']);
     //增加动态
     $dt['dir'] = 'pic';
     $dt['uid'] = $_SESSION['cscms__id'];
     $dt['did'] = $pic['sid'];
     $dt['yid'] = $pic['yid'];
     $dt['title'] = '上传了图片到' . $name;
     $dt['name'] = $name;
     $dt['link'] = linkurl('show', 'id', $pic['sid'], 1, 'pic');
     $dt['addtime'] = time();
     $this->CsdjDB->get_insert('dt', $dt);
     //如果免审核,则给会员增加相应金币、积分
     if ($pic['yid'] == 0) {
         $addhits = getzd('user', 'addhits', $_SESSION['cscms__id']);
         if ($addhits < User_Nums_Add) {
             $this->db->query("update " . CS_SqlPrefix . "user set cion=cion+" . User_Cion_Add . ",jinyan=jinyan+" . User_Jinyan_Add . ",addhits=addhits+1 where id=" . $_SESSION['cscms__id'] . "");
         }
         msg_url('恭喜您,图片上传成功~!', spacelink('pic', 'pic'));
     } else {
         msg_url('恭喜您,图片上传成功,请等待管理员审核~!', spacelink('pic', 'pic') . '/index/0/1');
     }
 }
Beispiel #22
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();
     //由于前面不是直接输出,所以这里需要加入写缓存
 }
Beispiel #23
0
 public function save()
 {
     //检测发表权限
     $zuid = getzd('user', 'zid', $_SESSION['cscms__id']);
     $rowu = $this->CsdjDB->get_row('userzu', 'mid', $zuid);
     if ($rowu->mid == 0) {
         msg_url(L('msg_07'), 'javascript:history.back();');
     }
     $user = $this->input->post('user', true, true);
     $name = $this->input->post('name', true, true);
     $neir = $this->input->post('neir', true, true);
     if (empty($user)) {
         msg_url(L('msg_09'), 'javascript:history.back();');
     }
     $uid = getzd('user', 'id', $user, 'name');
     if (intval($uid) == 0) {
         msg_url(L('msg_10'), 'javascript:history.back();');
     }
     if (empty($name)) {
         msg_url(L('msg_11'), 'javascript:history.back();');
     }
     if (empty($neir)) {
         msg_url(L('msg_12'), 'javascript:history.back();');
     }
     $add['uida'] = $uid;
     $add['uidb'] = $_SESSION['cscms__id'];
     $add['name'] = $name;
     $add['neir'] = $neir;
     $add['addtime'] = time();
     $this->CsdjDB->get_insert('msg', $add);
     msg_url(L('msg_13'), spacelink('msg'));
 }
Beispiel #24
0
 public function dt($id)
 {
     $dt = $this->db->query("SELECT id,name FROM " . CS_SqlPrefix . "dt where link='" . linkurl('topic/show', 'id', $id, 1, 'dance') . "' and yid=1")->row();
     if ($dt) {
         $uid = getzd('dance_topic', 'uid', $id);
         $addhits = getzd('user', 'addhits', $uid);
         $str = '';
         if ($addhits < User_Nums_Add) {
             $this->db->query("update " . CS_SqlPrefix . "user set cion=cion+" . User_Cion_Add . ",jinyan=jinyan+" . User_Jinyan_Add . ",addhits=addhits+1 where id=" . $uid . "");
             $str .= L('plub_99');
         }
         $this->db->query("update " . CS_SqlPrefix . "dt set yid=0,addtime='" . time() . "' where id=" . $dt->id . "");
         //发送歌曲审核通知
         $add['uida'] = $uid;
         $add['uidb'] = 0;
         $add['name'] = L('plub_102');
         $add['neir'] = vsprintf(L('plub_103'), array($dt->name, $str));
         $add['addtime'] = time();
         $this->CsdjDB->get_insert('msg', $add);
     }
 }
Beispiel #25
0
 public function down()
 {
     $kstime = $this->input->get_post('kstime', true);
     $jstime = $this->input->get_post('jstime', true);
     $zd = $this->input->get_post('zd', true);
     $key = $this->input->get_post('key', true);
     $page = intval($this->input->get('page'));
     if ($page == 0) {
         $page = 1;
     }
     $kstimes = empty($kstime) ? 0 : strtotime($kstime) - 86400;
     $jstimes = empty($jstime) ? 0 : strtotime($jstime) + 86400;
     if ($kstimes > $jstimes) {
         $kstimes = strtotime($kstime);
     }
     $data['zd'] = $zd;
     $data['key'] = $key;
     $data['page'] = $page;
     $data['kstime'] = $kstime;
     $data['jstime'] = empty($jstime) ? date('Y-m-d') : $jstime;
     $sql_string = "SELECT * FROM " . CS_SqlPrefix . "dance_down where 1=1";
     if (!empty($key)) {
         if ($zd == 'user') {
             $uid = getzd('user', 'id', $key, 'name');
             $sql_string .= " and uid='" . intval($uid) . "'";
         } else {
             $sql_string .= " and name like '%" . $key . "%'";
         }
     }
     if ($kstimes > 0) {
         $sql_string .= " and addtime>" . $kstimes . "";
     }
     if ($jstimes > 0) {
         $sql_string .= " and addtime<" . $jstimes . "";
     }
     $sql_string .= " order by addtime desc";
     $query = $this->db->query($sql_string);
     $total = $query->num_rows();
     $base_url = site_url('dance/admin/opt/down') . "?zd=" . $zd . "&key=" . $key . "&kstime=" . $kstime . "&jstime=" . $jstime;
     $per_page = 15;
     $totalPages = ceil($total / $per_page);
     // 总页数
     $data['nums'] = $total;
     if ($total < $per_page) {
         $per_page = $total;
     }
     $sql_string .= ' limit ' . $per_page * ($page - 1) . ',' . $per_page;
     $query = $this->db->query($sql_string);
     $data['down'] = $query->result();
     $data['pages'] = get_admin_page($base_url, $totalPages, $page, 10);
     //获取分页类
     $this->load->view('down.html', $data);
 }