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


PHP Cache::array_save方法代码示例

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


在下文中一共展示了Cache::array_save方法的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: while

}
$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
//
$attach_config = BoardCache::attach();
// Functions for displaying Attachment Things
require_once 'includes/phpBB/displaying.php';
require_once 'includes/phpBB/class.attachments.main.php';
if (isset($attach_config['allow_ftp_upload']) && !intval($attach_config['allow_ftp_upload'])) {
开发者ID:cbsistem,项目名称:nexos,代码行数:31,代码来源:common.php

示例3: 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

示例4: 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

示例5: 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

示例6: while

//
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'])) {
    foreach ($board_config as $config_name => $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';
        }
        $sql = "UPDATE " . CONFIG_TABLE . " SET\n\t\t\tconfig_value = '" . Fix_Quotes($new[$config_name]) . "'\n\t\t\tWHERE config_name = '{$config_name}'";
        $db->sql_query($sql);
    }
    Cache::array_delete('board_config', 'Forums');
}
if (isset($_POST['submit'])) {
    $message = $lang['Config_updated'] . "<br /><br />" . sprintf($lang['Click_return_config'], "<a href=\"" . URL::admin("&amp;do=board") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . URL::admin($op) . "\">", "</a>");
    message_die(GENERAL_MESSAGE, $message);
    return;
开发者ID:cbsistem,项目名称:nexos,代码行数:31,代码来源:admin_board.php

示例7: 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

示例8: GraphicAdmin

GraphicAdmin('_AMENU1');
if (!extension_loaded('xml')) {
    cpg_error('At this stage the XML extension is required but unfortunately your PHP installation does not load the extension.<br />
							Read the <a href="http://www.php.net/manual/en/xml.installation.php">PHP Documentation</a> for more infos.');
}
echo '
<input type="button" value="Reload Package List" onClick="window.location.reload()">
';
$xmllastmod = 0;
$xml = BASEDIR . 'cache/plugins_xml.php';
if (file_exists($xml)) {
    $xmllastmod = filemtime($xml);
}
$xml = get_fileinfo('http://dragonflycms.org/plugins.php', false, true, $xmllastmod);
if ($xml['modified'] === true) {
    Cache::array_save('xml', 'plugins', $xml);
} else {
    Cache::array_load('xml', 'plugins', true);
}
//$xml['data'] = decode_bb_all($xml['data'], 0 , true);
$xmlDOM = new DOMDocument();
$xmlDOM->preserveWhiteSpace = false;
$xmlDOM->loadXML($xml['data']);
$data = array();
$items = $xmlDOM->getElementsByTagname('item');
foreach ($items as $item) {
    $tmp = array();
    $nodes = $item->childNodes;
    for ($n = 0; $n < $nodes->length; ++$n) {
        $tmp[$nodes->item($n)->nodeName] = $nodes->item($n)->nodeValue;
    }
开发者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: while

  $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 != '') {
            $title = $ptitle . '/' . $title;
        } else {
            $title = $ptitle;
        }
    }
开发者ID:cbsistem,项目名称:nexos,代码行数:30,代码来源:index.php

示例11: unset

         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);
                 $alrt_desc = preg_replace('#(.*)<description>(.*)</description>(.*)#s', '\\2', $item);
                 $alrt_date = preg_replace('#(.*)<date>(.*)</date>(.*)#s', '\\2', $item);
                 $data['msg'][] = array('vers' => $alrt_vers, 'title' => $alrt_title, 'desc' => $alrt_desc, 'date' => $alrt_date);
             }
         }
         $CPG_SESS['update_monitor'] = true;
         Cache::array_save('data', 'update_monitor', $data);
     }
 }
 OpenTable();
 echo '<div><center><span class="genmed"><strong>' . _UM . '</strong></span><br /><br />';
 if (!$CPG_SESS['update_monitor']) {
     echo '<img src="images/update/error.png" alt="" /><br /><br />' . _UM_F . '</center>';
 } else {
     echo version_compare(CPG_NUKE, $data['current'], '>=') ? '<img src="images/update/green.png" alt="" /><br /><br /><span style="color: #009933;"><strong>' . _UM_G . ' (' . CPG_NUKE . (version_compare(CPG_NUKE, $data['current'], '>') ? ' CVS' : '') . ')</strong></span>' : '<img src="images/update/red.png" alt="" /><br /><br /><span style="color: #ae0000;"><strong>' . sprintf(_UM_R, $data['current'], $data['url']) . '</strong></span>';
     echo '</center>';
     if (count($data['msg'])) {
         echo '<br />';
     }
     foreach ($data['msg'] as $item) {
         echo '<fieldset><legend>' . $item['title'] . '</legend>' . decode_bbcode($item['desc']) . '<br /><br />' . _POSTEDON . ' ' . formatDateTime($item['date'], '%B %d, %Y') . '</fieldset>';
     }
开发者ID:cbsistem,项目名称:nexos,代码行数:31,代码来源:index.php


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