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


PHP loadcache函数代码示例

本文整理汇总了PHP中loadcache函数的典型用法代码示例。如果您正苦于以下问题:PHP loadcache函数的具体用法?PHP loadcache怎么用?PHP loadcache使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: viewthread_useraction_output

 function viewthread_useraction_output()
 {
     global $_G, $postlist, $tid, $authorid, $hott, $config, $new_window;
     if (!$_G['fid'] || !$_G['tid'] || !$postlist[$_G['forum_firstpid']]['authorid'] || $postlist[$_G['forum_firstpid']]['anonymous']) {
         return;
     }
     loadcache('plugin');
     $config = $_G['cache']['plugin']['dsu_hott'];
     @(include DISCUZ_ROOT . './data/dsu_hott.inc.php');
     $authorid = $postlist[$_G['forum_firstpid']]['authorid'];
     $new_window = $config['new_window'] ? ' target="_blank" ' : '';
     $config['max_text'] = $config['max_text'] > 0 ? $config['max_text'] : 80;
     $tid = $_G['tid'];
     $hott_block1 = $hott_block2 = '';
     if ($hott[1]['script'] && file_exists(DISCUZ_ROOT . './source/plugin/dsu_hott/script/' . $hott[1]['script'])) {
         include DISCUZ_ROOT . './source/plugin/dsu_hott/script/' . $hott[1]['script'];
         $hott_block1 = $hott_script->output(1);
         unset($hott_script);
     }
     if ($hott[2]['script'] && file_exists(DISCUZ_ROOT . './source/plugin/dsu_hott/script/' . $hott[2]['script'])) {
         include DISCUZ_ROOT . './source/plugin/dsu_hott/script/' . $hott[2]['script'];
         $hott_block2 = $hott_script->output(2);
         unset($hott_script);
     }
     if ($hott_block1 || $hott_block2) {
         $hott[0]['style'] = $hott[0]['style'] ? $hott[0]['style'] : 'default';
         @(include template('dsu_hott:' . $hott[0]['style']));
         $return = '</div>' . $return;
         return $return;
     }
 }
开发者ID:v998,项目名称:dsu,代码行数:31,代码来源:hott.class.php

示例2: setloginstatus

function setloginstatus($member, $cookietime)
{
    global $_G;
    $_G['uid'] = intval($member['uid']);
    $_G['username'] = $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']);
    C::app()->session->isnew = true;
    C::app()->session->updatesession();
    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);
    }
    $rule = updatecreditbyaction('daylogin', $_G['uid']);
    if (!$rule['updatecredit']) {
        checkusergroup($_G['uid']);
    }
}
开发者ID:tang86,项目名称:discuz-utf8,代码行数:30,代码来源:function_member.php

示例3: getsetting

 function getsetting()
 {
     global $_G;
     $settings = array('fids' => array('title' => 'couplebanner_fids', 'type' => 'mselect', 'value' => array()), 'groups' => array('title' => 'couplebanner_groups', 'type' => 'mselect', 'value' => array()), 'position' => array('title' => 'couplebanner_position', 'type' => 'mradio', 'value' => array(array(1, 'couplebanner_position_left'), array(2, 'couplebanner_position_right')), 'default' => 1), 'coupleadid' => array('title' => 'couplebanner_coupleadid', 'type' => 'select', 'value' => array()));
     loadcache(array('forums', 'grouptype'));
     $settings['fids']['value'][] = $settings['groups']['value'][] = array(0, '&nbsp;');
     $settings['fids']['value'][] = $settings['groups']['value'][] = array(-1, 'couplebanner_index');
     if (empty($_G['cache']['forums'])) {
         $_G['cache']['forums'] = array();
     }
     foreach ($_G['cache']['forums'] as $fid => $forum) {
         $settings['fids']['value'][] = array($fid, ($forum['type'] == 'forum' ? str_repeat('&nbsp;', 4) : ($forum['type'] == 'sub' ? str_repeat('&nbsp;', 8) : '')) . $forum['name']);
     }
     foreach ($_G['cache']['grouptype']['first'] as $gid => $group) {
         $settings['groups']['value'][] = array($gid, str_repeat('&nbsp;', 4) . $group['name']);
         if ($group['secondlist']) {
             foreach ($group['secondlist'] as $sgid) {
                 $settings['groups']['value'][] = array($sgid, str_repeat('&nbsp;', 8) . $_G['cache']['grouptype']['second'][$sgid]['name']);
             }
         }
     }
     $query = DB::query('SELECT * FROM ' . DB::table('common_advertisement') . " WHERE type='couplebanner'");
     while ($couple = DB::fetch($query)) {
         $settings['coupleadid']['value'][] = array($couple['advid'], $couple['title']);
     }
     return $settings;
 }
开发者ID:v998,项目名称:discuzx-en,代码行数:27,代码来源:adv_couplebanner.php

示例4: discuz_censor

 function discuz_censor()
 {
     global $_G;
     loadcache(array('censor', 'bbcodes_display'));
     $this->censor_words = !empty($_G['cache']['censor']) ? $_G['cache']['censor'] : array();
     $this->bbcodes_display = $_G['cache']['bbcodes_display'][$_G['groupid']];
 }
开发者ID:v998,项目名称:discuzx-en,代码行数:7,代码来源:class_censor.php

示例5: viewthread_sidebottom_output

 function viewthread_sidebottom_output()
 {
     global $_G, $postlist;
     if (IS_ROBOT) {
         return array();
     }
     if (!$_G['forum_firstpid']) {
         return array();
     }
     loadcache('myapp');
     $thisApp = '';
     $poster = reset($postlist);
     $userapp = C::t('home_userapp_plying')->fetch($poster['authorid']);
     if (!empty($userapp['appid'])) {
         $applist = explode(',', $userapp['appid']);
         $i = 0;
         foreach ($applist as $appid) {
             if (!empty($_G['cache']['myapp'][$appid])) {
                 if ($i < $this->num) {
                     $thisApp .= '<a href="userapp.php?mod=app&id=' . $appid . '&fromtid=' . $_G['tid'] . '"' . (isset($_G['cache']['myapp'][$appid]) ? ' title="' . $_G['cache']['myapp'][$appid]['appname'] . '"' : '') . ' target="_blank">' . '<img class="authicn vm" src="http://appicon.manyou.com/logos/' . $appid . '" style="width:40px;height:40px;margin-left:0px;"/></a>';
                     $i++;
                 } else {
                     break;
                 }
             }
         }
     }
     $thisApp = $thisApp ? '<p>' . $this->title . '</p><p class="avt" style="margin-left:10px;">' . $thisApp . '</p>' : '';
     return array($thisApp);
 }
开发者ID:lemonstory,项目名称:bbs,代码行数:30,代码来源:myapp.class.php

示例6: getCloudRelateThreads

function getCloudRelateThreads($api = 'tao', $keyword, $page, $tpp = 20, $excludeForumIds = '', $cache = false)
{
    global $_G;
    $threadlist = array();
    $searchHelper = Cloud::loadClass('Service_SearchHelper');
    if ($api != 'tao') {
        $cloudData = $searchHelper->getRelatedThreads($excludeForumIds);
    } else {
        $cloudData = $searchHelper->getRelatedThreadsTao($keyword, $page, $tpp, $disAd, $of, $ot, $cache, $excludeForumIds);
    }
    if ($cloudData['result']['data']) {
        foreach ($cloudData['result']['ad']['content'] as $sAdv) {
            $threadlist[] = array('icon' => (string) $cloudData['result']['ad']['icon']) + $sAdv;
        }
        foreach ($cloudData['result']['data'] as $sPost) {
            $threadlist[] = $sPost;
        }
    } else {
        return null;
    }
    loadcache('forums');
    foreach ($threadlist as $curtid => &$curvalue) {
        $curvalue['pForumName'] = $_G['cache']['forums'][$curvalue['pForumId']]['name'];
        $curvalue['istoday'] = strtotime($curvalue['pPosted']) > $todaytime ? 1 : 0;
        $curvalue['dateline'] = $curvalue['pPosted'];
    }
    return array($threadlist, $cloudData);
}
开发者ID:softhui,项目名称:discuz,代码行数:28,代码来源:forumdisplay.inc.php

示例7: getsetting

 function getsetting()
 {
     global $_G;
     $settings = array('fids' => array('title' => 'couplebanner_fids', 'type' => 'mselect', 'value' => array()), 'groups' => array('title' => 'couplebanner_groups', 'type' => 'mselect', 'value' => array()), 'category' => array('title' => 'couplebanner_category', 'type' => 'mselect', 'value' => array()), 'position' => array('title' => 'couplebanner_position', 'type' => 'mradio', 'value' => array(array(1, 'couplebanner_position_left'), array(2, 'couplebanner_position_right')), 'default' => 1), 'coupleadid' => array('title' => 'couplebanner_coupleadid', 'type' => 'select', 'value' => array()), 'disableclose' => array('title' => 'couplebanner_disableclose', 'type' => 'mradio', 'value' => array(array(0, 'couplebanner_show'), array(1, 'couplebanner_hidden')), 'default' => 0));
     loadcache(array('forums', 'grouptype'));
     $settings['fids']['value'][] = $settings['groups']['value'][] = array(0, '&nbsp;');
     $settings['fids']['value'][] = $settings['groups']['value'][] = array(-1, 'couplebanner_index');
     if (empty($_G['cache']['forums'])) {
         $_G['cache']['forums'] = array();
     }
     foreach ($_G['cache']['forums'] as $fid => $forum) {
         $settings['fids']['value'][] = array($fid, ($forum['type'] == 'forum' ? str_repeat('&nbsp;', 4) : ($forum['type'] == 'sub' ? str_repeat('&nbsp;', 8) : '')) . $forum['name']);
     }
     foreach ($_G['cache']['grouptype']['first'] as $gid => $group) {
         $settings['groups']['value'][] = array($gid, str_repeat('&nbsp;', 4) . $group['name']);
         if ($group['secondlist']) {
             foreach ($group['secondlist'] as $sgid) {
                 $settings['groups']['value'][] = array($sgid, str_repeat('&nbsp;', 8) . $_G['cache']['grouptype']['second'][$sgid]['name']);
             }
         }
     }
     foreach (C::t('common_advertisement')->fetch_all_by_type('couplebanner') as $couple) {
         $settings['coupleadid']['value'][] = array($couple['advid'], $couple['title']);
     }
     loadcache('portalcategory');
     $this->categoryvalue[] = array(-1, 'couplebanner_index');
     $this->getcategory(0);
     $settings['category']['value'] = $this->categoryvalue;
     return $settings;
 }
开发者ID:tang86,项目名称:discuz-utf8,代码行数:30,代码来源:adv_couplebanner.php

示例8: checkfield

 function checkfield()
 {
     global $_G;
     $fields = array('realname', 'gender', 'birthyear', 'birthmonth', 'birthday', 'bloodtype', 'affectivestatus', 'birthprovince', 'birthcity', 'resideprovince', 'residecity');
     loadcache('profilesetting');
     $fieldsnew = array();
     foreach ($fields as $v) {
         if (isset($_G['cache']['profilesetting'][$v])) {
             $fieldsnew[$v] = $_G['cache']['profilesetting'][$v]['title'];
         }
     }
     if ($fieldsnew) {
         space_merge($_G['member'], 'profile');
         $none = array();
         foreach ($_G['member'] as $k => $v) {
             if (in_array($k, $fields, true) && !trim($v)) {
                 $none[] = $fieldsnew[$k];
             }
         }
         $all = count($fields);
         $csc = intval(($all - count($none)) / $all * 100);
         return array($none, $csc);
     } else {
         return true;
     }
 }
开发者ID:softhui,项目名称:discuz,代码行数:26,代码来源:task_profile.php

示例9: global_header

		function global_header() 
		{
			global $_G;
			if(!$_G[uid])
			{
				loadcache('plugin'); 
				$config =  $_G['cache']['plugin']['ct_login_yinxiangpai'];
				$login_url = $config['login_url'] ? unserialize($config['login_url']) : '';
				$isopen = $config['isopen'] ? $config['isopen'] : 0 ;
				
				if(empty($login_url))showmessage(lang('plugin/ct_login_yinxiangpai','login_url'));
				
				$login_arr = explode('[ct]', str_replace(array("\n", "\t"), array('', ''), $config['m_url']));
				//$m_url = array_diff($login_arr,array(''));
				if($login_arr){
					foreach($login_arr as $k=>$v){
						if(empty($v))continue;
						$m_url[$k]=strtolower(trim($v));
					}
				}
		
				$http = isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == '443' ? 'https://' : 'http://';
				$get_url = $http.strtolower($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
			
				$current_page = CURSCRIPT . '_' . CURMODULE;
				if((in_array($current_page,$login_url) || in_array( $get_url,$m_url) )&& !$_G[uid] && $isopen )
				{
					$target_url = $_G['siteurl'].'plugin.php?id=ct_login_yinxiangpai:index';
					header('Location: '.$target_url);		
				}
			}
		}
开发者ID:TedaLIEz,项目名称:Backup,代码行数:32,代码来源:ct_login.class.php

示例10: checkfield

 function checkfield()
 {
     global $_G;
     $fields = lang('task/profile', 'profile_fields');
     loadcache('profilesetting');
     $fieldsql = array();
     foreach ($fields as $k => $v) {
         $nk = explode('.', $k);
         if (isset($_G['cache']['profilesetting'][$nk[1]])) {
             $fieldsnew[$nk[1]] = $v;
             $fieldsql[] = $k;
         }
     }
     if ($fieldsql) {
         $result = DB::fetch_first("SELECT " . implode(',', $fieldsql) . " FROM " . DB::table('common_member') . " m LEFT JOIN " . DB::table('common_member_profile') . " mp ON m.uid=mp.uid WHERE m.uid='{$_G['uid']}'");
         $none = array();
         foreach ($result as $k => $v) {
             if (!trim($v)) {
                 $none[] = $fieldsnew[$k];
             }
         }
         $csc = intval((count($fields) - count($none)) / count($fields) * 100);
         return array($none, $csc);
     } else {
         return true;
     }
 }
开发者ID:dalinhuang,项目名称:hlwbbsvincent,代码行数:27,代码来源:task_profile.php

示例11: getPortalConfigure

function getPortalConfigure($setting = null)
{
    $config[] = array('title' => Utils::converGbkString('首页'), 'module' => Utils::converGbkString('门户首页'), 'enable' => '1', 'sort' => 1, 'id' => '0', 'type' => '4');
    global $_G;
    loadcache('portalcategory');
    $portalcategory = $_G['cache']['portalcategory'];
    if (false && !empty($portalcategory)) {
        foreach ($portalcategory as $cat) {
            if ($cat['closed'] != 1) {
                if (isset($setting['portal']) && !empty($setting['portal'])) {
                    foreach ($setting['portal'] as $category) {
                        if ($category['id'] == $cat['catid'] && $category['enable'] == 1) {
                            $config[] = array('title' => Utils::converGbkString($category['title']), 'module' => $cat['catname'], 'enable' => '1', 'sort' => $category['sort'], 'id' => $cat['catid'], 'type' => '4');
                        }
                    }
                }
            }
        }
        $newArr = array();
        for ($j = 0; $j < count($config); $j++) {
            $newArr[] = $config[$j]['sort'];
        }
        array_multisort($newArr, $config);
    }
    return $config;
}
开发者ID:Mushan3420,项目名称:BigApp-PHP7,代码行数:26,代码来源:portalcfg.inc.php

示例12: parse_related_link

 public static function parse_related_link($content, $extent)
 {
     global $_G;
     loadcache('relatedlink');
     $allextent = array('article' => 0, 'forum' => 1, 'group' => 2, 'blog' => 3);
     if ($_G['cache']['relatedlink'] && isset($allextent[$extent])) {
         $searcharray = $replacearray = array();
         foreach ($_G['cache']['relatedlink'] as $link) {
             $link['extent'] = sprintf('%04b', $link['extent']);
             if ($link['extent'][$allextent[$extent]] && $link['name'] && $link['url']) {
                 $searcharray[$link[name]] = '/(' . preg_quote($link['name']) . ')/i';
                 $replacearray[$link[name]] = "<a href=\"{$link['url']}\" target=\"_blank\" class=\"relatedlink\">{$link['name']}</a>";
             }
         }
         if ($searcharray && $replacearray) {
             $_G['trunsform_tmp'] = array();
             $content = preg_replace_callback("/(<script\\s+.*?>.*?<\\/script>)|(<a\\s+.*?>.*?<\\/a>)|(<img\\s+.*?[\\/]?>)|(\\[attach\\](\\d+)\\[\\/attach\\])/is", function ($matches) {
                 return helper_seo::base64_transform('encode', '<relatedlink>', $matches[1] . $matches[2] . $matches[3] . $matches[4], '</relatedlink>');
             }, $content);
             $content = preg_replace($searcharray, $replacearray, $content, 1);
             $content = preg_replace_callback("/<relatedlink>(.*?)<\\/relatedlink>/is", function ($matches) {
                 return helper_seo::base64_transform('decode', '', $matches[1], '');
             }, $content);
         }
     }
     return $content;
 }
开发者ID:KKRainbow,项目名称:discuz-x32-php7,代码行数:27,代码来源:helper_seo.php

示例13: make_secqaa

function make_secqaa($idhash)
{
    global $_G;
    loadcache('secqaa');
    $secqaakey = max(1, random(1, 1));
    if ($_G['cache']['secqaa'][$secqaakey]['type']) {
        $etype = explode(':', $_G['cache']['secqaa'][$secqaakey]['question']);
        if (count($etype) > 1 && preg_match('/^[\\w\\_]+$/', $etype[0]) && preg_match('/^[\\w\\_]+$/', $etype[1])) {
            $qaafile = DISCUZ_ROOT . './source/plugin/' . $etype[0] . '/secqaa/secqaa_' . $etype[1] . '.php';
            $class = $etype[1];
        } else {
            $qaafile = libfile('secqaa/' . $_G['cache']['secqaa'][$secqaakey]['question'], 'class');
            $class = $_G['cache']['secqaa'][$secqaakey]['question'];
        }
        if (file_exists($qaafile)) {
            @(include_once $qaafile);
            $class = 'secqaa_' . $class;
            if (class_exists($class)) {
                $qaa = new $class();
                if (method_exists($qaa, 'make')) {
                    $_G['cache']['secqaa'][$secqaakey]['answer'] = md5($qaa->make($_G['cache']['secqaa'][$secqaakey]['question']));
                }
            }
        }
    }
    dsetcookie('secqaa' . $idhash, authcode($_G['cache']['secqaa'][$secqaakey]['answer'] . "\t" . (TIMESTAMP - 180) . "\t" . $idhash . "\t" . FORMHASH, 'ENCODE', $_G['config']['security']['authkey']), 0, 1, true);
    return $_G['cache']['secqaa'][$secqaakey]['question'];
}
开发者ID:torrent520,项目名称:torrent520.github.io,代码行数:28,代码来源:function_seccode.php

示例14: deletepost

function deletepost($condition, $unbuffered = true, $deleteattach = true)
{
    global $_G;
    loadcache('posttableids');
    $num = 0;
    if (!empty($_G['cache']['posttableids'])) {
        $posttableids = $_G['cache']['posttableids'];
    } else {
        $posttableids = array('0');
    }
    foreach ($posttableids as $id) {
        if ($id == 0) {
            DB::delete('forum_post', $condition, 0, $unbuffered);
        } else {
            DB::delete("forum_post_{$id}", $condition, 0, $unbuffered);
        }
        $num += DB::affected_rows();
    }
    if ($deleteattach) {
        $query = DB::query("SELECT attachment, thumb, remote, aid FROM " . DB::table('forum_attachment') . " WHERE {$condition}");
        while ($attach = DB::fetch($query)) {
            dunlink($attach);
        }
        DB::delete('forum_attachment', $condition, 0, $unbuffered);
        DB::delete('forum_attachmentfield', $condition, 0, $unbuffered);
    }
    return $num;
}
开发者ID:Kingson4Wu,项目名称:php_demo,代码行数:28,代码来源:function_delete.php

示例15: onMobileModule

 public function onMobileModule()
 {
     global $_G;
     if (!$_G['setting']['plugins']['available']) {
         return '';
     }
     require_once libfile('function/admincp');
     loadcache('pluginlanguage_script', 1);
     $return = array();
     foreach ($_G['setting']['plugins']['available'] as $pluginid) {
         $row = array();
         $modulefile = DISCUZ_ROOT . './source/plugin/' . $pluginid . '/discuz_mobile_' . $pluginid . '.xml';
         if (file_exists($modulefile)) {
             $_GET['importtxt'] = @implode('', file($modulefile));
             $pluginarray = getimportdata('Discuz! Mobile', 0, 1);
             if ($pluginarray) {
                 foreach ($pluginarray as $name => $value) {
                     $row[] = array('name' => isset($_G['cache']['pluginlanguage_script'][$pluginid][$name]) ? $_G['cache']['pluginlanguage_script'][$pluginid][$name] : $name, 'logo' => $value['logo'], 'url' => preg_match('/^http:\\/\\//', $value['url']) ? $value['url'] : $_G['siteurl'] . $value['url']);
                 }
             }
         }
         $return[$pluginid] = $row;
     }
     return $return;
 }
开发者ID:tang86,项目名称:discuz-utf8,代码行数:25,代码来源:Mobile.php


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