예제 #1
0
 /**
  * 得到前台程序的主题路径
  */
 public static function getHomeTheme()
 {
     $theme = Common::getConfigValue('thome_heme');
     return $theme;
 }
예제 #2
0
 public static function getHomeTheme()
 {
     $currentTheme = Common::getConfigValue('sys_theme_home');
     return $currentTheme;
 }
예제 #3
0
 public function getConfigValue($id)
 {
     return Common::getConfigValue($id);
 }
예제 #4
0
파일: index.php 프로젝트: huasxin/lulucms2
use source\core\front\BaseFrontApplication;
use source\libs\Common;
// comment out the following two lines when deployed to production
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev');

require (__DIR__ . '/vendor/autoload.php');
require (__DIR__ . '/vendor/yiisoft/yii2/Yii.php');

require (__DIR__ . '/source/override.php');
require (__DIR__ . '/source/config/bootstrap.php');
require (__DIR__ . '/frontend/config/bootstrap.php');


$config = yii\helpers\ArrayHelper::merge(
		require(__DIR__ . '/source/config/main.php'),
		require(__DIR__ . '/source/config/main-local.php'),
		require(__DIR__ . '/frontend/config/main.php'),
		require(__DIR__ . '/frontend/config/main-local.php')
);

$app = new BaseFrontApplication($config);
$siteStatus = Common::getConfigValue('sys_status');
if($siteStatus === '0')
{
    $app->catchAll = ['site/close', 'message' => 'test'];
}
$app->run();


예제 #5
0
 public static function formatTime($datetime, $format = true, $showtime = false)
 {
     // $datetime = strtotime($datetime);
     if ($format !== true) {
         if (!is_string($format)) {
             $format = 'Y-m-d H:i:s';
         }
         return date($format, $datetime);
     }
     $sys_datetime_date_format = Common::getConfigValue('sys_datetime_date_format');
     $sys_datetime_time_format = Common::getConfigValue('sys_datetime_time_format');
     $sys_datetime_pretty_format = Common::getConfigValue('sys_datetime_pretty_format');
     $format = $sys_datetime_date_format;
     if ($showtime === true || $sys_datetime_time_format !== '0') {
         $format .= ' ' . ($sys_datetime_time_format === '12' ? 'h:i:s' : 'H:i:s');
     }
     if ($sys_datetime_pretty_format === '0') {
         return date($format, $datetime);
     }
     $str = '';
     /*
      * if(is_string($date))
      * {
      * $timer = strtotime($date);
      * }
      * else{
      * $timer=$date;
      * }
      */
     $timer = $datetime;
     $diff = $_SERVER['REQUEST_TIME'] - $timer;
     $day = floor($diff / 86400);
     if ($day > 0) {
         if ($day < 7) {
             return $day . "天前";
         } else {
             return date($format, $timer);
         }
     }
     $free = $diff % 86400;
     if ($free <= 0) {
         return '刚刚';
     }
     $hour = floor($free / 3600);
     if ($hour > 0) {
         return $hour . "小时前";
     }
     $free = $free % 3600;
     if ($free <= 0) {
         return '刚刚';
     }
     $min = floor($free / 60);
     if ($min > 0) {
         return $min . "分钟前";
     }
     $free = $free % 60;
     if ($free > 0) {
         return $free . "秒前";
     }
     return '刚刚';
 }
예제 #6
0
파일: Common.php 프로젝트: sym660/lulucms2
 public static function setTimezone()
 {
     $timezone = Common::getConfigValue('sys_datetime_timezone');
     date_default_timezone_set($timezone);
 }