本文整理汇总了PHP中discuz_core类的典型用法代码示例。如果您正苦于以下问题:PHP discuz_core类的具体用法?PHP discuz_core怎么用?PHP discuz_core使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了discuz_core类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setloginstatus
function setloginstatus($member, $cookietime)
{
global $_G;
$_G['uid'] = $member['uid'];
$_G['username'] = addslashes($member['username']);
$_G['adminid'] = $member['adminid'];
$_G['groupid'] = $member['groupid'];
$_G['formhash'] = formhash();
$_G['session']['invisible'] = getuserprofile('invisible');
$_G['member'] = $member;
loadcache('usergroup_' . $_G['groupid']);
$discuz =& discuz_core::instance();
$discuz->session->isnew = true;
dsetcookie('auth', authcode("{$member['password']}\t{$member['uid']}", 'ENCODE'), $cookietime, 1, true);
dsetcookie('loginuser');
dsetcookie('activationauth');
dsetcookie('pmnum');
include_once libfile('function/stat');
updatestat('login', 1);
if (defined('IN_MOBILE')) {
updatestat('mobilelogin', 1);
}
if ($_G['setting']['connect']['allow'] && $_G['member']['conisbind']) {
updatestat('connectlogin', 1);
}
updatecreditbyaction('daylogin', $_G['uid']);
checkusergroup($_G['uid']);
}
示例2: creatapp
public static function creatapp()
{
if (!is_object(self::$_app)) {
self::$_app = discuz_core::instance();
}
return self::$_app;
}
示例3: _init_env
function _init_env()
{
error_reporting(E_ERROR);
if (phpversion() < '5.3.0') {
set_magic_quotes_runtime(0);
}
define('DISCUZ_ROOT', substr(dirname(__FILE__), 0, -12));
define('MAGIC_QUOTES_GPC', function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc());
define('ICONV_ENABLE', function_exists('iconv'));
define('MB_ENABLE', function_exists('mb_convert_encoding'));
define('EXT_OBGZIP', function_exists('ob_gzhandler'));
define('TIMESTAMP', time());
discuz_core::timezone_set();
if (!defined('DISCUZ_CORE_FUNCTION') && !@(include DISCUZ_ROOT . './source/function/function_core.php')) {
$this->error('function_core.php is missing');
}
define('IS_ROBOT', checkrobot());
foreach ($GLOBALS as $key => $value) {
if (!isset($this->superglobal[$key])) {
$GLOBALS[$key] = null;
unset($GLOBALS[$key]);
}
}
global $_G;
$_G = array('uid' => 0, 'username' => '', 'adminid' => 0, 'groupid' => 1, 'sid' => '', 'formhash' => '', 'timestamp' => TIMESTAMP, 'starttime' => dmicrotime(), 'clientip' => $this->_get_client_ip(), 'referer' => '', 'charset' => '', 'gzipcompress' => '', 'authkey' => '', 'timenow' => array(), 'PHP_SELF' => '', 'siteurl' => '', 'siteroot' => '', 'config' => array(), 'setting' => array(), 'member' => array(), 'group' => array(), 'cookie' => array(), 'style' => array(), 'cache' => array(), 'session' => array(), 'lang' => array(), 'my_app' => array(), 'my_userapp' => array(), 'fid' => 0, 'tid' => 0, 'forum' => array(), 'rssauth' => '', 'home' => array(), 'space' => array(), 'block' => array(), 'article' => array(), 'action' => array('action' => APPTYPEID, 'fid' => 0, 'tid' => 0));
$_G['PHP_SELF'] = htmlspecialchars($_SERVER['SCRIPT_NAME'] ? $_SERVER['SCRIPT_NAME'] : $_SERVER['PHP_SELF']);
$_G['basescript'] = CURSCRIPT;
$_G['siteurl'] = htmlspecialchars('http://' . $_SERVER['HTTP_HOST'] . preg_replace("/\\/+(api)?\\/*\$/i", '', substr($_G['PHP_SELF'], 0, strrpos($_G['PHP_SELF'], '/'))) . '/');
$uri = $_SERVER['REQUEST_URI'] ? $_SERVER['REQUEST_URI'] : ($_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']);
$_G['siteroot'] = substr($_G['PHP_SELF'], 0, -strlen(basename($_G['PHP_SELF'])));
$this->var =& $_G;
}
示例4: loadcore
function loadcore()
{
global $_G;
require_once './source/class/class_core.php';
$discuz =& discuz_core::instance();
$discuz->init_cron = false;
$discuz->init_session = false;
$discuz->init();
}
示例5: run
function run()
{
if (!$this->config['cron']) {
$this->error(100, 'cron service is off. Please check "config.global.php" on your webserver folder.');
}
$discuz =& discuz_core::instance();
$discuz->init_cron = true;
$discuz->_init_cron();
$this->success('Cron work is done');
}
示例6: setloginstatus
function setloginstatus($member, $cookietime)
{
global $_G;
foreach ($_G['cookie'] as $k => $v) {
dsetcookie($k);
}
$_G['uid'] = $member['uid'];
$_G['username'] = addslashes($member['username']);
$_G['adminid'] = $member['adminid'];
$_G['groupid'] = $member['groupid'];
$_G['formhash'] = formhash();
$_G['session']['invisible'] = getuserprofile('invisible');
$_G['member'] = $member;
$discuz =& discuz_core::instance();
$discuz->session->isnew = true;
dsetcookie('auth', authcode("{$member['password']}\t{$member['uid']}", 'ENCODE'), $cookietime, 1, true);
dsetcookie('loginuser');
dsetcookie('activationauth');
dsetcookie('pmnum');
}
示例7: init
function init()
{
require_once '../../source/class/class_core.php';
$cachelist = array();
$this->core =& discuz_core::instance();
$this->core->cachelist = $cachelist;
$this->core->init_cron = false;
$this->core->init_setting = true;
$this->core->init_user = false;
$this->core->init_session = false;
$this->core->init_misc = false;
$this->core->init_mobile = false;
$this->core->init_memory = true;
$this->core->init();
define('SERVICE_DIR', getglobal('config/remote/dir') ? getglobal('config/remote/dir') : 'remote');
$this->core->reject_robot();
if (empty($_GET['mod']) || preg_match('/[^0-9a-z]/i', $_GET['mod'])) {
$this->mod = 'index';
} else {
$this->mod = $_GET['mod'];
}
}
示例8: array
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: my.php 10915 2010-05-18 04:48:02Z monkey $
*/
require_once '../../source/class/class_core.php';
require_once '../../source/function/function_home.php';
$cachelist = array();
$discuz =& discuz_core::instance();
$discuz->cachelist = $cachelist;
$discuz->init_cron = false;
$discuz->init_setting = true;
$discuz->init_user = false;
$discuz->init_session = false;
$discuz->init();
require_once DISCUZ_ROOT . './api/manyou/Manyou.php';
class My extends Manyou
{
function onSiteGetAllUsers($from, $userNum, $friendNum = 2000, $isExtra)
{
$totalNum = getcount('common_member', '');
$sql = 'SELECT s.*
FROM %s s
ORDER BY s.uid
LIMIT %d, %d';
$sql = sprintf($sql, DB::table('common_member'), $from, $userNum);
$query = DB::query($sql);
$spaces = $uIds = array();
示例9: dhtmlspecialchars
if ($_G['setting']['regctrl']) {
DB::query("INSERT INTO " . DB::table('common_regip') . " (ip, count, dateline)\r\n\t\t\t\tVALUES ('{$_G['clientip']}', '-1', '{$_G['timestamp']}')");
}
}
$regmessage = dhtmlspecialchars($_G['gp_regmessage']);
if ($_G['setting']['regverify'] == 2) {
DB::query("REPLACE INTO " . DB::table('common_member_validate') . " (uid, submitdate, moddate, admin, submittimes, status, message, remark)\r\n\t\t\tVALUES ('{$uid}', '{$_G['timestamp']}', '0', '', '1', '0', '{$regmessage}', '')");
}
$_G['uid'] = $uid;
$_G['username'] = $username;
$_G['member']['username'] = dstripslashes($_G['username']);
$_G['member']['password'] = $password;
$_G['groupid'] = $groupinfo['groupid'];
include_once libfile('function/stat');
updatestat('register');
$_CORE =& discuz_core::instance();
$_CORE->session->set('uid', $uid);
$_CORE->session->set('username', $username);
dsetcookie('auth', authcode("{$_G['member']['password']}\t{$_G['uid']}", 'ENCODE'), 2592000, 1, true);
if ($invite['id']) {
DB::update("common_invite", array('fuid' => $uid, 'fusername' => $username, 'regdateline' => $_G['timestamp'], 'status' => 2), array('id' => $invite['id']));
updatestat('invite');
}
if ($invite['uid']) {
if ($_G['setting']['inviteconfig']['inviteaddcredit']) {
updatemembercount($uid, array($_G['setting']['inviteconfig']['inviterewardcredit'] => $_G['setting']['inviteconfig']['inviteaddcredit']));
}
if ($_G['setting']['inviteconfig']['invitedaddcredit']) {
updatemembercount($invite['uid'], array($_G['setting']['inviteconfig']['inviterewardcredit'] => $_G['setting']['inviteconfig']['invitedaddcredit']));
}
require_once libfile('function/friend');
示例10: memory
function memory($cmd, $key = '', $value = '', $ttl = 0)
{
$discuz =& discuz_core::instance();
if ($cmd == 'check') {
return $discuz->mem->enable ? $discuz->mem->type : '';
} elseif ($discuz->mem->enable && in_array($cmd, array('set', 'get', 'rm'))) {
switch ($cmd) {
case 'set':
return $discuz->mem->set($key, $value, $ttl);
break;
case 'get':
return $discuz->mem->get($key);
break;
case 'rm':
return $discuz->mem->rm($key);
break;
}
}
return null;
}