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


PHP Cache::array_load方法代码示例

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


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

示例1: adminblock

function adminblock($bid, $title, &$data)
{
    if (is_admin()) {
        $waitlist = $content = $imgcontent = '';
        if (empty($data)) {
            $data = '';
        }
        global $prefix, $db, $MAIN_CFG, $waitlist;
        if (!defined('ADMIN_PAGES') && $MAIN_CFG['global']['admingraphic'] & 1) {
            global $CLASS;
            require_once CORE_PATH . 'classes/cpg_adminmenu.php';
            $imgcontent = $CLASS['adminmenu']->display('all', 'blockgfx') . '<hr />';
        }
        if (!empty($data)) {
            $data = $imgcontent . $data . '<hr />';
        }
        $imgcontent = '';
        // $title = _WAITINGCONT;
        // Contributed by sengsara
        if (!Cache::array_load('waitlist')) {
            if ($waitdir = dir('admin/wait')) {
                while ($waitfile = $waitdir->read()) {
                    if (preg_match('/^wait_(.*?)\\.php$/', $waitfile, $match)) {
                        $waitlist[$match[1]] = "admin/wait/{$waitfile}";
                    }
                }
                $waitdir->close();
            }
            // Dragonfly system
            $waitdir = dir('modules');
            while ($module = $waitdir->read()) {
                if (!is_active($module)) {
                    continue;
                }
                if (false === strpos($module, '.') && $module != 'CVS' && file_exists("modules/{$module}/admin/adwait.inc")) {
                    $waitlist[$module] = "modules/{$module}/admin/adwait.inc";
                }
            }
            $waitdir->close();
            Cache::array_save('waitlist');
        }
        ksort($waitlist);
        foreach ($waitlist as $module => $file) {
            require $file;
        }
        $block = array('bid' => $bid, 'view' => 2, 'title' => $title, 'content' => $data . $content);
        return $block;
    }
    return false;
}
开发者ID:cbsistem,项目名称:nexos,代码行数:50,代码来源:display.php

示例2: moderators

    public static function moderators($forum_id = 0)
    {
        global $module_name, $forum_moderators;
        static $moderators;
        # Obtain list of moderators of each forum
        # First users, then groups ... broken into two queries
        if (!is_array($moderators) && !is_array(Cache::array_load('forum_moderators', $module_name))) {
            global $db;
            $forum_moderators = array();
            $sql = 'SELECT aa.forum_id, u.user_id, u.username
					FROM ' . AUTH_ACCESS_TABLE . ' aa, ' . USER_GROUP_TABLE . ' ug, ' . GROUPS_TABLE . ' g, ' . USERS_TABLE . ' u
					WHERE aa.auth_mod = 1 AND g.group_single_user = 1
						AND ug.group_id = aa.group_id AND g.group_id = aa.group_id
						AND u.user_id = ug.user_id
					GROUP BY u.user_id, u.username, aa.forum_id
					ORDER BY aa.forum_id, u.user_id';
            $result = $db->sql_query($sql);
            while ($row = $db->sql_fetchrow($result, SQL_ASSOC)) {
                $forum_moderators[$row['forum_id']][] = '<a href="' . URL::index("Your_Account&amp;profile=" . $row['user_id']) . '">' . $row['username'] . '</a>';
            }
            $db->sql_freeresult($result);
            $sql = 'SELECT aa.forum_id, g.group_id, g.group_name
					FROM ' . AUTH_ACCESS_TABLE . ' aa, ' . USER_GROUP_TABLE . ' ug, ' . GROUPS_TABLE . ' g
					WHERE aa.auth_mod = 1 AND g.group_single_user = 0
						AND g.group_type <> ' . GROUP_HIDDEN . '
						AND ug.group_id = aa.group_id AND g.group_id = aa.group_id
					GROUP BY g.group_id, g.group_name, aa.forum_id
					ORDER BY aa.forum_id, g.group_id';
            $result = $db->sql_query($sql);
            while ($row = $db->sql_fetchrow($result, SQL_ASSOC)) {
                $forum_moderators[$row['forum_id']][] = '<a href="' . URL::index("Groups&amp;" . POST_GROUPS_URL . "=" . $row['group_id']) . '">' . $row['group_name'] . '</a>';
            }
            $db->sql_freeresult($result);
            Cache::array_save('forum_moderators', $module_name);
        }
        $moderators = $forum_moderators;
        if ($forum_id) {
            return isset($moderators[$forum_id]) ? $moderators[$forum_id] : array();
        }
        return $moderators;
    }
开发者ID:cbsistem,项目名称:nexos,代码行数:41,代码来源:BoardCache.php

示例3: while

require_once 'includes/phpBB/constants.php';
require_once 'includes/phpBB/auth.php';
require_once 'includes/phpBB/functions.php';
require_once "modules/{$this_base}/classes/BoardCache.php";
if (isset($module_name) && can_admin($module_name)) {
    $userinfo['user_level'] = ADMIN;
}
$user_ip = !empty($userinfo['user_ip']) ? $userinfo['user_ip'] : ($user_ip = $userinfo['user_ip'] = $db->binary_safe(Security::get_ip()));
//
// Setup forum wide options, if this fails
// then we output a BB_CRITICAL_ERROR since
// basic forum information is not available
//
$board_config = BoardCache::conf();
// Cache topic icons
if (!Cache::array_load('topic_icons', basename(dirname(__FILE__)), true)) {
    $result = $db->sql_query("SELECT * FROM " . TOPIC_ICONS_TABLE);
    while ($row = $db->sql_fetchrow($result, SQL_ASSOC)) {
        $topic_icons[$row['icon_id']] = $row;
    }
    $db->sql_freeresult($result);
    Cache::array_save('topic_icons', basename(dirname(__FILE__)));
}
//if (defined('BBAttach_mod')) {
require_once 'includes/phpBB/attach/functions_includes.php';
require_once 'includes/phpBB/attach/functions_attach.php';
require_once 'includes/phpBB/attach/functions_delete.php';
require_once 'includes/phpBB/attach/functions_thumbs.php';
require_once 'includes/phpBB/attach/functions_filetypes.php';
//
// Get Attachment Config
开发者ID:cbsistem,项目名称:nexos,代码行数:31,代码来源:common.php

示例4: loginadmin

 private function loginadmin()
 {
     $aid = isset($_POST['alogin']) ? Fix_Quotes($_POST['alogin']) : NULL;
     $pwd = isset($_POST['pwd']) ? $_POST['pwd'] : NULL;
     if ($aid && $pwd) {
         global $sec_code, $CPG_SESS;
         if ($sec_code & 1) {
             $gfxid = isset($_POST['gfxid']) ? $_POST['gfxid'] : 0;
             $code = $CPG_SESS['gfx'][$gfxid];
             $gfx_check = isset($_POST['gfx_check']) ? $_POST['gfx_check'] : '';
             if (strlen($gfx_check) < 2 || $code != $gfx_check) {
                 return false;
             }
         }
         global $db, $prefix;
         $pwd = md5($pwd);
         $result = $db->sql_query('SELECT * FROM ' . $prefix . "_admins WHERE aid='{$aid}'");
         $row = $db->sql_fetchrow($result, SQL_ASSOC);
         if (isset($row['admin_id'])) {
             if (!($login = Cache::array_load('login', 'a', false)) || !isset($login[$row['admin_id']])) {
                 $login[$row['admin_id']] = 1;
             } else {
                 if ($login[$row['admin_id']] >= 5) {
                     cpg_error('Too many failed login attempts');
                 } else {
                     $login[$row['admin_id']]++;
                 }
             }
             if ($row['pwd'] == $pwd && $row['pwd'] != '') {
                 $this->setadmcookie(true, $row['admin_id'], $pwd, isset($_POST['persistent']));
                 unset($row['pwd']);
                 $this->admin = $row;
                 $this->admin_id = $row['aid'];
                 $this->demo = CPGN_DEMO && false !== strpos($this->admin_id, 'demo');
                 unset($CPG_SESS['admin']);
                 $login[$row['admin_id']] = 1;
             }
             Cache::array_save('login', 'a', $login);
         }
     }
     return $this->admin_id;
 }
开发者ID:cbsistem,项目名称:nexos,代码行数:42,代码来源:cpg_member.php

示例5: get_smilies

function get_smilies()
{
    global $db, $prefix;
    $smilies = Cache::array_load('smilies', 'bb', false);
    if (!$smilies) {
        $smilies = $db->sql_ufetchrowset('SELECT * FROM ' . $prefix . '_bbsmilies', SQL_ASSOC);
        if (count($smilies)) {
            usort($smilies, 'sort_smiley');
            Cache::array_save('smilies', 'bb', $smilies);
        }
    }
    return $smilies;
}
开发者ID:cbsistem,项目名称:nexos,代码行数:13,代码来源:nbbcode.php

示例6: get_content

 private function get_content()
 {
     global $menuitems, $adminindex, $adlinks;
     if (!Cache::array_load('adlinks')) {
         $adlinks = array();
         $linksdir = dir('admin/links');
         while ($file = $linksdir->read()) {
             // CPG-Nuke system							 PHP-Nuke system
             if (preg_match('/^adlnk_.*?\\.php$/', $file) || preg_match('/^links\\..*?\\.php$/', $file)) {
                 $adlinks[] = 'admin/links/' . $file;
             }
         }
         $linksdir->close();
         // Dragonfly system
         $linksdir = dir('modules');
         while ($module = $linksdir->read()) {
             if (false === strpos($module, '.') && $module != 'CVS' && file_exists("modules/{$module}/admin/adlinks.inc")) {
                 $adlinks[$module] = 'modules/' . $module . '/admin/adlinks.inc';
             }
         }
         $linksdir->close();
         Cache::array_save('adlinks');
     }
     foreach ($adlinks as $module => $path) {
         if (is_file($path)) {
             include $path;
         }
     }
     $this->items = is_array($menuitems) ? $menuitems : array();
     ksort($this->items);
     $this->items[_ADMIN][_MENU]['URL'] = $adminindex;
     $this->items[_ADMIN][_MENU]['IMG'] = '';
     $this->items[_ADMIN][_ADMINLOGOUT]['URL'] = URL::admin('logout');
     $this->items[_ADMIN][_ADMINLOGOUT]['IMG'] = '';
     unset($menuitems);
 }
开发者ID:cbsistem,项目名称:nexos,代码行数:36,代码来源:cpg_adminmenu.php

示例7: while

 *	 copyright	  : (C) 2001 The phpBB Group
 *	 email		  : support@phpbb.com
 *
 * Last modification made by CPG Dev Team http://cpgnuke.com:
 *	 $Id: admin_board.php,v 10.0 2010/11/05 00:56:57 djmaze Exp $
 *
 *
 ***************************************************************************/
if (!defined('ADMIN_PAGES')) {
    exit;
}
global $lang;
//
// Pull all config data
//
if (!Cache::array_load('board_config', 'Forums', true)) {
    $result = $db->sql_query("SELECT * FROM " . CONFIG_TABLE);
    while ($row = $db->sql_fetchrow($result)) {
        $board_config[$row['config_name']] = str_replace("'", "\\'", $row['config_value']);
        $new[$config_name] = isset($_POST[$config_name]) ? $_POST[$config_name] : $board_config[$config_name];
        if ($config_name == 'smilies_path') {
            $new['smilies_path'] = 'images/smiles';
        }
        if (isset($_POST['submit'])) {
            $sql = "UPDATE " . CONFIG_TABLE . " SET\n\t\t\t\tconfig_value = '" . Fix_Quotes($new[$config_name]) . "'\n\t\t\t\tWHERE config_name = '{$config_name}'";
            $db->sql_query($sql);
            Cache::array_delete('board_config', 'Forums');
        }
    }
    Cache::array_save('board_config', 'Forums');
} elseif (isset($_POST['submit'])) {
开发者ID:cbsistem,项目名称:nexos,代码行数:31,代码来源:admin_board.php

示例8: unset

    }
    $data[$item->parentNode->nodeName][] = $tmp;
}
unset($xmlDOM, $xml, $items, $item, $nodes, $tmp);
function array_key_prefix(&$array, $prefix)
{
    $ret = array();
    foreach ($array as $key => $value) {
        $ret[$prefix . $key] = $value;
        array_shift($array);
    }
    return $ret;
}
$item = $IOthemes = $IOmodules = array();
// Load active modules and relative version number
Cache::array_load('active_modules', 'active', true);
/*
Load themes
$dir=dir(BASEDIR.'themes/');
while ($file = $dir->read()) {
	if (!is_dir(BASEDIR.'themes/'.$dir->path.'/'.$file) || 0 === strpos($file, '.')) { continue; }
	$IOthemes[] = $file;
}
*/
/*
Load blocks
$dir=dir(BASEDIR.'blocks/');
while ($file = $dir->read()) {
	if (0 === strpos($file, 'block-')) {
		$IOthemes[] = substr($file, 0, 6);
	}
开发者ID:cbsistem,项目名称:nexos,代码行数:31,代码来源:plugins.php

示例9: get_hooks

 private static function get_hooks()
 {
     global $hooks;
     static $hooks;
     if (is_array($hooks) || ($hooks = Cache::array_load('hooks')) || is_array($hooks)) {
         return $hooks;
     }
     $hooks = array();
     global $db, $prefix;
     $result = $db->sql_query('SELECT type, cfile, cfunc, hfile, hfunc FROM ' . $prefix . '_hooks WHERE active=1');
     while ($row = $db->sql_fetchrow($result, SQL_ASSOC)) {
         switch ($row['type']) {
             case HOOK::MOD:
                 $row['cfunc'] = empty($row['cfunc']) ? 0 : $row['cfunc'];
                 $hooks[$row['type']][$row['cfile']][$row['cfunc']][] = array('hfile' => $row['hfile'], 'hfunc' => $row['hfunc']);
                 break;
             case HOOK::TPL:
                 # in this case cfile becomes a blockname template variable
                 $hooks[$row['type']][$row['cfile']][] = array('hfile' => $row['hfile'], 'hfunc' => $row['hfunc']);
                 break;
             default:
                 break;
         }
     }
     $db->free_result($result);
     Cache::array_save('hooks');
     return $hooks;
 }
开发者ID:cbsistem,项目名称:nexos,代码行数:28,代码来源:hook.php

示例10: getparent

   Journey Milwaukee
   http://www.journeymilwaukee.com

  Dragonfly is released under the terms and conditions
  of the GNU GPL version 2 or any later version

  $Source: /cvs/modules/Web_Links/modules/Web_Links/index.php,v $
  $Revision: 9.30 $
  $Author: phoenix $
  $Date: 2010/11/04 01:19:25 $
**********************************************/
if (!defined('CPG_NUKE')) {
    exit;
}
$pagetitle .= _WEBLINKS;
if (!Cache::array_load('weblinks_config')) {
    $result = $db->sql_query('SELECT * FROM ' . $prefix . '_links_config', true);
    while ($row = $db->sql_fetchrow($result)) {
        $weblinks_config[$row['config_name']] = $row['config_value'];
    }
    Cache::array_save('weblinks_config');
    $db->sql_freeresult($result);
}
$linksprefix = $prefix . '_links';
function getparent($parentid, $title)
{
    global $linksprefix, $db;
    $result = $db->sql_query("SELECT cid, title, parentid FROM " . $linksprefix . "_categories WHERE cid={$parentid}");
    list($cid, $ptitle, $pparentid) = $db->sql_fetchrow($result);
    if ($ptitle != '') {
        if ($title != '') {
开发者ID:cbsistem,项目名称:nexos,代码行数:31,代码来源:index.php

示例11: OpenTable

}
OpenTable();
echo '<div style="text-align:center;"><span class="genmed"><strong>' . _WELCOMENEXOS . ' ' . _VERSION . ' ' . NEXOS_VERSION . '</strong></span><br />';
if (file_exists('includes/nexos_version')) {
    $git_version = file_get_contents(CORE_PATH . 'nexos_version');
    echo 'Git ' . _VERSION . ": {$git_version}";
}
echo '</div>';
CloseTable();
echo '<br />';
if (can_admin() && $MAIN_CFG['global']['update_monitor']) {
    if (!isset($CPG_SESS['update_monitor'])) {
        $CPG_SESS['update_monitor'] = false;
    }
    if ($CPG_SESS['update_monitor']) {
        $CPG_SESS['update_monitor'] = Cache::array_load('data', 'update_monitor', true);
    }
    if (!$CPG_SESS['update_monitor']) {
        $update_url = 'http://69.57.185.107/update.php?vers=' . CPG_NUKE;
        $updinfo = get_fileinfo($update_url, false, true);
        if ($updinfo) {
            $items = preg_split('#(<item>)#s', $updinfo['data'], -1, PREG_SPLIT_NO_EMPTY);
            unset($updinfo);
            $curvers = preg_replace('#^(.*)<version>(.*)</version>(.*)#s', '\\2', $items[0], 1);
            $upgurl = preg_replace('#^(.*)<url>(.*)</url>(.*)#s', '\\2', $items[0], 1);
            unset($items[0]);
            $data = array('current' => $curvers, 'url' => $upgurl, 'num' => count($items), 'msg' => array());
            foreach ($items as $item) {
                if (!empty($item)) {
                    $alrt_vers = preg_replace('#(.*)<version>(.*)</version>(.*)#s', '\\2', $item);
                    $alrt_title = preg_replace('#(.*)<title>(.*)</title>(.*)#s', '\\2', $item);
开发者ID:cbsistem,项目名称:nexos,代码行数:31,代码来源:index.php


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