本文整理汇总了PHP中load类的典型用法代码示例。如果您正苦于以下问题:PHP load类的具体用法?PHP load怎么用?PHP load使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了load类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doin
public function doin()
{
global $_M;
if ($_M['form']['temname'] && $_M['form']['temname'] != '') {
$query = "INSERT INTO {$_M['table']['skin_table']} SET skin_name='{$_M['form']['temname']}',skin_file='{$_M['form']['temname']}',skin_info='',devices='{$_M['form']['devices']}'";
DB::query($query);
} else {
turnover("{$_M[url][own_name]}c=temtool&a=dotemlist", '操作失败!请填写模板文件夹名称!');
die;
}
if (file_exists(PATH_WEB . "templates/{$_M['form']['temname']}/install/install.class.php")) {
copy(PATH_WEB . "templates/{$_M['form']['temname']}/install/install.class.php", PATH_OWN_FILE . 'tmp/install.class.php');
$ini = load::own_class('admin/tmp/install', 'new');
$file = $_M['form']['temname'];
$re = $ini->dosql();
$query = "DELETE FROM {$_M['table']['templates']} WHERE no='{$file}'";
DB::query($query);
foreach ($_M['langlist']['web'] as $key => $val) {
foreach ($re['sql'] as $ksql => $vsql) {
$query = "INSERT INTO {$_M['table']['templates']} SET no='{$file}',lang='{$key}',{$vsql}";
DB::query($query);
}
}
} else {
if (file_exists(PATH_WEB . "templates/{$_M['form']['temname']}/lang/language_cn.ini")) {
$ini = load::own_class('admin/class/inc', 'new');
$ini->ini($_M['form']['temname']);
}
}
turnover("{$_M[url][own_name]}c=temtool&a=dotemlist");
}
示例2: get_met_cookie
/**
* 获取COOKIE值
* @param string $key 指定键值
* @return string $_M['user']['cookie'][$key] 返回当前管理员或会员的相关COOKIE值
* 例:get_met_cookie('metinfo_admin_name'):返回当前管理员的账号
get_met_cookie('metinfo_member_name'):返回当前会员的账号
get_met_cookie('metinfo_admin_pass'):返回当前管理员的密码
get_met_cookie('metinfo_member_pass'):返回当前会员的密码
*/
function get_met_cookie($key)
{
global $_M;
if (defined('IN_ADMIN')) {
if ($key == 'metinfo_admin_name' || $key == 'metinfo_member_name') {
$val = urldecode($_M['user']['cookie'][$key]);
$val = sqlinsert($val);
return $val;
}
return $_M['user']['cookie'][$key];
} else {
$userclass = load::sys_class('user', 'new');
if (!$userclass->get_login_user_info()) {
$userclass->login_by_auth($_M['form']['acc_auth'], $_M['form']['acc_key']);
}
$m = $userclass->get_login_user_info();
$m['metinfo_admin_name'] = $m['username'];
$m['metinfo_member_name'] = $m['username'];
$m['metinfo_member_id'] = $m['id'];
$m['metinfo_admin_id'] = $m['id'];
$m['metinfo_admin_pass'] = $m['password'];
$m['metinfo_member_pass'] = $m['password'];
if ($key == 'metinfo_admin_name' || $key == 'metinfo_member_name') {
$val = urldecode($m[$key]);
$val = sqlinsert($val);
return $val;
}
return $m[$key];
}
}
示例3: __construct
function __construct()
{
global $_M;
parent::__construct();
$this->moduleclass = load::mod_class('content/class/sys_article', 'new');
$this->module = 2;
}
示例4: donews_info
public function donews_info()
{
global $_M;
$sval = $_M['form']['search_title'];
$table = load::sys_class('tabledata', 'new');
//加载表格数据获取类
$where = "(lang='{$_M['lang']}' or lang='metinfo') ";
//整理查询条件
if ($_M['form']['search_type'] && $_M['form']['search_type'] != 'all') {
$where .= " AND type like '%{$_M['form']['search_type']}%'";
}
if ($sval) {
$where .= " AND member like '%{$sval}%'";
}
$order = "time DESC";
//排序方式
$array = $table->getdata($_M['table']['infoprompt'], '*', $where, $order);
$j = 1;
$url = '';
foreach ($array as $key => $val) {
if ($val['type'] == 'job') {
$title = $val['newstitle'];
$news_type = $_M['word']['recruitment_information'];
$url = $_M['url']['site_admin'] . "content/job/cv_editor.php?anyid=29&lang={$_M['lang']}&id={$val['news_id']}";
}
if (strstr($val['type'], "feedback")) {
$title = $_M['word']['news_prompt1'];
$news_type = $_M['word']['physicalunread1'];
$type = explode('-', $val['type']);
$url = $_M['url']['site_admin'] . "content/feedback/editor.php?anyid=29&id={$val['news_id']}&lang={$_M['lang']}&class1={$type['1']}";
}
if (strstr($val['type'], "message")) {
$title = $_M['word']['news_prompt'];
$news_type = $_M['word']['physicalunread2'];
$type = explode('-', $val['type']);
$url = $_M['url']['site_admin'] . "message/editor.php?anyid=29&id={$val['news_id']}&lang={$_M['lang']}&class1={$type['1']}";
}
if ($val['type'] == 'official') {
$title = $val['newstitle'];
$news_type = $_M['word']['official_information'];
$url = "{$_M['url']['own_form']}a=doofficial&id={$val['id']}";
}
$valinfo = $val['content'];
$val['content'] = preg_replace('#^(?:[\\x00-\\x7F]|[\\xC0-\\xFF][\\x80-\\xBF]+){0,0}' . '((?:[\\x00-\\x7F]|[\\xC0-\\xFF][\\x80-\\xBF]+){0,30}).*#s', '$1', $valinfo);
if ($valinfo != $val['content']) {
$val['content'] .= '..';
}
$time = date("Y-m-d H:i:s", $val['time']);
if ($val['see_ok'] == '0') {
$color = '#656565';
} else {
$color = '#c5c5c9';
}
$list = array();
$list[] = "<a href='{$_M['url']['own_form']}a=donews_jump&id={$val['id']}' style='color:{$color};' >{$title}</a>";
$list[] = $time;
$rarray[] = $list;
}
$table->rdata($rarray);
}
示例5: dopatch
public function dopatch()
{
global $_M;
$curl = load::sys_class('curl', 'new');
$curl->set('file', '?n=platform&c=system&a=dopatch');
$post_data = array('cmsver' => $_M['config']['metcms_v'], 'patch' => $_M['config']['met_patch']);
$difilelist = $curl->curl_post($post_data, 10);
$difilelists = stringto_array($difilelist, '|', '*', ':');
if ($difilelists[0][0][0] == 'suc') {
foreach ($difilelists[1] as $keylist => $vallist) {
$met_patch = $vallist[0];
unset($vallist[0]);
foreach ($vallist as $key => $val) {
$dlfile = load::sys_class('dlfile', 'new');
$copydir = str_replace(':/admin/', ':/' . $_M['config']['met_adminfile'] . '/', ':/' . $val);
$copydir = str_replace(':/', '', $copydir);
$re = $dlfile->dlfile('file/v' . $_M['config']['metcms_v'] . '/file/' . $val, PATH_WEB . $copydir, 'metcms');
if ($re != 1) {
break;
}
}
$update_file = PATH_WEB . "{$_M['config'][met_adminfile]}/update/patch/v{$_M['config']['metcms_v']}_{$met_patch}.class.php";
if (file_exists($update_file)) {
require_once $update_file;
}
@unlink($update_file);
$query = "update {$_M['table']['config']} set value='{$met_patch}' where name='met_patch'";
DB::query($query);
}
echo 1;
} else {
echo 2;
}
die;
}
示例6: json_list
public function json_list($where, $order)
{
global $_M;
$this->table = load::sys_class('tabledata', 'new');
$where = "lang='{$_M['lang']}' and (recycle = '0' or recycle = '-1') {$where}";
$data = $this->table->getdata($this->tablename, '*', $where, $order);
return $data;
}
示例7: __construct
/**
* @func void
* @return void
*/
public function __construct()
{
echo 'tss1 controller works<br/>';
/*
load::service('validator');
$rules = array
(
'name' => 'alpha|required',
'year' => 'num|required',
);
$Validation = new Validator();
$Validation->validate($_POST, $rules);
if (!$Validation->passed())
{
$Validation->goBackWithErrors();
}
if (!empty($Validation->getErrors()))
{
print_r($Validation->getErrors());
}
*/
load::library(SF::STRINGS);
load::library(SF::NETWORK);
#$test_string = Strings::generate_password(4);
$test_string = Strings::generatePassword(4);
var_dump($test_string);
$numeric_test = (int) '-abc12.3edf';
// this SHOULD FALL AND THROW AN ERROR
#var_dump(Strings::strip_to_numeric($numeric_test));
var_dump(Strings::StripToNumeric($numeric_test));
#var_dump(Network::get_client_lang());
var_dump(Network::getClientLang());
exit;
// database testing
$data = Entries::getData();
var_dump($data);
/*
load::library(SF::DEBUG);
//load::library(SF::DEBUG)->func('pr'); // will only load clean_str()
ExecuteTime::start();
$parameters = array
(
'key' => '1e46165dsa5ds4a',
'action' => 'push',
'userid' => 1234998,
'keywords' => 'test'
);
ExecuteTime::end();
echo ExecuteTime::display();
*/
}
示例8: del
public static function del($file, $type = 'php')
{
load::sys_func('file');
if ($type == 'file') {
@deldir(PATH_CACHE . $file);
} else {
@unlink(PATH_CACHE . $file . '.' . $type);
}
}
示例9: config
static function config()
{
parent::config();
// load the default panel config file
self::file(c::get('root.panel') . '/defaults/config/config.php');
$root = c::get('root.site') . '/' . c::get('panel.folder') . '/config';
self::file($root . '/config.php');
self::file($root . '/config.' . server::get('server_name') . '.php');
}
示例10: __construct
protected function __construct()
{
load::service('DB');
// calling a connector class into an instance
if (is_null($this->DB)) {
$this->DB = new DB();
}
// returning the connector class
return $this;
}
示例11: doauth
public function doauth()
{
global $_M;
$auth = load::mod_class('system/class/auth', 'new');
if ($auth->dl_auth($_M['form']['authpass'], $_M['form']['authcode'])) {
turnover("{$_M['url']['own_form']}a=doindex");
} else {
turnover("{$_M['url']['own_form']}a=doindex", $_M['word']['authTip2']);
}
}
示例12: __construct
public function __construct()
{
parent::__construct();
global $_M;
nav::set_nav(1, '会员列表', $_M['url']['own_name'] . 'c=admin_user&a=doindex');
nav::set_nav(2, '会员组', $_M['url']['own_name'] . 'c=admin_group&a=doindex');
nav::set_nav(3, '会员属性', $_M['url']['own_name'] . 'c=admin_set&a=douserfield');
nav::set_nav(4, '会员功能设置', $_M['url']['own_name'] . 'c=admin_set&a=doindex');
nav::set_nav(5, '社会化登录', $_M['url']['own_name'] . 'c=admin_set&a=doopen');
$this->userclass = load::mod_class('user/class/sys_user', 'new');
}
示例13: start
/**
* Function start function server JSON RPC.
* @access public
* @static
*/
public static function start()
{
// checks if a JSON-RCP request has been received.
if ($_SERVER['REQUEST_METHOD'] != 'POST' || empty($_SERVER['CONTENT_TYPE']) || !preg_match('/application\\/json/i', $_SERVER['CONTENT_TYPE'])) {
// If cross Domain true.
if (config::sys('crossDomain') == 1) {
header('Access-Control-Allow-Origin: *');
header('Access-Control-Request-Method: POST');
header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept');
}
// class html startTmpl.
html::startTmpl();
} else {
// reads the input data.
$request = json_decode(file_get_contents('php://input'), true);
// Gestion error.
try {
// Si app-maintenance.
if (config::sys('off') != 1) {
// Exception.
throw new Exception('SERV-ERROR-OFFLINE-MESSAGE');
}
// method post.
$reqConMethod = explode('_', $request['method']);
// Controleur.
$control = util::filtre($reqConMethod[0]);
// Action.
$action = util::filtre($reqConMethod[1]);
// Load.
load::auto('controleur_' . $control);
// forward_static_call_array.
if ($result = @forward_static_call_array(array($control, $action), $request['params'])) {
// Succes. Array.
$response = array('id' => $request['id'], 'result' => $result, 'jsonrpc' => $request['jsonrpc'], 'error' => NULL);
} else {
throw new Exception('SERV-ERROR-INVALID-PARAM-OR-METHODE');
}
} catch (Exception $e) {
// JSON RPC Error. Array.
$response = array('id' => $request['id'], 'result' => NULL, 'jsonrpc' => $request['jsonrpc'], 'error' => $e->getMessage());
}
// output the response.
header('content-type: text/javascript');
// If cross Domain true.
if (config::sys('crossDomain') == 1) {
header('Access-Control-Allow-Origin: *');
header('Access-Control-Request-Method: POST');
header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept');
}
// Print request.
print json_encode($response);
}
}
示例14: __construct
/**
* 初始化
*/
public function __construct()
{
parent::__construct();
global $_M;
met_cooike_start();
//读取已登陆管理员信息
$this->load_language();
//语言加载
$this->check();
//验证管理员
load::plugin('doadmin');
//插件加载
}
示例15: __construct
function __construct()
{
global $_M;
parent::__construct();
$this->moduleclass = load::mod_class('content/class/sys_product', 'new');
//
//$this->shop = load::app_class('shop/admin/class/sys_goods', 'new');
if (!($this->shop = load::plugin('doproduct_plugin_class', '1'))) {
$this->shop = load::mod_class('content/class/sys_shop', 'new');
}
$this->paraclass = load::mod_class('system/class/sys_para', 'new');
$this->module = 3;
}