当前位置: 首页>>代码示例>>PHP>>正文


PHP discuz_core::instance方法代码示例

本文整理汇总了PHP中discuz_core::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP discuz_core::instance方法的具体用法?PHP discuz_core::instance怎么用?PHP discuz_core::instance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在discuz_core的用法示例。


在下文中一共展示了discuz_core::instance方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: creatapp

 public static function creatapp()
 {
     if (!is_object(self::$_app)) {
         self::$_app = discuz_core::instance();
     }
     return self::$_app;
 }
开发者ID:caidongyun,项目名称:CS,代码行数:7,代码来源:discuz_core_x20.php

示例2: 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']);
}
开发者ID:pan289091315,项目名称:Discuz,代码行数:28,代码来源:function_member.php

示例3: 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();
}
开发者ID:pan289091315,项目名称:Discuz,代码行数:9,代码来源:api.php

示例4: 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');
 }
开发者ID:pan289091315,项目名称:Discuz,代码行数:10,代码来源:mod_cron.php

示例5: 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');
}
开发者ID:v998,项目名称:discuzx-en,代码行数:20,代码来源:function_member.php

示例6: 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'];
     }
 }
开发者ID:v998,项目名称:discuzx-en,代码行数:22,代码来源:index.php

示例7: 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();
开发者ID:Kingson4Wu,项目名称:php_demo,代码行数:31,代码来源:my.php

示例8: 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');
开发者ID:v998,项目名称:discuzx-en,代码行数:31,代码来源:member_register.php

示例9: 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;
}
开发者ID:Kingson4Wu,项目名称:php_demo,代码行数:20,代码来源:function_core.php


注:本文中的discuz_core::instance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。