@@ -59,7 +59,7 @@ class Archives | |||||
$this->TypeLink = new TypeLink($arr['typeid']); | $this->TypeLink = new TypeLink($arr['typeid']); | ||||
if ($this->ChannelUnit->ChannelInfos['issystem'] != -1) { | if ($this->ChannelUnit->ChannelInfos['issystem'] != -1) { | ||||
//如果当前文档不是系统模型,为自定义模型 | //如果当前文档不是系统模型,为自定义模型 | ||||
$query = "SELECT arc.*,tp.reid,tp.typedir,ch.addtable FROM `#@__archives` arc LEFT JOIN `#@__arctype` tp on tp.id=arc.typeid LEFT JOIN `#@__channeltype` as ch on arc.channel = ch.id WHERE arc.id='$aid' "; | |||||
$query = "SELECT arc.*,tp.reid,tp.typedir,ch.addtable,mb.uname,mb.face FROM `#@__archives` arc LEFT JOIN `#@__arctype` tp on tp.id=arc.typeid LEFT JOIN `#@__channeltype` as ch on arc.channel = ch.id LEFT JOIN `#@__member` mb on arc.mid = mb.mid WHERE arc.id='$aid' "; | |||||
$this->Fields = $this->dsql->GetOne($query); | $this->Fields = $this->dsql->GetOne($query); | ||||
} else { | } else { | ||||
$this->Fields['title'] = ''; | $this->Fields['title'] = ''; | ||||
@@ -96,12 +96,16 @@ class Archives | |||||
foreach ($GLOBALS['PubFields'] as $k => $v) { | foreach ($GLOBALS['PubFields'] as $k => $v) { | ||||
$this->Fields[$k] = $v; | $this->Fields[$k] = $v; | ||||
} | } | ||||
//为了减少重复查询,这里直接把附加表查询记录放在 $this->addTableRow 中,在 ParAddTable() 不再查询 | |||||
//为了减少重复查询,这里直接把附加表查询记录放在$this->addTableRow中,在ParAddTable()不再查询 | |||||
if ($this->ChannelUnit->ChannelInfos['addtable'] != '') { | if ($this->ChannelUnit->ChannelInfos['addtable'] != '') { | ||||
$query = "SELECT * FROM `{$this->ChannelUnit->ChannelInfos['addtable']}` WHERE `aid` = '$aid'"; | |||||
if ($this->ChannelUnit->ChannelID < -1) { | |||||
$query = "SELECT tb.*,mb.uname,mb.face FROM `{$this->ChannelUnit->ChannelInfos['addtable']}` tb LEFT JOIN `#@__member` mb on tb.mid = mb.mid WHERE tb.`aid` = '$aid'"; | |||||
} else { | |||||
$query = "SELECT * FROM `{$this->ChannelUnit->ChannelInfos['addtable']}` WHERE `aid` = '$aid'"; | |||||
} | |||||
$this->addTableRow = $this->dsql->GetOne($query); | $this->addTableRow = $this->dsql->GetOne($query); | ||||
} | } | ||||
//issystem==-1 表示自定义模型,自定义模型不支持redirecturl这类参数,因此限定文档普通模型才进行下面查询 | |||||
//issystem==-1表示自定义模型,自定义模型不支持redirecturl这类参数,因此限定文档普通模型才进行下面查询 | |||||
if ($this->ChannelUnit->ChannelInfos['addtable'] != '' && $this->ChannelUnit->ChannelInfos['issystem'] != -1) { | if ($this->ChannelUnit->ChannelInfos['addtable'] != '' && $this->ChannelUnit->ChannelInfos['issystem'] != -1) { | ||||
if (is_array($this->addTableRow)) { | if (is_array($this->addTableRow)) { | ||||
$this->Fields['redirecturl'] = $this->addTableRow['redirecturl']; | $this->Fields['redirecturl'] = $this->addTableRow['redirecturl']; | ||||
@@ -113,7 +117,9 @@ class Archives | |||||
$this->Fields['userip'] = (empty($this->Fields['userip']) ? '' : trim($this->Fields['userip'])); | $this->Fields['userip'] = (empty($this->Fields['userip']) ? '' : trim($this->Fields['userip'])); | ||||
} else { | } else { | ||||
$this->Fields['templet'] = $this->Fields['redirecturl'] = ''; | $this->Fields['templet'] = $this->Fields['redirecturl'] = ''; | ||||
$this->Fields['uname'] = $this->addTableRow['uname']; | |||||
} | } | ||||
$this->Fields['face'] = empty($this->Fields['face'])? $GLOBALS['cfg_mainsite'].'/static/web/img/admin.png' : $this->Fields['face']; | |||||
} //!error | } //!error | ||||
} | } | ||||
//php4构造函数 | //php4构造函数 | ||||
@@ -182,15 +188,15 @@ class Archives | |||||
//设置全局环境变量 | //设置全局环境变量 | ||||
$this->Fields['typename'] = $this->TypeLink->TypeInfos['typename']; | $this->Fields['typename'] = $this->TypeLink->TypeInfos['typename']; | ||||
@SetSysEnv($this->Fields['typeid'], $this->Fields['typename'], $this->Fields['id'], $this->Fields['title'], 'archives'); | @SetSysEnv($this->Fields['typeid'], $this->Fields['typename'], $this->Fields['id'], $this->Fields['title'], 'archives'); | ||||
//文档图片注释替换为标题,利于优化 | |||||
//文档模型正文图片注释自动为标题 | |||||
$this->Fields['body'] = str_ireplace(array('alt=""','alt=\'\''),'',$this->Fields['body']); | $this->Fields['body'] = str_ireplace(array('alt=""','alt=\'\''),'',$this->Fields['body']); | ||||
$this->Fields['body'] = preg_replace("@ [\s]{0,}alt[\s]{0,}=[\"'\s]{0,}[\s\S]{0,}[\"'\s] @isU","",$this->Fields['body']); | $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("<img","<img alt=\"".$this->Fields['title']."\" title=\"".$this->Fields['title']."\" ",$this->Fields['body']); | $this->Fields['body'] = str_ireplace("<img","<img alt=\"".$this->Fields['title']."\" title=\"".$this->Fields['title']."\" ",$this->Fields['body']); | ||||
//图片注释替换为标题,利于优化 | |||||
//图片模型正文图片注释自动为标题 | |||||
$this->Fields['imgurls'] = str_ireplace(array('alt=""','alt=\'\''),'',$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'] = preg_replace("@ [\s]{0,}alt[\s]{0,}=[\"'\s]{0,}[\s\S]{0,}[\"'\s] @isU","",$this->Fields['imgurls']); | ||||
$this->Fields['imgurls'] = str_ireplace("<img","<img alt=\"".$this->Fields['title']."\" title=\"".$this->Fields['title']."\"",$this->Fields['imgurls']); | $this->Fields['imgurls'] = str_ireplace("<img","<img alt=\"".$this->Fields['title']."\" title=\"".$this->Fields['title']."\"",$this->Fields['imgurls']); | ||||
//清除文档图片的宽度和高度,适配自适应网站 | |||||
//移除文档模型正文图片宽度和高度,适配自适应/响应式网站 | |||||
$this->Fields['body'] = preg_replace("/style=\"width\:(.*)\"/","",$this->Fields['body']); | $this->Fields['body'] = preg_replace("/style=\"width\:(.*)\"/","",$this->Fields['body']); | ||||
} | } | ||||
//完成附加表信息读取 | //完成附加表信息读取 | ||||
@@ -311,7 +317,7 @@ class Archives | |||||
$filenames = explode("/", $filename); | $filenames = explode("/", $filename); | ||||
$this->NameFirst = preg_replace("/\.".$this->ShortName."$/i", "", $filenames[count($filenames) - 1]); | $this->NameFirst = preg_replace("/\.".$this->ShortName."$/i", "", $filenames[count($filenames) - 1]); | ||||
if ($this->NameFirst == '') { | if ($this->NameFirst == '') { | ||||
$this->NameFirst = $this->arcID; | |||||
$this->NameFirst = $this->ArcID; | |||||
} | } | ||||
//获得当前文档的全名 | //获得当前文档的全名 | ||||
$filenameFull = GetFileUrl( | $filenameFull = GetFileUrl( | ||||
@@ -61,7 +61,7 @@ class ArchivesMobile | |||||
$this->TypeLink = new TypeLink($arr['typeid']); | $this->TypeLink = new TypeLink($arr['typeid']); | ||||
if ($this->ChannelUnit->ChannelInfos['issystem'] != -1) { | if ($this->ChannelUnit->ChannelInfos['issystem'] != -1) { | ||||
//如果当前文档不是系统模型,为自定义模型 | //如果当前文档不是系统模型,为自定义模型 | ||||
$query = "SELECT arc.*,tp.reid,tp.typedir,ch.addtable FROM `#@__archives` arc LEFT JOIN `#@__arctype` tp on tp.id=arc.typeid LEFT JOIN `#@__channeltype` as ch on arc.channel = ch.id WHERE arc.id='$aid' "; | |||||
$query = "SELECT arc.*,tp.reid,tp.typedir,ch.addtable,mb.uname,mb.face FROM `#@__archives` arc LEFT JOIN `#@__arctype` tp on tp.id=arc.typeid LEFT JOIN `#@__channeltype` as ch on arc.channel = ch.id LEFT JOIN `#@__member` mb on arc.mid = mb.mid WHERE arc.id='$aid' "; | |||||
$this->Fields = $this->dsql->GetOne($query); | $this->Fields = $this->dsql->GetOne($query); | ||||
} else { | } else { | ||||
$this->Fields['title'] = ''; | $this->Fields['title'] = ''; | ||||
@@ -98,9 +98,13 @@ class ArchivesMobile | |||||
foreach ($GLOBALS['PubFields'] as $k => $v) { | foreach ($GLOBALS['PubFields'] as $k => $v) { | ||||
$this->Fields[$k] = $v; | $this->Fields[$k] = $v; | ||||
} | } | ||||
//为了减少重复查询,这里直接把附加表查询记录放在 $this->addTableRow 中,在 ParAddTable() 不再查询 | |||||
//为了减少重复查询,这里直接把附加表查询记录放在$this->addTableRow中,在ParAddTable()不再查询 | |||||
if ($this->ChannelUnit->ChannelInfos['addtable'] != '') { | if ($this->ChannelUnit->ChannelInfos['addtable'] != '') { | ||||
$query = "SELECT * FROM `{$this->ChannelUnit->ChannelInfos['addtable']}` WHERE `aid` = '$aid'"; | |||||
if ($this->ChannelUnit->ChannelID < -1) { | |||||
$query = "SELECT tb.*,mb.uname,mb.face FROM `{$this->ChannelUnit->ChannelInfos['addtable']}` tb LEFT JOIN `#@__member` mb on tb.mid = mb.mid WHERE tb.`aid` = '$aid'"; | |||||
} else { | |||||
$query = "SELECT * FROM `{$this->ChannelUnit->ChannelInfos['addtable']}` WHERE `aid` = '$aid'"; | |||||
} | |||||
$this->addTableRow = $this->dsql->GetOne($query); | $this->addTableRow = $this->dsql->GetOne($query); | ||||
} | } | ||||
//issystem==-1 表示自定义模型,自定义模型不支持redirecturl这类参数,因此限定文档普通模型才进行下面查询 | //issystem==-1 表示自定义模型,自定义模型不支持redirecturl这类参数,因此限定文档普通模型才进行下面查询 | ||||
@@ -115,7 +119,9 @@ class ArchivesMobile | |||||
$this->Fields['userip'] = (empty($this->Fields['userip']) ? '' : trim($this->Fields['userip'])); | $this->Fields['userip'] = (empty($this->Fields['userip']) ? '' : trim($this->Fields['userip'])); | ||||
} else { | } else { | ||||
$this->Fields['templet'] = $this->Fields['redirecturl'] = ''; | $this->Fields['templet'] = $this->Fields['redirecturl'] = ''; | ||||
$this->Fields['uname'] = $this->addTableRow['uname']; | |||||
} | } | ||||
$this->Fields['face'] = empty($this->Fields['face'])? $GLOBALS['cfg_mainsite'].'/static/web/img/admin.png' : $this->Fields['face']; | |||||
} //!error | } //!error | ||||
} | } | ||||
//php4构造函数 | //php4构造函数 | ||||
@@ -184,15 +190,15 @@ class ArchivesMobile | |||||
//设置全局环境变量 | //设置全局环境变量 | ||||
$this->Fields['typename'] = $this->TypeLink->TypeInfos['typename']; | $this->Fields['typename'] = $this->TypeLink->TypeInfos['typename']; | ||||
@SetSysEnv($this->Fields['typeid'], $this->Fields['typename'], $this->Fields['id'], $this->Fields['title'], 'archives'); | @SetSysEnv($this->Fields['typeid'], $this->Fields['typename'], $this->Fields['id'], $this->Fields['title'], 'archives'); | ||||
//文档图片注释替换为标题,利于优化 | |||||
//文档模型正文图片注释自动为标题 | |||||
$this->Fields['body'] = str_ireplace(array('alt=""','alt=\'\''),'',$this->Fields['body']); | $this->Fields['body'] = str_ireplace(array('alt=""','alt=\'\''),'',$this->Fields['body']); | ||||
$this->Fields['body'] = preg_replace("@ [\s]{0,}alt[\s]{0,}=[\"'\s]{0,}[\s\S]{0,}[\"'\s] @isU","",$this->Fields['body']); | $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("<img","<img alt=\"".$this->Fields['title']."\" title=\"".$this->Fields['title']."\" ",$this->Fields['body']); | $this->Fields['body'] = str_ireplace("<img","<img alt=\"".$this->Fields['title']."\" title=\"".$this->Fields['title']."\" ",$this->Fields['body']); | ||||
//图片注释替换为标题,利于优化 | |||||
//图片模型正文图片注释自动为标题 | |||||
$this->Fields['imgurls'] = str_ireplace(array('alt=""','alt=\'\''),'',$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'] = preg_replace("@ [\s]{0,}alt[\s]{0,}=[\"'\s]{0,}[\s\S]{0,}[\"'\s] @isU","",$this->Fields['imgurls']); | ||||
$this->Fields['imgurls'] = str_ireplace("<img","<img alt=\"".$this->Fields['title']."\" title=\"".$this->Fields['title']."\"",$this->Fields['imgurls']); | $this->Fields['imgurls'] = str_ireplace("<img","<img alt=\"".$this->Fields['title']."\" title=\"".$this->Fields['title']."\"",$this->Fields['imgurls']); | ||||
//清除文档图片的宽度和高度,适配自适应网站 | |||||
//移除文档模型正文图片宽度和高度,适配自适应/响应式网站 | |||||
$this->Fields['body'] = preg_replace("/style=\"width\:(.*)\"/","",$this->Fields['body']); | $this->Fields['body'] = preg_replace("/style=\"width\:(.*)\"/","",$this->Fields['body']); | ||||
} | } | ||||
//完成附加表信息读取 | //完成附加表信息读取 | ||||
@@ -636,6 +636,7 @@ class ListView | |||||
} | } | ||||
//获得附加表的相关信息 | //获得附加表的相关信息 | ||||
$addtable = $this->ChannelUnit->ChannelInfos['addtable']; | $addtable = $this->ChannelUnit->ChannelInfos['addtable']; | ||||
$filtersql = ""; | |||||
if ($addtable!="") | if ($addtable!="") | ||||
{ | { | ||||
$addJoin = " LEFT JOIN `$addtable` ON arc.id = ".$addtable.'.aid '; | $addJoin = " LEFT JOIN `$addtable` ON arc.id = ".$addtable.'.aid '; | ||||
@@ -671,7 +672,7 @@ class ListView | |||||
} | } | ||||
//如果不用默认的sortrank或id排序,使用联合查询数据量大时非常缓慢 | //如果不用默认的sortrank或id排序,使用联合查询数据量大时非常缓慢 | ||||
if (preg_match('/hot|click|lastpost/', $orderby)) { | if (preg_match('/hot|click|lastpost/', $orderby)) { | ||||
$query = "SELECT arc.*,tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath $addField FROM `#@__archives` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id $addJoin WHERE {$this->addSql} $filtersql $ordersql LIMIT $limitstart,$row"; | |||||
$query = "SELECT arc.*,tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath,mb.uname,mb.face $addField FROM `#@__archives` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id LEFT JOIN `#@__member` mb ON arc.mid=mb.mid $addJoin WHERE {$this->addSql} $filtersql $ordersql LIMIT $limitstart,$row"; | |||||
} | } | ||||
//普通情况先从arctiny表查出id,然后按di查询速度非常快 | //普通情况先从arctiny表查出id,然后按di查询速度非常快 | ||||
else { | else { | ||||
@@ -687,7 +688,7 @@ class ListView | |||||
if ($idstr == '') { | if ($idstr == '') { | ||||
return ''; | return ''; | ||||
} else { | } else { | ||||
$query = "SELECT arc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath $addField FROM `#@__archives` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id $addJoin WHERE arc.id in($idstr) $ordersql "; | |||||
$query = "SELECT arc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath,mb.uname,mb.face $addField FROM `#@__archives` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id LEFT JOIN `#@__member` mb ON arc.mid=mb.mid $addJoin WHERE arc.id in($idstr) $ordersql "; | |||||
} | } | ||||
$t2 = ExecTime(); | $t2 = ExecTime(); | ||||
} | } | ||||
@@ -756,6 +757,7 @@ class ListView | |||||
if (preg_match('/c/', $row['flag'])) { | if (preg_match('/c/', $row['flag'])) { | ||||
$row['title'] = "".$row['title'].""; | $row['title'] = "".$row['title'].""; | ||||
} | } | ||||
$row['face'] = empty($row['face'])? $GLOBALS['cfg_mainsite'].'/static/web/img/admin.png' : $row['face']; | |||||
$row['textlink'] = "<a href='".$row['filename']."'>".$row['title']."</a>"; | $row['textlink'] = "<a href='".$row['filename']."'>".$row['title']."</a>"; | ||||
$row['plusurl'] = $row['phpurl'] = $GLOBALS['cfg_phpurl']; | $row['plusurl'] = $row['phpurl'] = $GLOBALS['cfg_phpurl']; | ||||
$row['memberurl'] = $GLOBALS['cfg_memberurl']; | $row['memberurl'] = $GLOBALS['cfg_memberurl']; | ||||
@@ -920,6 +922,7 @@ class ListView | |||||
$purl .= '?'.$geturl; | $purl .= '?'.$geturl; | ||||
$optionlist = ''; | $optionlist = ''; | ||||
//添加联动单筛选 | //添加联动单筛选 | ||||
$pageaddurl = ""; | |||||
foreach($_GET as $key => $value) { | foreach($_GET as $key => $value) { | ||||
$pageaddurl .= ($key!="tid" && $key!="TotalResult" && $key!="PageNo") ? "&".string_filter($key)."=".string_filter($value) : ''; | $pageaddurl .= ($key!="tid" && $key!="TotalResult" && $key!="PageNo") ? "&".string_filter($key)."=".string_filter($value) : ''; | ||||
} | } | ||||
@@ -662,6 +662,7 @@ class ListViewMobile | |||||
} | } | ||||
//获得附加表的相关信息 | //获得附加表的相关信息 | ||||
$addtable = $this->ChannelUnit->ChannelInfos['addtable']; | $addtable = $this->ChannelUnit->ChannelInfos['addtable']; | ||||
$filtersql = ""; | |||||
if ($addtable!="") | if ($addtable!="") | ||||
{ | { | ||||
$addJoin = " LEFT JOIN `$addtable` ON arc.id = ".$addtable.'.aid '; | $addJoin = " LEFT JOIN `$addtable` ON arc.id = ".$addtable.'.aid '; | ||||
@@ -697,7 +698,7 @@ class ListViewMobile | |||||
} | } | ||||
//如果不用默认的sortrank或id排序,使用联合查询数据量大时非常缓慢 | //如果不用默认的sortrank或id排序,使用联合查询数据量大时非常缓慢 | ||||
if (preg_match('/hot|click|lastpost/', $orderby)) { | if (preg_match('/hot|click|lastpost/', $orderby)) { | ||||
$query = "SELECT arc.*,tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath $addField FROM `#@__archives` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id $addJoin WHERE {$this->addSql} $filtersql $ordersql LIMIT $limitstart,$row"; | |||||
$query = "SELECT arc.*,tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath,mb.uname,mb.face $addField FROM `#@__archives` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id LEFT JOIN `#@__member` mb ON arc.mid=mb.mid $addJoin WHERE {$this->addSql} $filtersql $ordersql LIMIT $limitstart,$row"; | |||||
} | } | ||||
//普通情况先从arctiny表查出id,然后按di查询速度非常快 | //普通情况先从arctiny表查出id,然后按di查询速度非常快 | ||||
else { | else { | ||||
@@ -713,7 +714,7 @@ class ListViewMobile | |||||
if ($idstr == '') { | if ($idstr == '') { | ||||
return ''; | return ''; | ||||
} else { | } else { | ||||
$query = "SELECT arc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath $addField FROM `#@__archives` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id $addJoin WHERE arc.id in($idstr) $ordersql "; | |||||
$query = "SELECT arc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath,mb.uname,mb.face $addField FROM `#@__archives` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id LEFT JOIN `#@__member` mb ON arc.mid=mb.mid $addJoin WHERE arc.id in($idstr) $ordersql "; | |||||
} | } | ||||
$t2 = ExecTime(); | $t2 = ExecTime(); | ||||
} | } | ||||
@@ -766,9 +767,9 @@ class ListViewMobile | |||||
if ($row['litpic'] == '-' || $row['litpic'] == '') { | if ($row['litpic'] == '-' || $row['litpic'] == '') { | ||||
$row['litpic'] = $GLOBALS['cfg_cmspath'].'/static/web/img/thumbnail.jpg'; | $row['litpic'] = $GLOBALS['cfg_cmspath'].'/static/web/img/thumbnail.jpg'; | ||||
} | } | ||||
if (!preg_match("/^http:\/\//i", $row['litpic']) && $GLOBALS['cfg_multi_site'] == 'Y') { | |||||
/*if (!preg_match("/^http:\/\//i", $row['litpic']) && $GLOBALS['cfg_multi_site'] == 'Y') { | |||||
$row['litpic'] = $GLOBALS['cfg_mainsite'].$row['litpic']; | $row['litpic'] = $GLOBALS['cfg_mainsite'].$row['litpic']; | ||||
} | |||||
}*/ | |||||
$row['picname'] = $row['litpic']; | $row['picname'] = $row['litpic']; | ||||
$row['stime'] = GetDateMK($row['pubdate']); | $row['stime'] = GetDateMK($row['pubdate']); | ||||
$row['typelink'] = "<a href='".$row['typeurl']."'>".$row['typename']."</a>"; | $row['typelink'] = "<a href='".$row['typeurl']."'>".$row['typename']."</a>"; | ||||
@@ -782,6 +783,7 @@ class ListViewMobile | |||||
if (preg_match('/c/', $row['flag'])) { | if (preg_match('/c/', $row['flag'])) { | ||||
$row['title'] = "".$row['title'].""; | $row['title'] = "".$row['title'].""; | ||||
} | } | ||||
$row['face'] = empty($row['face'])? $GLOBALS['cfg_mainsite'].'/static/web/img/admin.png' : $row['face']; | |||||
$row['textlink'] = "<a href='".$row['filename']."'>".$row['title']."</a>"; | $row['textlink'] = "<a href='".$row['filename']."'>".$row['title']."</a>"; | ||||
$row['plusurl'] = $row['phpurl'] = $GLOBALS['cfg_phpurl']; | $row['plusurl'] = $row['phpurl'] = $GLOBALS['cfg_phpurl']; | ||||
$row['memberurl'] = $GLOBALS['cfg_memberurl']; | $row['memberurl'] = $GLOBALS['cfg_memberurl']; | ||||
@@ -946,6 +948,7 @@ class ListViewMobile | |||||
$purl .= '?'.$geturl; | $purl .= '?'.$geturl; | ||||
$optionlist = ''; | $optionlist = ''; | ||||
//添加联动单筛选 | //添加联动单筛选 | ||||
$pageaddurl = ""; | |||||
foreach($_GET as $key => $value) { | foreach($_GET as $key => $value) { | ||||
$pageaddurl .= ($key!="tid" && $key!="TotalResult" && $key!="PageNo") ? "&".string_filter($key)."=".string_filter($value) : ''; | $pageaddurl .= ($key!="tid" && $key!="TotalResult" && $key!="PageNo") ? "&".string_filter($key)."=".string_filter($value) : ''; | ||||
} | } | ||||
@@ -27,7 +27,9 @@ class SearchView | |||||
var $TotalPage; | var $TotalPage; | ||||
var $TotalResult; | var $TotalResult; | ||||
var $pagesize; | var $pagesize; | ||||
var $AddTable; | |||||
var $ChannelType; | var $ChannelType; | ||||
var $ChannelTypeid; | |||||
var $TempInfos; | var $TempInfos; | ||||
var $Fields; | var $Fields; | ||||
var $PartView; | var $PartView; | ||||
@@ -304,8 +306,8 @@ class SearchView | |||||
continue; | continue; | ||||
} | } | ||||
//这里不区分大小写进行关键词替换 | //这里不区分大小写进行关键词替换 | ||||
$fstr = str_ireplace($k, "<span class='text-primary'>$k</span>", $fstr); | |||||
//速度更快,效率更高$fstr = str_replace($k, "<span class='text-primary'>$k</span>", $fstr); | |||||
$fstr = str_ireplace($k, "<span class='text-danger'>$k</span>", $fstr); | |||||
//速度更快,效率更高$fstr = str_replace($k, "<span class='text-danger'>$k</span>", $fstr); | |||||
} | } | ||||
return $fstr; | return $fstr; | ||||
} | } | ||||
@@ -524,7 +526,7 @@ class SearchView | |||||
} | } | ||||
} | } | ||||
//搜索 | //搜索 | ||||
$query = "SELECT arc.*,act.typedir,act.typename,act.isdefault,act.defaultname,act.namerule,act.namerule2,act.ispart,act.moresite,act.siteurl,act.sitepath FROM `{$this->AddTable}` arc LEFT JOIN `#@__arctype` act ON arc.typeid=act.id WHERE {$this->AddSql} $ordersql LIMIT $limitstart,$row"; | |||||
$query = "SELECT arc.*,act.typedir,act.typename,act.isdefault,act.defaultname,act.namerule,act.namerule2,act.ispart,act.moresite,act.siteurl,act.sitepath,mb.uname,mb.face FROM `{$this->AddTable}` arc LEFT JOIN `#@__arctype` act ON arc.typeid=act.id LEFT JOIN `#@__member` mb on arc.mid = mb.mid WHERE {$this->AddSql} $ordersql LIMIT $limitstart,$row"; | |||||
$this->dsql->SetQuery($query); | $this->dsql->SetQuery($query); | ||||
$this->dsql->Execute("al"); | $this->dsql->Execute("al"); | ||||
$artlist = ""; | $artlist = ""; | ||||
@@ -571,7 +573,7 @@ class SearchView | |||||
if ($row['litpic'] == '-' || $row['litpic'] == '') { | if ($row['litpic'] == '-' || $row['litpic'] == '') { | ||||
$row['litpic'] = $GLOBALS['cfg_cmspath'].'/static/web/img/thumbnail.jpg'; | $row['litpic'] = $GLOBALS['cfg_cmspath'].'/static/web/img/thumbnail.jpg'; | ||||
} | } | ||||
if (!preg_match("/^http:\/\//", $row['litpic']) && $GLOBALS['cfg_multi_site'] == 'Y') { | |||||
if (!preg_match("/^(http|https):\/\//", $row['litpic']) && $GLOBALS['cfg_multi_site'] == 'Y') { | |||||
$row['litpic'] = $GLOBALS['cfg_mainsite'].$row['litpic']; | $row['litpic'] = $GLOBALS['cfg_mainsite'].$row['litpic']; | ||||
} | } | ||||
$row['picname'] = $row['litpic']; | $row['picname'] = $row['litpic']; | ||||
@@ -586,6 +588,7 @@ class SearchView | |||||
$row['plusurl'] = $row['phpurl'] = $GLOBALS['cfg_phpurl']; | $row['plusurl'] = $row['phpurl'] = $GLOBALS['cfg_phpurl']; | ||||
$row['memberurl'] = $GLOBALS['cfg_memberurl']; | $row['memberurl'] = $GLOBALS['cfg_memberurl']; | ||||
$row['templeturl'] = $GLOBALS['cfg_templeturl']; | $row['templeturl'] = $GLOBALS['cfg_templeturl']; | ||||
$row['face'] = empty($row['face'])? $GLOBALS['cfg_mainsite'].'/static/web/img/admin.png' : $row['face']; | |||||
if (is_array($this->dtp2->CTags)) { | if (is_array($this->dtp2->CTags)) { | ||||
foreach ($this->dtp2->CTags as $k => $ctag) { | foreach ($this->dtp2->CTags as $k => $ctag) { | ||||
if ($ctag->GetName() == 'array') { | if ($ctag->GetName() == 'array') { | ||||
@@ -697,15 +700,14 @@ class SearchView | |||||
} | } | ||||
} | } | ||||
$plist = ""; | $plist = ""; | ||||
$plist .= "<form name='pagelist' action='".$this->GetCurUrl()."'>$hidenform"; | |||||
$plist .= "<ul class='pagination justify-content-center pt-3'>"; | |||||
$plist .= preg_match('/info/i', $listitem)? $infos : ""; | |||||
$plist .= "<form name='pagelist' action='".$this->GetCurUrl()."' class='d-flex'>$hidenform"; | |||||
$plist .= preg_match('/info/i', $listitem)? $infos : ""; | |||||
$plist .= preg_match('/index/i', $listitem)? $indexpage : ""; | $plist .= preg_match('/index/i', $listitem)? $indexpage : ""; | ||||
$plist .= preg_match('/pre/i', $listitem)? $prepage : ""; | $plist .= preg_match('/pre/i', $listitem)? $prepage : ""; | ||||
$plist .= preg_match('/pageno/i', $listitem)? $listdd : ""; | $plist .= preg_match('/pageno/i', $listitem)? $listdd : ""; | ||||
$plist .= preg_match('/next/i', $listitem)? $nextpage : ""; | $plist .= preg_match('/next/i', $listitem)? $nextpage : ""; | ||||
$plist .= preg_match('/end/i', $listitem)? $endpage : ""; | $plist .= preg_match('/end/i', $listitem)? $endpage : ""; | ||||
$plist .= "</ul></form>\r\n"; | |||||
$plist .= "</form>\r\n"; | |||||
return $plist; | return $plist; | ||||
} | } | ||||
/** | /** | ||||
@@ -312,9 +312,6 @@ class SgListView | |||||
$tempfile = str_replace("{tid}", $this->TypeID, $this->Fields['tempindex']); | $tempfile = str_replace("{tid}", $this->TypeID, $this->Fields['tempindex']); | ||||
$tempfile = str_replace("{cid}", $this->ChannelUnit->ChannelInfos['nid'], $tempfile); | $tempfile = str_replace("{cid}", $this->ChannelUnit->ChannelInfos['nid'], $tempfile); | ||||
$tempfile = $tmpdir."/".$tempfile; | $tempfile = $tmpdir."/".$tempfile; | ||||
if (defined('DEDEMOB')) { | |||||
$tempfile = str_replace('.htm', '_m.htm', $tempfile); | |||||
} | |||||
if (!file_exists($tempfile)) { | if (!file_exists($tempfile)) { | ||||
$tempfile = $tmpdir."/".$GLOBALS['cfg_df_style']."/index_default_sg.htm"; | $tempfile = $tmpdir."/".$GLOBALS['cfg_df_style']."/index_default_sg.htm"; | ||||
if (defined('DEDEMOB')) { | if (defined('DEDEMOB')) { | ||||
@@ -551,7 +548,7 @@ class SgListView | |||||
$addField = 'arc.'.join(',arc.', $this->ListFields); | $addField = 'arc.'.join(',arc.', $this->ListFields); | ||||
//如果不用默认的sortrank或id排序,使用联合查询数据量大时非常缓慢 | //如果不用默认的sortrank或id排序,使用联合查询数据量大时非常缓慢 | ||||
if (preg_match('/hot|click/', $orderby) || $this->sAddTable) { | if (preg_match('/hot|click/', $orderby) || $this->sAddTable) { | ||||
$query = "SELECT tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath,arc.aid,arc.aid AS id,arc.typeid,$addField FROM `{$this->AddTable}` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id WHERE {$this->addSql} $ordersql LIMIT $limitstart,$row"; | |||||
$query = "SELECT tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath,arc.aid,arc.aid AS id,arc.typeid,mb.uname,mb.face,$addField FROM `{$this->AddTable}` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id LEFT JOIN `#@__member` mb on arc.mid = mb.mid WHERE {$this->addSql} $ordersql LIMIT $limitstart,$row"; | |||||
} | } | ||||
//普通情况先从arctiny表查出id,然后按id查询速度非常快 | //普通情况先从arctiny表查出id,然后按id查询速度非常快 | ||||
else { | else { | ||||
@@ -568,7 +565,7 @@ class SgListView | |||||
if ($idstr == '') { | if ($idstr == '') { | ||||
return ''; | return ''; | ||||
} else { | } else { | ||||
$query = "SELECT tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath,arc.aid,arc.aid AS id,arc.typeid,$addField FROM `{$this->AddTable}` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id WHERE arc.aid IN($idstr) AND arc.arcrank >-1 $ordersql"; | |||||
$query = "SELECT tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath,arc.aid,arc.aid AS id,arc.typeid,mb.uname,mb.face,$addField FROM `{$this->AddTable}` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id LEFT JOIN `#@__member` mb on arc.mid = mb.mid WHERE arc.aid IN($idstr) AND arc.arcrank >-1 $ordersql"; | |||||
} | } | ||||
$t2 = ExecTime(); | $t2 = ExecTime(); | ||||
} | } | ||||
@@ -636,6 +633,7 @@ class SgListView | |||||
$row['plusurl'] = $row['phpurl'] = $GLOBALS['cfg_phpurl']; | $row['plusurl'] = $row['phpurl'] = $GLOBALS['cfg_phpurl']; | ||||
$row['memberurl'] = $GLOBALS['cfg_memberurl']; | $row['memberurl'] = $GLOBALS['cfg_memberurl']; | ||||
$row['templeturl'] = $GLOBALS['cfg_templeturl']; | $row['templeturl'] = $GLOBALS['cfg_templeturl']; | ||||
$row['face'] = empty($row['face'])? $GLOBALS['cfg_mainsite'].'/static/web/img/admin.png' : $row['face']; | |||||
//编译附加表里的数据 | //编译附加表里的数据 | ||||
foreach ($row as $k => $v) $row[strtolower($k)] = $v; | foreach ($row as $k => $v) $row[strtolower($k)] = $v; | ||||
foreach ($this->ChannelUnit->ChannelFields as $k => $arr) { | foreach ($this->ChannelUnit->ChannelFields as $k => $arr) { | ||||