Example #1
0
 /**
  * 初始化$zbp
  * @return bool
  */
 public function Initialize()
 {
     $oldzone = $this->option['ZC_TIME_ZONE_NAME'];
     date_default_timezone_set($oldzone);
     $oldlang = $this->option['ZC_BLOG_LANGUAGEPACK'];
     $this->LoadLanguage('system', '');
     if ($this->option['ZC_SITE_TURNOFF'] == true) {
         Http503();
         $this->ShowError(82, __FILE__, __LINE__);
         return false;
     }
     if (!$this->OpenConnect()) {
         return false;
     }
     $this->LoadConfigs();
     $this->LoadCache();
     $this->LoadOption();
     $this->RegPostType(0, 'article', $this->option['ZC_ARTICLE_REGEX'], $this->option['ZC_POST_DEFAULT_TEMPLATE']);
     $this->RegPostType(1, 'page', $this->option['ZC_PAGE_REGEX'], $this->option['ZC_POST_DEFAULT_TEMPLATE']);
     if ($this->option['ZC_BLOG_LANGUAGEPACK'] === 'SimpChinese') {
         $this->option['ZC_BLOG_LANGUAGEPACK'] = 'zh-cn';
     }
     if ($this->option['ZC_BLOG_LANGUAGEPACK'] === 'TradChinese') {
         $this->option['ZC_BLOG_LANGUAGEPACK'] = 'zh-tw';
     }
     if ($oldlang != $this->option['ZC_BLOG_LANGUAGEPACK']) {
         $this->LoadLanguage('system', '');
     }
     if (isset($this->option['ZC_DEBUG_MODE_STRICT'])) {
         ZBlogException::$isstrict = (bool) $this->option['ZC_DEBUG_MODE_STRICT'];
     }
     if (isset($this->option['ZC_DEBUG_MODE_WARNING'])) {
         ZBlogException::$iswarning = (bool) $this->option['ZC_DEBUG_MODE_WARNING'];
     }
     if (isset($this->option['ZC_DEBUG_LOG_ERROR'])) {
         ZBlogException::$islogerror = (bool) $this->option['ZC_DEBUG_LOG_ERROR'];
     }
     if (substr($this->host, 0, 8) == 'https://') {
         $this->ishttps = true;
     }
     if ($this->option['ZC_PERMANENT_DOMAIN_ENABLE'] == true) {
         if ($this->option['ZC_PERMANENT_DOMAIN_INDISCRIMINATE_HTTPS'] == true) {
             if (str_replace(array('https://', 'http://'), array('', ''), $this->host) != str_replace(array('https://', 'http://'), array('', ''), $this->option['ZC_BLOG_HOST'])) {
                 $this->host = $this->option['ZC_BLOG_HOST'];
             }
         } else {
             $this->host = $this->option['ZC_BLOG_HOST'];
         }
         $this->cookiespath = strstr(str_replace('://', '', $this->host), '/');
     } else {
         $this->option['ZC_BLOG_HOST'] = $this->host;
     }
     $this->option['ZC_BLOG_PRODUCT'] = 'Z-BlogPHP';
     $this->option['ZC_BLOG_VERSION'] = ZC_BLOG_VERSION;
     $this->option['ZC_BLOG_PRODUCT_FULL'] = $this->option['ZC_BLOG_PRODUCT'] . ' ' . $this->option['ZC_BLOG_VERSION'];
     $this->option['ZC_BLOG_PRODUCT_FULLHTML'] = '<a href="http://www.zblogcn.com/" title="RainbowSoft Z-BlogPHP" target="_blank">' . $this->option['ZC_BLOG_PRODUCT_FULL'] . '</a>';
     $this->option['ZC_BLOG_PRODUCT_HTML'] = '<a href="http://www.zblogcn.com/" title="RainbowSoft Z-BlogPHP" target="_blank">' . $this->option['ZC_BLOG_PRODUCT'] . '</a>';
     if ($oldzone != $this->option['ZC_TIME_ZONE_NAME']) {
         date_default_timezone_set($this->option['ZC_TIME_ZONE_NAME']);
     }
     /*if(isset($_COOKIE['timezone'])){
     		$tz=GetVars('timezone','COOKIE');
     		if(is_numeric($tz)){
     		$tz=sprintf('%+d',-$tz);
     		date_default_timezone_set('Etc/GMT' . $tz);
     		$this->timezone=date_default_timezone_get();
     		}
     		}*/
     header('Product:' . $this->option['ZC_BLOG_PRODUCT_FULL']);
     $this->validcodeurl = $this->host . 'zb_system/script/c_validcode.php';
     $this->feedurl = $this->host . 'feed.php';
     $this->searchurl = $this->host . 'search.php';
     $this->ajaxurl = $this->host . 'zb_system/cmd.php?act=ajax&src=';
     $this->xmlrpcurl = $this->host . 'zb_system/xml-rpc/index.php';
     $this->isinitialized = true;
     return true;
 }
Example #2
0
 public function Initialize()
 {
     if ($this->option['ZC_SITE_TURNOFF'] == true) {
         Http503();
         $this->ShowError(82, __FILE__, __LINE__);
         return false;
     }
     if (!$this->OpenConnect()) {
         return false;
     }
     $this->LoadConfigs();
     $this->LoadCache();
     $this->LoadOption();
     if ($this->option['ZC_DEBUG_MODE'] == true) {
         error_reporting(-1);
     } else {
         error_reporting(0);
     }
     if ($this->option['ZC_PERMANENT_DOMAIN_ENABLE'] == true) {
         $this->host = $this->option['ZC_BLOG_HOST'];
         $this->cookiespath = substr($this->host, strpos($this->host, '/', 8));
     } else {
         $this->option['ZC_BLOG_HOST'] = $this->host;
     }
     $this->option['ZC_BLOG_VERSION'] = ZC_BLOG_VERSION;
     $this->option['ZC_BLOG_PRODUCT_FULL'] = $this->option['ZC_BLOG_PRODUCT'] . ' ' . $this->option['ZC_BLOG_VERSION'];
     $this->option['ZC_BLOG_PRODUCT_FULLHTML'] = '<a href="http://www.zblogcn.com/" title="RainbowSoft Z-BlogPHP" target="_blank">' . $this->option['ZC_BLOG_PRODUCT_FULL'] . '</a>';
     date_default_timezone_set($this->option['ZC_TIME_ZONE_NAME']);
     /*if(isset($_COOKIE['timezone'])){
     			$tz=GetVars('timezone','COOKIE');
     			if(is_numeric($tz)){
     				$tz=sprintf('%+d',-$tz);
     				date_default_timezone_set('Etc/GMT' . $tz);
     				$this->timezone=date_default_timezone_get();
     			}
     		}*/
     header('Product:' . $this->option['ZC_BLOG_PRODUCT_FULL']);
     $this->validcodeurl = $this->host . 'zb_system/script/c_validcode.php';
     #创建User类
     $this->user = new Member();
     $this->isinitialize = true;
 }
Example #3
0
 /**
  * 初始化$zbp
  * @return bool
  */
 public function Initialize()
 {
     $oldzone = $this->option['ZC_TIME_ZONE_NAME'];
     date_default_timezone_set($oldzone);
     $oldlang = $this->option['ZC_BLOG_LANGUAGEPACK'];
     $this->lang = (require $this->path . 'zb_users/language/' . $oldlang . '.php');
     if ($this->option['ZC_SITE_TURNOFF'] == true) {
         Http503();
         $this->ShowError(82, __FILE__, __LINE__);
         return false;
     }
     if (!$this->OpenConnect()) {
         return false;
     }
     $this->LoadConfigs();
     $this->LoadCache();
     $this->LoadOption();
     if ($oldlang != $this->option['ZC_BLOG_LANGUAGEPACK']) {
         $this->lang = (require $this->path . 'zb_users/language/' . $this->option['ZC_BLOG_LANGUAGEPACK'] . '.php');
     }
     if (isset($this->option['ZC_DEBUG_MODE_STRICT'])) {
         ZBlogException::$isstrict = (bool) $this->option['ZC_DEBUG_MODE_STRICT'];
     }
     if (isset($this->option['ZC_DEBUG_MODE_WARNING'])) {
         ZBlogException::$iswarning = (bool) $this->option['ZC_DEBUG_MODE_WARNING'];
     }
     if ($this->option['ZC_PERMANENT_DOMAIN_ENABLE'] == true) {
         $this->host = $this->option['ZC_BLOG_HOST'];
         $this->cookiespath = substr($this->host, strpos($this->host, '/', 8));
     } else {
         $this->option['ZC_BLOG_HOST'] = $this->host;
     }
     $this->option['ZC_BLOG_VERSION'] = ZC_BLOG_VERSION;
     $this->option['ZC_BLOG_PRODUCT_FULL'] = $this->option['ZC_BLOG_PRODUCT'] . ' ' . $this->option['ZC_BLOG_VERSION'];
     $this->option['ZC_BLOG_PRODUCT_FULLHTML'] = '<a href="http://www.zblogcn.com/" title="RainbowSoft Z-BlogPHP" target="_blank">' . $this->option['ZC_BLOG_PRODUCT_FULL'] . '</a>';
     $this->option['ZC_BLOG_PRODUCT_HTML'] = '<a href="http://www.zblogcn.com/" title="RainbowSoft Z-BlogPHP" target="_blank">' . $this->option['ZC_BLOG_PRODUCT'] . '</a>';
     if ($oldzone != $this->option['ZC_TIME_ZONE_NAME']) {
         date_default_timezone_set($this->option['ZC_TIME_ZONE_NAME']);
     }
     /*if(isset($_COOKIE['timezone'])){
     			$tz=GetVars('timezone','COOKIE');
     			if(is_numeric($tz)){
     				$tz=sprintf('%+d',-$tz);
     				date_default_timezone_set('Etc/GMT' . $tz);
     				$this->timezone=date_default_timezone_get();
     			}
     		}*/
     header('Product:' . $this->option['ZC_BLOG_PRODUCT_FULL']);
     $this->validcodeurl = $this->host . 'zb_system/script/c_validcode.php';
     $this->feedurl = $this->host . 'feed.php';
     $this->searchurl = $this->host . 'search.php';
     $this->ajaxurl = $this->host . 'zb_system/cmd.php?act=ajax&src=';
     #创建User类
     $this->user = new Member();
     $this->isinitialize = true;
 }