Esempio n. 1
0
 static function get_badword($update_cache = 0, $delcache = false)
 {
     $badword = array();
     $subDir = 'badword';
     $badword = ECCache::cache('SELECT * FROM bad_words ORDER By exact DESC', __LINE__ . __FILE__, 86400, $update_cache, '', $subDir, $delcache);
     usort($badword, array('BW', 'word_length_sort'));
     if ($badword && !$delcache) {
         return $badword;
     }
     return $badword;
 }
Esempio n. 2
0
File: User.php Progetto: hqd276/bigs
    static function get_permits($del_cache = false, $user_id = false)
    {
        static $get_permits = 0;

        if ($del_cache && $user_id > 0 && $user_id != User::id()) {
            $user = User::getUser($user_id);

            if ($user && $user['gids']) {
                //$gids	=	str_replace('|',',',$user['gids']);
                $gids = $user['gids'];
            } else {
                return false;
            }
        } elseif ($del_cache || !$get_permits) {
            $user_id = User::id();
            //$gids	 = str_replace('|',',',self::$info['gids']);
            $gids = self::$current->data['gids'];
        }

        if ($del_cache || !$get_permits) {
            $permits = ECCache::cache("SELECT type,ref_id,pids FROM user_permit WHERE (ref_id IN(" . $gids . ") AND type=0) OR (ref_id=" . $user_id . " AND type=1)", __LINE__ . __FILE__, 36000, 0, '', '', $del_cache);
        }

        if (!$get_permits && !$del_cache) {
            if ($permits) {
                foreach ($permits as $permit) {
                    if ($permit['pids'])
                        User::$permits .= (User::$permits ? '|' : '') . $permit['pids'];

                }
            }

            $get_permits = 1;
        }
    }
Esempio n. 3
0
File: Init.php Progetto: hqd276/bigs
<?php

if (REWRITE_ON) {
    ob_start();
    //start buffering//@ob_start('ob_gzhandler');
}
require_once ROOT_PATH . 'core/AutoLoader.php';
if (MEMCACHE_ON) {
    CGlobal::$memcache_server = $memcache_server;
}
unset($memcache_server, $server_list, $img_server, $img_ftp_server);
if (isset($_REQUEST['trigger']) && (int) $_REQUEST['trigger'] == 1) {
    EBArrCache::del_cache();
    ECCache::auto_delete();
    StaticCache::delCache();
    EClass::del_page_cache();
    exit;
}
if (isset($_GET['page']) && $_GET['page'] == 'error') {
    define('ERROR_PAGE', 1);
} else {
    define('ERROR_PAGE', 0);
}
if (!EClassApi::is_search_engine() && !defined('NO_SESSION') && !ERROR_PAGE) {
    if (SESSION_TYPE == 'db') {
        require_once ROOT_PATH . 'includes/session.class.php';
        //Session db store
    } elseif (SESSION_TYPE == 'memcache') {
        require_once ROOT_PATH . "includes/memcache.session.php";
        //Session memcache store
    } else {
Esempio n. 4
0
 static function get()
 {
     if (isset($_GET['delcache']) && (int) $_GET['delcache'] == 1) {
         self::auto_delete(self::_my_file());
         return false;
     }
     if (MEMCACHE_ON) {
         $arr = eb_memcache::do_get("qcache:" . self::_my_file());
         if ($arr !== false) {
             return $arr;
         }
     } else {
         $cfile = DIR_CACHE . 'db/' . self::_my_file();
         if (file_exists($cfile)) {
             self::$createdTime = filemtime($cfile);
             if (self::$expire > 0 && TIME_NOW < self::$createdTime + self::$expire || self::$expire == 0) {
                 return unserialize(stripslashes(@file_get_contents($cfile)));
             }
         }
     }
     return false;
 }