From 8f30eff99ae9cec5515395b3d48d37c02035d80d Mon Sep 17 00:00:00 2001 From: tianya Date: Mon, 15 May 2023 21:36:26 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=A2=9E=E5=8A=A0=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=8A=A0=E8=BD=BD=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.php | 19 +++++++++++++++++++ src/system/archive/archives.class.php | 8 +++++--- src/system/taglib/channelartlist.lib.php | 2 +- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/index.php b/src/index.php index 5c18beb0..31939613 100755 --- a/src/index.php +++ b/src/index.php @@ -14,6 +14,9 @@ if (!file_exists(dirname(__FILE__).'/data/common.inc.php')) { } if (isset($_GET['upcache']) || !file_exists('index.html')) { require_once(dirname(__FILE__)."/system/common.inc.php"); + if (DEBUG_LEVEL == TRUE) { + $ttt1 = ExecTime(); + } require_once DEDEINC."/archive/partview.class.php"; $GLOBALS['_arclistEnv'] = 'index'; $row = $dsql->GetOne("SELECT * FROM `#@__homepageset`"); @@ -23,10 +26,26 @@ if (isset($_GET['upcache']) || !file_exists('index.html')) { $row['showmod'] = isset($row['showmod']) ? $row['showmod'] : 0; if ($row['showmod'] == 1) { $pv->SaveToHtml(dirname(__FILE__).'/index.html'); + if (DEBUG_LEVEL == TRUE) { + $queryTime = ExecTime() - $ttt1; + if (PHP_SAPI === 'cli') { + echo '首页:生成花费时间:'.$queryTime."\r\n"; + } else { + echo "
页面加载总消耗时间:{$queryTime}
\r\n"; + } + } include(dirname(__FILE__).'/index.html'); exit(); } else { $pv->Display(); + if (DEBUG_LEVEL == TRUE) { + $queryTime = ExecTime() - $ttt1; + if (PHP_SAPI === 'cli') { + echo '首页:加载花费时间:'.$queryTime."\r\n"; + } else { + echo "
页面加载总消耗时间:{$queryTime}
\r\n"; + } + } exit(); } } else { diff --git a/src/system/archive/archives.class.php b/src/system/archive/archives.class.php index da827360..6fcab8f2 100755 --- a/src/system/archive/archives.class.php +++ b/src/system/archive/archives.class.php @@ -193,9 +193,11 @@ class Archives $this->Fields['body'] = preg_replace("@ [\s]{0,}alt[\s]{0,}=[\"'\s]{0,}[\s\S]{0,}[\"'\s] @isU","",$this->Fields['body']); $this->Fields['body'] = str_ireplace("Fields['title']."\" title=\"".$this->Fields['title']."\" ",$this->Fields['body']); //图片模型正文图片注释自动为标题 - $this->Fields['imgurls'] = str_ireplace(array('alt=""','alt=\'\''),'',$this->Fields['imgurls']); - $this->Fields['imgurls'] = preg_replace("@ [\s]{0,}alt[\s]{0,}=[\"'\s]{0,}[\s\S]{0,}[\"'\s] @isU","",$this->Fields['imgurls']); - $this->Fields['imgurls'] = str_ireplace("Fields['title']."\" title=\"".$this->Fields['title']."\"",$this->Fields['imgurls']); + if (isset($this->Fields['imgurls']) && is_array($this->Fields['imgurls'])) { + $this->Fields['imgurls'] = str_ireplace(array('alt=""','alt=\'\''),'',$this->Fields['imgurls']); + $this->Fields['imgurls'] = preg_replace("@ [\s]{0,}alt[\s]{0,}=[\"'\s]{0,}[\s\S]{0,}[\"'\s] @isU","",$this->Fields['imgurls']); + $this->Fields['imgurls'] = str_ireplace("Fields['title']."\" title=\"".$this->Fields['title']."\"",$this->Fields['imgurls']); + } //移除文档模型正文图片宽度和高度,适配自适应/响应式网站 $this->Fields['body'] = preg_replace("/style=\"width\:(.*)\"/","",$this->Fields['body']); } diff --git a/src/system/taglib/channelartlist.lib.php b/src/system/taglib/channelartlist.lib.php index a2fbc237..043ee24e 100755 --- a/src/system/taglib/channelartlist.lib.php +++ b/src/system/taglib/channelartlist.lib.php @@ -14,7 +14,7 @@ function lib_channelartlist(&$ctag, &$refObj) { global $dsql, $envs, $_sys_globals; //添加不调用指定栏目参数notypeid - $attlist = 'typeid|0,row|20,cacheid|,notypeid|0'; + $attlist = 'typeid|0,row|20,cacheid|,notypeid|0,currentstyle|'; FillAttsDefault($ctag->CAttribute->Items, $attlist); extract($ctag->CAttribute->Items, EXTR_SKIP); $innertext = trim($ctag->GetInnerText());