以下是代码
<?php
/**
* [Sanree] (C)2001-2099 Sanree Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: sanree_recharge.inc.php sanree $
*/
///error_reporting(E_ALL);
if(!defined('IN_DISCUZ')) {
exit('2018081422FJDh3o0t53||69948||1534474801');
}
define('CURMODE_SANREE_MODE', 'recharge');
if (CHARSET=='utf-8') {
define('C_CHARSET','_utf8');
} else {
define('C_CHARSET','');
}
$plugin['identifier'] = 'sanree_recharge';
define('IN_SANREE', TRUE);
$modfile = DISCUZ_ROOT.'./source/plugin/'.$plugin['identifier'].'/function/function_core.php';
@require_once($modfile);
$modfile = DISCUZ_ROOT.'./source/plugin/'.$plugin['identifier'].'/function/function_module.php';
@require_once($modfile);
define('APPC',DISCUZ_ROOT.'./source/plugin/'.$plugin['identifier'].'/condition/');
$modfile = APPC.'index.php';
@require_once($modfile);
global $_G;
foreach($_GET as $k => $v) {
$_G['sr_'.$k] = daddslashes($v);
}
$pluginversion = $_G['setting']['plugins']['version']['sanree_recharge'];
$discuz_version = $appVer;
$metakeywords = '';
$metadescription = '';
$groupid = $_G['group']['groupid'];
$mod = isset($_G['sr_mod']) ? $_G['sr_mod'] : 'myrecharge';
$modarray = array('orders', 'myrecharge', 'ordersshow', 'show2code', 'qrcode', 'return_url', 'notify_url', 'wx_native_notify');
$mobilearray = array('orders', 'myrecharge', 'ordersshow');
$mod = !in_array($mod, $modarray) ? 'myrecharge' : $mod;
$config = $_G['cache']['plugin']['sanree_recharge'];
$isopen = intval($config['isopen']);
if ($isopen!=1) {
showmessage(srlang('noopen'));
}
$config['rate'] = isset($config['rate']) ? intval($config['rate']) : 1000;
$rate = intval($config['rate']);
$rate = max(1, $rate);
$creditunit = intval($config['creditunit']);
if ($creditunit<1) {
showmessage(recharge_modlang('nocreditunit'));
}
$extcredits = $_G['setting']['extcredits'];
if(!empty($extcredits)) {
foreach($extcredits as $key => $val) {
$extcredits[$key]['account'] = getuserprofile('extcredits'.$key);
}
$creditsformula = str_replace('\$', '\\$', $_G['setting']['creditsformula']);
$member = $_G['member'];
eval("\$allcredit = $creditsformula;");
}
define('IS_DEBUG_LOG', $config['islog']);
$creditunitname = $_G['setting']['extcredits'][$creditunit]['title'];
$allowgroup = unserialize($config['allowgroup']);
$defaultprice = $config['defaultprice'];
$minamount = intval($config['minamount']);
$threshold = intval($config['threshold']);
$threshold = max(0, $threshold);
$firstadd = intval($config['firstadd']);
$firstadd = max(0, $firstadd);
$firsttxt = trim($config['firsttxt']);
$firsttxt = str_replace(array('{threshold}','{credit}'), array('<span>'.$threshold.'</span>', '<span>'.$firstadd.'</span>'), $firsttxt);
$moddir = 'module/';
$template = 'default';
define('sanree_recharge_PATH', 'source/plugin/sanree_'.CURMODE_SANREE_MODE);
if (!file_exists(sanree_recharge_PATH."/template/".$template."/copyright.xml")) {
define('sanree_recharge_TPL', 'source/plugin/sanree_'.CURMODE_SANREE_MODE.'/template/default/');
define('sanree_recharge_IMG', sanree_recharge_TPL.'images');
define('sanree_recharge_JS', sanree_recharge_TPL.'js');
} else{
define('sanree_recharge_TPL', 'source/plugin/sanree_'.CURMODE_SANREE_MODE.'/template/'.$template.'/');
define('sanree_recharge_IMG', sanree_recharge_TPL.'images');
define('sanree_recharge_JS', sanree_recharge_TPL.'js');
}
$modelurl = recharge_getmodeurl();
$ismobilechk = 1;
if($ismobilechk){
require_once libfile('class/sanree_recharge_mobile','plugin/sanree_recharge');
$sanreemobile = new sanree_recharge_mobile();
if(defined('IN_SANREE_MOBILE')){
$template = 'touch/'.$template;
}
}
if((defined('IN_MOBILE') || defined('IN_SANREE_MOBILE')) && in_array($mod, $mobilearray)) {
$modfile = DISCUZ_ROOT.'./source/plugin/'.$plugin['identifier'].'/function/function_mobile.php';
@require_once($modfile);
if(file_exists(sanree_recharge_PATH."/template/".$template)){
define('sanree_recharge_TOUCH', 'source/plugin/sanree_'.CURMODE_SANREE_MODE.'/template/');
define('TOUCH_CSS', sanree_recharge_TOUCH.$template.'/');
define('TOUCH_JS', sanree_recharge_TOUCH.$template.'/js');
define('TOUCH_IMG', sanree_recharge_TOUCH.$template.'/images');
define('sanree_recharge_touch_TPL', 'source/plugin/sanree_recharge/template/touch/default/');
} else{
$template = 'touch/default';
define('sanree_recharge_TOUCH', 'source/plugin/sanree_'.CURMODE_SANREE_MODE.'/template/touch/default/');
define('TOUCH_CSS', sanree_recharge_TOUCH.'/');
define('TOUCH_JS', sanree_recharge_TOUCH.'js');
define('TOUCH_IMG', sanree_recharge_TOUCH.'images');
define('sanree_recharge_touch_TPL', 'source/plugin/sanree_recharge/template/touch/default/');
}
$moddir = 'mobile/';
if ($_G['setting']['mobile']['allowmobile'] == true && $_G['setting']['mobile']['mobileforward'] == true) {
$onsubmitcharset = 'accept-charset="utf-8" onsubmit="document.charset=\'utf-8\';"';
}
}
require_once recharge_sanree_libfile($moddir.$plugin['identifier'].'/'.$mod, $plugin['identifier']);
?> |