在织梦标签dede:list中增加noflag属性的方法支持5.7版本(8)
}
}
}
else
{
$addField = ”;
$addJoin = ”;
}
//如果不用默认的sortrank或id排序,使用联合查询(数据量大时非常缓慢)
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 `dede_archives` arc
left join `dede_arctype` tp on arc.typeid=tp.id
$addJoin
where {$this->addSql} $noflagsql $ordersql limit $limitstart,$row”;
}
//普通情况先从arctiny表查出ID,然后按ID查询(速度非常快)
else
{
$numquery = “Select id From `dede_archives` arc where {$this->addSql} $noflagsql $ordersql”;
$this->dsql->SetQuery($numquery);
$this->dsql->Execute();
while($arr=$this->dsql->GetArray())
{
$fuck[] = $arr[‘id’];
}
$this->TotalResult = count($fuck);
$t1 = ExecTime();
$ids = array();
$query = “Select id From `dede_archives` arc where {$this->addSql} $noflagsql $ordersql limit $limitstart,$row “;
$this->dsql->SetQuery($query);
$this->dsql->Execute();
while($arr=$this->dsql->GetArray())
{
$ids[] = $arr[‘id’];
}
$idstr = join(‘,’,$ids);
if($idstr==”)
{
return ”;
}
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 `dede_archives` arc left join `dede_arctype` tp on arc.typeid=tp.id
$addJoin
where arc.id in($idstr) $noflagsql $ordersql “;
}
$t2 = ExecTime();
//echo $t2-$t1;
}
$this->dsql->SetQuery($query);
$this->dsql->Execute(‘al’);
$t2 = ExecTime();
//echo $t2-$t1;
$artlist = ”;
$this->dtp2->LoadSource($innertext);
$GLOBALS[‘autoindex’] = 0;
for($i=0;$i<$row;$i++)
{
if($col>1)
{
$artlist .= “<div>\r\n”;
}
for($j=0;$j<$col;$j++)
{
if($row = $this->dsql->GetArray(“al”))
{
$GLOBALS[‘autoindex’]++;
$ids[$row[‘id’]] = $row[‘id’];
//处理一些特殊字段
$row[‘infos’] = cn_substr($row[‘description’],$infolen);
$row[‘id’] = $row[‘id’];
if($cfg_digg_update > 0)
{
$prefix = ‘diggCache’;
$key = ‘aid-‘.$row[‘id’];
$cacherow = GetCache($prefix, $key);
$row[‘goodpost’] = $cacherow[‘goodpost’];
$row[‘badpost’] = $cacherow[‘badpost’];
$row[‘scores’] = $cacherow[‘scores’];
}
if($row[‘corank’] > 0 && $row[‘arcrank’]==0)
{
$row[‘arcrank’] = $row[‘corank’];
}
$row[‘filename’] = $row[‘arcurl’] = GetFileUrl($row[‘id’],$row[‘typeid’],$row[‘senddate’],$row[‘title’],$row[‘ismake’],
$row[‘arcrank’],$row[‘namerule’],$row[‘typedir’],$row[‘money’],$row[‘filename’],$row[‘moresite’],$row[‘siteurl’],$row[‘sitepath’]);
免责声明:本站所有文章和图片均来自用户分享和网络收集,文章和图片版权归原作者及原出处所有,仅供学习与参考,请勿用于商业用途,如果损害了您的权利,请联系网站客服处理。
☉本站的源码不会像其它下载站一样植入大量的广告。为了更好的用户体验以后坚持不打水印
☉本站只提供精品织梦源码,源码在于可用,不在多!!希望在这里找到你合适的。
☉本站提供的整站织梦程序,均带数据及演示地址。可以在任一源码详情页查看演示地址
☉本站所有资源(包括源码、模板、素材、特效等)仅供学习与参考,请勿用于商业用途。
☉如有其他问题,请加网站客服QQ进行交流。
- dedecms SQL注入漏洞 member/album_add.php 修复
- dedecms cookies泄漏导致SQL漏洞 /member/article_add
- Windows虚拟主机指定目录禁用脚本执行权限方法
- 西部数码虚拟主机设置禁止脚本执行权限
- 阿里云主机设置织梦程序禁止脚本执行权限及禁止写入
- dedecms织梦导致CPU峰值现象的解决办法
- 织梦程序网站被挂马或快照劫持终极解决办法
- 阿里云提醒/member/reg_new.php注入漏洞解决办法
- 织梦安全:更改plus名称
- 织梦栏目属性增加链接rel、nofollow和新窗口target
- 织梦问答模块PHP7报错解决方法
- dedecms解决移动端首页不自动更新问题