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


PHP SC::isEmpty方法代码示例

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


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

示例1: execute

 function execute(&$observer)
 {
     if (SC::isEmpty('userdata.user_id') || !require_level(USERLEVEL_ADMINISTRATION_TEAM)) {
         $observer->set('error.title', 'Permissions Error');
         $observer->set('error.message', 'You do not have permission to access this function.');
         $observer->set('error.line', __LINE__);
         $observer->set('error.file', __FILE__);
         return FALSE;
     }
     return TRUE;
 }
开发者ID:GeniusXalid,项目名称:php-mvc,代码行数:11,代码来源:requireadminteampermissions.model.php

示例2: execute

 /**
  * Execute the model
  * @param Container    The Observer object.
  * @return bool        TRUE if successful, else FALSE.
  * @access public
  */
 function execute(&$observer)
 {
     if (SC::isEmpty('board_config.inventory_disable')) {
         return TRUE;
     }
     $observer->set('error.code', GENERAL_MESSAGE);
     $observer->set('error.title', 'Profile Disabled');
     $observer->set('error.message', 'The profile section of the site is currently disabled.');
     $observer->set('error.line', __LINE__);
     $observer->set('error.file', __FILE__);
     $observer->set('error.debug', backtrace());
     return FALSE;
 }
开发者ID:GeniusXalid,项目名称:php-mvc,代码行数:19,代码来源:inventoryenabled.model.php

示例3: execute

 function execute(&$observer)
 {
     if (SC::isEmpty('board_config.econ_disabled')) {
         return TRUE;
     }
     $observer->set('error.code', GENERAL_MESSAGE);
     $observer->set('error.title', 'Econ Disabled');
     $observer->set('error.message', 'The economy of gaia is currently disabled.');
     $observer->set('error.line', __LINE__);
     $observer->set('error.file', __FILE__);
     $observer->set('error.debug', backtrace());
     return FALSE;
 }
开发者ID:GeniusXalid,项目名称:php-mvc,代码行数:13,代码来源:econenabled.model.php

示例4: execute

   /**
    * Execute
    */
    function execute(&$observer)
    {
        if( SC::isEmpty("board_config.forum_disabled")) return TRUE; 
       
        $message = "The Site Forum is currently disabled";
        $observer->set('error.code', GENERAL_MESSAGE);
        $observer->set('error.message', $message);
        $observer->set('error.title', 'No Access');
        $observer->set('error.line', __LINE__);
        $observer->set('error.file', __FILE__);
        return FALSE;

        
    }
开发者ID:GeniusXalid,项目名称:php-mvc,代码行数:17,代码来源:checkforumenabled.model.php

示例5: execute

 /**
  * Execute
  */
  function execute( & $observer )
  {
      if( SC::isEmpty('userdata.user_id') || ! require_level(USERLEVEL_ADMIN)) 
      {
          $message = "This page is not available under the current configuration, or ";
          $message .= "you are not authorized to view this page.";
          $observer->set('error.message', $message);
          $observer->set('error.code', GENERAL_MESSAGE);
          $observer->set('error.title', 'Not Authorized');
          $observer->set('error.line', __LINE__);
          $observer->set('error.file', __FILE__);
          return FALSE;
      }
      return TRUE;
  }
开发者ID:GeniusXalid,项目名称:php-mvc,代码行数:18,代码来源:requiregamemasterpermissions.model.php

示例6: execute

   /**
    * Execute
    */
    function execute(&$observer)
    {
        if( SC::isEmpty("board_config.admin_panel_enable") && !defined('ALLOW_WWW') ) 
        {
            $message = "This page is not available under the current configuration, or ";
            $message .= "you are not authorized to view this page.";
            $observer->set('error.code', GENERAL_MESSAGE);
            $observer->set('error.message', $message);
            $observer->set('error.line', __LINE__);
            $observer->set('error.file', __FILE__);
            return FALSE;
        }

        return TRUE;
        
    }
开发者ID:GeniusXalid,项目名称:php-mvc,代码行数:19,代码来源:checkadminpanelaccess.model.php

示例7: execute

 public function execute(CircuitController $c)
 {
     $r = $c->getRequest();
     $observer = $c->getObserver();
     // Get the message data. Try the request container first,
     // only using the observer for backwards compatibility
     if ($r->isEmpty('error.message')) {
         $message = $observer->get('error.message');
         $title = $observer->get('error.title');
         $line = $observer->get('error.line');
         $file = $observer->get('error.file');
         $debug = $observer->get('error.debug');
     } else {
         $message = $r->get('error.message');
         $title = $r->get('error.title');
         $line = $r->get('error.line');
         $file = $r->get('error.file');
         $debug = $r->get('error.debug');
     }
     if (strlen($title) < 1) {
         $title = 'ERROR';
     }
     if (strlen($message) < 1) {
         $message = 'An error occured';
     }
     $debug_str = '';
     if (!SC::isEmpty('board_config.enable_debug')) {
         $location_format = "\nFILE: %s\nLINE: %s\n";
         $debug_str = strlen($line) > 0 && strlen($file) > 0 ? sprintf($location_format, $file, $line) : '';
         if (!empty($debug) && !is_scalar($debug)) {
             ob_start();
             var_dump($debug);
             $debug = ob_get_contents();
             ob_end_clean();
         }
         $debug_str .= "\n\nDEBUG\n{$debug}\n";
     }
     $format = "<pre>%s\n%s\n\n%s\n</pre>\n\n";
     $output = sprintf($format, $title, $message, $debug_str);
     DBFactory::closeAll();
     die($output);
     exit;
 }
开发者ID:GeniusXalid,项目名称:php-mvc,代码行数:43,代码来源:simpledie.view.php

示例8: realdate

    // Calculate age
    $date = realdate('m d Y', SC::get('userdata.user_birthday'));
    list($month, $day, $year) = explode(' ', $date);
    $now = getdate(SC::get('board_config.time_now'));
    $age = abs($now['year'] - $year);
    /* birthday hasn't passed; age - 1 */
    if ($month < $now['mon']) {
        $age--;
    } elseif ($month == $now['mon']) {
        /* not on/past the actual day yet; age - 1 */
        if ($day < $now['mday']) {
            $age--;
        }
    }
    // Calculate donation string
    if (SC::isEmpty('userdata.user_donate_time')) {
        $donated = 'did not donate';
    } else {
        $donated = SC::get('board_config.time_now') - SC::get('userdata.user_donate_time') <= 2678400 ? 'donated' : 'did not donate';
    }
} else {
    $age = $gender = $reg_date = $user_id = $donated = 'not registered';
    $orig_user_id = -1;
}
$gold_granted = FALSE;
/* check for gold grant */
if (($gold_amount = SC::get('goldinfo')) != NULL) {
    $gold_granted = TRUE;
} elseif (($gold_amount = session_get('goldinfo')) != NULL) {
    session_remove('goldinfo');
    $gold_granted = TRUE;
开发者ID:GeniusXalid,项目名称:php-mvc,代码行数:31,代码来源:omniture.template.php

示例9: if

" target="query_log">EXPLAIN</a></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                     
    <? endif; ?>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
</div>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
<!-- For attaching events -->                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
<div id="fire_dom_ready"></div>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
<!-- BEGIN Omniture tracking -->                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
<? if (!SC::isEmpty('board_config.omniture_enable')) : ?>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
    <div style="position: absolute; width: 1px; height: 1px; overflow: hidden; left: -10px; top: -10px;">                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
       <script type="text/javascript" src="http://<?php 
echo GRAPHICS_SERVER;
?>
/src/common/<?php 
echo SC::isEmpty('board_config.test_db') ? 'omniture.js' : 'omniture_dev.js';
?>
?<?php 
echo $layout->get('master_cachebuster');
?>
"></script>                                                                                                                                                                                                                                                                                                                                                         
    <? include_once DIR_CIRCUIT_APPS . 'default/templates/footer/omniture.template.php'; ?>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
    </div>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
    <!-- END Omniture tracking -->                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
<? endif; ?>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
<? if ($layout->get('enable_debug')) : ?>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
    <div id="YUI_LOG_CONTAINER" style="position: absolute; right: 0; top: 0;"></div>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
    <script type="text/javascript">                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
    var GAIA_log_reader = new YAHOO.widget.LogReader("YUI_LOG_CONTAINER", {                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
开发者ID:GeniusXalid,项目名称:php-mvc,代码行数:31,代码来源:reg.template.php

示例10: initializeBase

function initializeBase()
{
    // set the default timezone
    if (function_exists('date_default_timezone_set')) {
        @date_default_timezone_set('Asia/Shanghai');
    }
    // define the start of our script
    define('MICROTIME', microtime(TRUE));
    // path to the html templates folder.
    // base path
    define('DIR_BASE', dirname(dirname(__FILE__)) . '/');
    // path to the private source code
    define('DIR_PRIVATE', DIR_BASE . 'private/');
    // path to the 3rd Party vendors
    define('DIR_VENDORS', DIR_BASE . 'vendors/');
    // path public_html folder
    //define('DIR_PUBLIC_HTML', DIR_BASE .'wp-content/themes/seecblog/');
    define('DIR_PUBLIC_HTML', DIR_BASE);
    // define the path to the classes directory
    define('DIR_CLASSES', DIR_PRIVATE . 'classes/');
    // path to php includes
    define('DIR_INCLUDES', DIR_PRIVATE . 'includes/');
    // path to script includes.
    define('DIR_SCRIPT_INCLUDES', DIR_PRIVATE . 'script_includes/');
    // path to circuit application directory root
    define('DIR_CIRCUIT_APPS', DIR_PRIVATE . 'circuit-apps/');
    // include general fuctions
    include_once DIR_INCLUDES . 'functions.php';
    // EVENTUALLY INTEGRATE THIS FILE INTO THIS PAGE
    // get rid of stupid errors.
    if (!defined('IN_PHPBB')) {
        define('IN_PHPBB', true);
    }
    // This will NOT report uninitialized variables
    if (SC::isEmpty('board_config.report_errors')) {
        error_reporting(E_ERROR | E_WARNING | E_PARSE);
    } else {
        error_reporting(E_ALL);
        ini_set('report_errors', 1);
        // ini_set('display_errors', 1);
    }
    //
    // Obtain and encode users IP
    $user_ip_address = get_user_ip();
    define('USER_IP', encode_ip($user_ip_address));
    SC::setGlobal('user_ip', USER_IP);
    // not sure if we still need this but just trying to keep consistent.
    // i converted to string replace instead of preg_match then preg_replace.
    // still not sure we need it tho.
    foreach ($_SERVER as $key => $ex_check) {
        if (is_string($ex_check)) {
            $_SERVER[$key] = str_replace(array('"', "'"), '', $ex_check);
        }
    }
    // becuase register_globals is turned off...
    // $PHP_SELF doesn't work anymore...
    // so, we have to force it to work for bw compatibility.
    // as soon as possible, remove this!
    SC::setGlobal('PHP_SELF', $_SERVER['PHP_SELF']);
    // start output buffering
    buffer_browser_output();
}
开发者ID:GeniusXalid,项目名称:php-mvc,代码行数:62,代码来源:common.php


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