public function verification($admin, $rand, $code) { $key = $this->keys($admin); $url = $this->url . 'verification?key=' . $key . '&code=' . cs_base64_encode(arraystring(array('host' => Web_Url, 'name' => Web_Name, 'admin' => $admin, 'code' => $code, 'rand' => $rand, 'version' => CS_Version))); $str = $this->get_url($url); return $str; }
public function bottom() { $data['code'] = cs_base64_encode(arraystring(array('self' => Web_Path . SELF, 'version' => CS_Version, 'charset' => CS_Charset, 'uptime' => CS_Uptime))); $this->load->view('bottom.html', $data); }
function keys($data, $mx = 'plub') { $url = CS_YPTURL . $mx . '/key?param=' . cs_base64_encode(arraystring(array('site' => Web_Url, 'url' => 'http://' . Web_Url . Web_Path, 'data' => $data, 'admin' => SELF, 'encry' => CS_Encryption_Key))); return htmlall($url); }
public function pay($id = 0, $zu = 0, $ji = 0) { //判断ID if ($id == 0) { exit; } //获取数据 $row = $this->CsdjDB->get_row_arr('vod', 'name,cid,uid,yid,hid,id,vip,level,cion,purl', $id); if (!$row || $row['yid'] > 0 || $row['hid'] > 0) { exit("alert('数据没有审核,或者被删除~!');"); } if (empty($row['purl'])) { exit("alert('视频播放地址不正确!');"); } //判断收费 if ($row['vip'] > 0 || $row['level'] > 0 || $row['cion'] > 0) { $login = $this->CsdjUser->User_Login(1); if (!$login) { exit("alert('抱歉,该视频需要登录才能观看,请先登录!');"); } $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']) { exit("alert('抱歉,您所在的会员组不能观看该视频,请先升级!');"); } } //判断会员等级下载权限 if ($row['level'] > 0 && $row['uid'] != $_SESSION['cscms__id']) { if ($row['level'] > $rowu['level']) { exit("alert('抱歉,您等级不够,不能观看该视频!');"); } } //判断金币下载 $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']) { exit("alert('这部视频观看每集需要" . $row['cion'] . "个金币,您的当前金币不够,请先充值!');"); } 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); } } $xpurl = ""; //下集播放地址 $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]); $laiyuan = $Dataurl_Arr[2]; //来源 $url = $Dataurl_Arr[1]; //地址 if (count($DataList_Arr) > $ji + 1) { $Dataurl_Arr2 = explode('$', $DataList_Arr[$ji + 1]); $xpurl = @$Dataurl_Arr2[1]; //下集播放地址 } else { $xpurl = ''; //下集播放地址 } 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); } //手机播放地址 if (substr($url, 0, 7) == 'http://') { $url = $url; } else { $url = 'http://download.chshcms.com/mp4/' . $laiyuan . '/' . cs_base64_encode($url) . '/cscms.mp4'; } echo "var cs_url='" . $url . "';var cs_xpurl='" . $xpurl . "';"; }