public function init() { $allow_visitor = htmlspecialchars($_GET['allow_visitor']); $auth = sys_auth($allow_visitor, 'DECODE'); if (strpos($auth, '|') === false) { showmessage(L('illegal_operation')); } $auth_str = explode('|', $auth); $flag = $auth_str[0]; if (!preg_match('/^([0-9]+)|([0-9]+)/', $flag)) { showmessage(L('illegal_operation')); } $readpoint = intval($auth_str[1]); $paytype = intval($auth_str[2]); $http_referer = urldecode($_GET['http_referer']); if (!$readpoint) { showmessage(L('illegal_operation')); } pc_base::load_app_class('spend', 'pay', 0); $flag_arr = explode('_', $flag); $catid = $flag_arr[0]; $siteids = getcache('category_content', 'commons'); $siteid = $siteids[$catid]; $CATEGORYS = getcache('category_content_' . $siteid, 'commons'); if (isset($CATEGORYS[$catid])) { $setting = string2array($CATEGORYS[$catid]['setting']); $repeatchargedays = intval($setting['repeatchargedays']); if ($repeatchargedays) { $fromtime = SYS_TIME - 86400 * $repeatchargedays; $r = spend::spend_time($this->userid, $fromtime, $flag); if ($r) { showmessage(L('have_pay'), $http_referer, 1000); } } } if ($paytype) { if (spend::amount($readpoint, L('msg_readpoint'), $this->userid, $this->username, '', '', $flag) == false) { $msg = spend::get_msg(); $http_referer = APP_PATH . 'index.php?m=pay&c=deposit&a=pay'; } else { $msg = L('readpoint_pay', array('readpoint' => $readpoint)); } } else { if (spend::point($readpoint, L('msg_readpoint'), $this->userid, $this->username, '', '', $flag) == false) { $msg = spend::get_msg(); $http_referer = APP_PATH . 'index.php?m=pay&c=deposit&a=pay'; } else { $msg = L('readpoint_pay_point', array('readpoint' => $readpoint)); } } showmessage($msg, $http_referer, 3000); }
/** * 检查支付状态 */ private function _check_payment($flag, $paytype) { $_userid = param::get_cookie('_userid'); $_username = param::get_cookie('_username'); if (!$_userid) { return false; } pc_base::load_app_class('spend', 'pay', 0); $setting = $this->category_setting; $repeatchargedays = intval($setting['repeatchargedays']); if ($repeatchargedays) { $fromtime = SYS_TIME - 86400 * $repeatchargedays; $r = spend::spend_time($_userid, $fromtime, $flag); if ($r['id']) { return true; } } return false; }
/** * 检查支付状态 */ protected function _check_payment($flag, $paytype) { $_userid = $this->_userid; $_username = $this->_username; if (!$_userid) { return false; } Loader::lib('pay:spend'); $setting = $this->category_setting; $repeatchargedays = intval($setting['repeatchargedays']); if ($repeatchargedays) { $fromtime = TIME - 86400 * $repeatchargedays; $r = spend::spend_time($_userid, $fromtime, $flag); if ($r['id']) { return true; } } return false; }
/** * 检查支付状态 */ protected function _check_payment($flag,$paytype) { $_userid = $this->_userid; $_username = $this->_username; if(!$_userid) return false; pc_base::load_app_class('spend','pay',0); $setting = $this->category_setting; $repeatchargedays = intval($setting['repeatchargedays']); if($repeatchargedays) { $fromtime = SYS_TIME - 86400 * $repeatchargedays; $r = spend::spend_time($_userid,$fromtime,$flag); if($r['id']) return true; } return false; }
/** * 检查支付状态 */ private function _check_payment($flag, $paytype, $catid) { $_userid = param::get_cookie('_userid'); $_username = param::get_cookie('_username'); $siteids = getcache('category_content', 'commons'); $siteid = $siteids[$catid]; $CATEGORYS = getcache('category_content_' . $siteid, 'commons'); $this->category = $CATEGORYS[$catid]; $this->category_setting = string2array($this->category['setting']); if (!$_userid) { return false; } pc_base::load_app_class('spend', 'pay', 0); $setting = $this->category_setting; $repeatchargedays = intval($setting['repeatchargedays']); if ($repeatchargedays) { $fromtime = SYS_TIME - 86400 * $repeatchargedays; $r = spend::spend_time($_userid, $fromtime, $flag); if ($r['id']) { return true; } } return false; }
/** * 检查支付状态 */ private function _check_payment($flag, $paytype, $catid) { $_userid = cookie('_userid'); $_username = cookie('_username'); $CATEGORYS = S('common/category_content'); $this->category = $CATEGORYS[$catid]; $this->category_setting = string2array($this->category['setting']); if (!$_userid) { return false; } Loader::lib('pay:spend', false); $setting = $this->category_setting; $repeatchargedays = intval($setting['repeatchargedays']); if ($repeatchargedays) { $fromtime = TIME - 86400 * $repeatchargedays; $r = spend::spend_time($_userid, $fromtime, $flag); if ($r['id']) { return true; } } return false; }