0 410 2022-05-25 22:03:22
收藏
<?
$sql=$empire->query("select * from {$dbtbpre}ecms_news order by id desc limit 30");
while($bqr=$empire->fetch($sql)){
$bqsr=sys_ReturnEcmsLoopStext($bqr);
$bqno++;
$fr=$empire->fetch1("select newstext,infotags from {$dbtbpre}ecms_news_data_{$bqr[stb]} where id='$bqr[id]'");
$neirong=$fr['newstext'];
$imgcount=substr_count($neirong,"<img");
$neirong=preg_replace("@<iframe(.*?)</iframe>@is","",$neirong);
$neirong=str_replace("$public_r[newsurl]","/","$neirong");
$neirong=stripslashes($neirong);
$match=='';
$pattern='/<[img|IMG].*?src="(.*?(?:[.gif|.jpg|.png]))".*?>/';
preg_match_all($pattern,$neirong,$match);
if($match[1][0]==''){
$pattern='/<[img|IMG].*?src=\\"(.*?(?:[.gif|.jpg|.png]))\\".*?>/';
preg_match_all($pattern,$neirong,$match);
}
$cl=$empire->fetch1("select classname from {$dbtbpre}enewsclass where classid='$bqr[classid]'");
$classname=$cl['classname'];
$infotags=$fr['infotags'];
$r_tag=explode(",",$infotags);
for($i=0;$i<count($r_tag);$i++){
if($r_tag[$i]){
$tagslink=$public_r[newsurl].'e/tags/?tagname='.$r_tag[$i];
$tags.="<a href='$tagslink' target='_blank' rel='tag'>".$r_tag[$i]."</a>";
}
}
$tmpimg4='';
$tmpimg3='';
$tmpimg1='';
?>
<?
if($imgcount>3){
for($j=0;$j<4;$j++){
$tmpimg4.=' <a href="'.$bqr[titleurl].'"><img src="'.$public_r[newsurl].'e/extend/timthumb.php?src='.$match[1][$j].'&h=120&w=180&zc=1" alt="'.$bqr[title].'" /></a> ';
}
?>
<li class="listpost_li">
<h2><a href="<?=$bqr[titleurl]?>" title="<?=$bqr[title]?>" target="_blank">444<?=$bqr[title]?></a></h2>
<div class="moreimg"> <?=$tmpimg4?> </div>
<div class="moreinfo"> <span class="on"><a href="<?=$bqsr[classurl]?>"><?=$classname?></a></span> <span class="on"><?=date('Y-m-d',$bqr[newstime])?></span> <span>阅读(<?=$bqr[onclick]?>)</span> <span><?=$tags?></span> </div>
</li>
<?}?>
<?
if($imgcount==3){
for($j=0;$j<3;$j++){
$tmpimg3.=' <a href="'.$bqr[titleurl].'"><img src="'.$public_r[newsurl].'e/extend/timthumb.php?src='.$match[1][$j].'&h=120&w=180&zc=1" alt="'.$bqr[title].'" /></a> ';
}
?>
<li class="listpost_li">
<h2><a href="<?=$bqr[titleurl]?>" title="<?=$bqr[title]?>" target="_blank">333<?=$bqr[title]?></a></h2>
<div class="moreimg"> <?=$tmpimg3?> <a href="<?=$bqr[titleurl]?>" class="picture-more">查看详情 ></a></div>
<div class="moreinfo"> <span class="on"><a href="<?=$bqsr[classurl]?>"><?=$classname?></a></span> <span class="on"><?=date('Y-m-d',$bqr[newstime])?></span> <span>阅读(<?=$bqr[onclick]?>)</span> <span><?=$tags?></span> </div>
</li>
<?}?>
<?
if($imgcount<3&&$imgcount>0){
for($j=0;$j<1;$j++){
$tmpimg1.=' <a href="'.$bqr[titleurl].'"><img src="'.$public_r[newsurl].'e/extend/timthumb.php?src='.$match[1][$j].'&h=120&w=180&zc=1" alt="'.$bqr[title].'" /></a> ';
}
?>
<li class="listpost_li">
<div class="img"> <?=$tmpimg1?> </div>
<div class="info">
<h2><a href="<?=$bqr[titleurl]?>" target="_blank">222<?=$bqr[title]?></a></h2>
<div class="moreinfo"> <span class="on"><a href="<?=$bqsr[classurl]?>"><?=$classname?></a></span> <span class="on"><?=date('Y-m-d',$bqr[newstime])?></span> <span>阅读(<?=$bqr[onclick]?>)</span> <span><?=$tags?></span> </div>
</div>
</li>
<?}?>
<?
if($imgcount<1){
?>
<li class="listpost_li">
<div class="info" style="margin-left: 0px;">
<h2><a href="<?=$bqr[titleurl]?>" target="_blank">000<?=$bqr[title]?></a></h2>
<div class="moreinfo"> <span class="on"><a href="<?=$bqsr[classurl]?>"><?=$classname?></a></span> <span class="on"><?=date('Y-m-d',$bqr[newstime])?></span> <span>阅读(<?=$bqr[onclick]?>)</span> <span><?=$tags?></span> </div>
</div>
</li>
<?}?>
<?}?>
$fr=$empire->fetch1("select newstext,infotags from {$dbtbpre}ecms_news_data_{$r[stb]} where id='$r[id]'");
$neirong=$fr['newstext'];
$imgcount=substr_count($neirong,"<img");
$neirong=preg_replace("@<iframe(.*?)</iframe>@is","",$neirong);
$neirong=str_replace("$public_r[newsurl]","/","$neirong");
$match=='';
$pattern='/<[img|IMG].*?src="(.*?(?:[.gif|.jpg|.png]))".*?[/]?>/';
preg_match_all($pattern,$neirong,$match);
if($match[1][0]==''){
$pattern='/<[img|IMG].*?src=\\"(.*?(?:[.gif|.jpg|.png]))\\".*?[/]?>/';
preg_match_all($pattern,$neirong,$match);
}
$cl=$empire->fetch1("select classname from {$dbtbpre}enewsclass where classid='$r[classid]'");
$classname=$cl['classname'];
$infotags=$fr['infotags'];
$r_tag=explode(",",$infotags);
for($i=0;$i<count($r_tag);$i++){
if($r_tag[$i]){
$tagslink=$public_r[newsurl]."e/tags/?tagname=".$r_tag[$i];
$tags.="<a href='$tagslink' target='_blank' rel='tag'>".$r_tag[$i]."</a>";
}
}
if($imgcount>3){
for($j=0;$j<4;$j++){
$tmpimg4.=' <a href="[!--titleurl--]"><img src="'.$public_r[newsurl].'e/extend/timthumb.php?src='.$match[1][$j].'&h=120&w=180&zc=1" alt="[!--oldtitle--]" /></a> ';
}
$listtemp='<li class="listpost_li">
<h2><a href="[!--titleurl--]" title="[!--oldtitle--]" target="_blank">[!--title--]</a></h2>
<div class="moreimg"> '.$tmpimg4.' </div>
<div class="moreinfo"> <span class="on"><a href="[!--this.classlink--]">'.$classname.'</a></span> <span class="on">[!--newstime--]</span> <span>阅读([!--onclick--])</span> <span>'.$tags.'</span> </div>
</li>';
}
if($imgcount==3){
for($j=0;$j<3;$j++){
$tmpimg3.=' <a href="[!--titleurl--]"><img src="'.$public_r[newsurl].'e/extend/timthumb.php?src='.$match[1][$j].'&h=120&w=180&zc=1" alt="[!--oldtitle--]" /></a> ';
}
$listtemp='<li class="listpost_li">
<h2><a href="[!--titleurl--]" title="[!--oldtitle--]" target="_blank">[!--title--]</a></h2>
<div class="moreimg"> '.$tmpimg3.' <a href="[!--titleurl--]" class="picture-more">查看详情 ></a></div>
<div class="moreinfo"> <span class="on"><a href="[!--this.classlink--]">'.$classname.'</a></span> <span class="on">[!--newstime--]</span> <span>阅读([!--onclick--])</span> <span>'.$tags.'</span> </div>
</li>';
}
if($imgcount<3){
for($j=0;$j<1;$j++){
$tmpimg1.=' <a href="[!--titleurl--]"><img src="'.$public_r[newsurl].'e/extend/timthumb.php?src='.$match[1][$j].'&h=120&w=180&zc=1" alt="[!--oldtitle--]" /></a> ';
}
$listtemp='<li class="listpost_li">
<div class="img"> '.$tmpimg1.' </div>
<div class="info">
<h2><a href="[!--titleurl--]" target="_blank">[!--title--]</a></h2>
<div class="moreinfo"> <span class="on"><a href="[!--this.classlink--]">'.$classname.'</a></span> <span class="on">[!--newstime--]</span> <span>阅读([!--onclick--])</span> <span>'.$tags.'</span> </div>
</div>
</li>';
}
if($imgcount<1){
$listtemp='<li class="listpost_li">
<div class="info" style="margin-left: 0px;">
<h2><a href="[!--titleurl--]" target="_blank">[!--title--]</a></h2>
<div class="moreinfo"> <span class="on"><a href="[!--this.classlink--]">'.$classname.'</a></span> <span class="on">[!--newstime--]</span> <span>阅读([!--onclick--])</span> <span>'.$tags.'</span> </div>
</div>
</li>';
}本文地址:https://xzo.com.cn/develop/empire/1088.html

如果您认可我们的分享,有意与我们合作开展帝国cms网站建设与开发业务或插件定制,请联系右侧在线客服。我们能给您的,就是高质量的模板与售后。
标注了信息来源为下载鸥的文章皆为原创,如果是转载的优质文章,我们也都标注了出处。如果您喜欢我们的文章,请按照下载鸥所标注的文章出处进行标注,谢谢您的配合。

帝国cms是一款功能极为强大的cms程序,性能强悍、安全性高,可轻松支持10万数据,高级开发人员可制作出能容纳千万数据量的网站,是国内最出色的开源cms程序之一,推荐企业用户使用。
当前最新版本为7.5,8.0版本即将上线,新版本的核心优化点在于多终端的适配。
在一些需要控制用户输入字数的站点中,增加用户输入字数的实时提示无疑十分友...
常有客户要求文章列表、详情能够实时显示点击数,但又不想将静态页面改为动态...
帝国cms论坛早已有了以cookie形式保存浏览量历史记录在客户端的插件,但这样...
帝国cms开发的下载站很多,许多站点基于优质用户推荐的需求就需要做下载的日...
我们知道,帝国cms终极栏目可以用<?=$class_r[$GLOBALS[navclassid]][bname]?...
帝国cms和Wordpress是完全不同的程序,其设计理念有着天壤之别。转换肯定会存...
一台服务器如果存在多个站点,则这些站点的数据可以互相调用。通过互相调用,我...
帝国cms是一款功能强大的cms,不仅安全性高,还能够轻松驾驭20万以上的数据,牛逼...
通过本插件,可以实现帝国cms网站对接百度云api实现图像无损放大的功能。经过...
帝国CMS自带的搜索功能虽然强大,但也有很强的局限性 -- 必须关键词完全匹配...
帝国cms默认只有上次登录时间与ip,没有一个记录清单,所以今天,我们分享这个帝...
用户体验是我们的需求,百度蜘蛛的认可更是我们的需求。毕竟,没有收录排名,何来...
百度开放了系列AI功能api如图像上色、图像去雾、图像修复、无损放大、清晰...
通过本插件,可以实现帝国cms网站对接百度云api实现图像去雾的功能。经过实际...
下载鸥开发了这款帝国cms封禁ip插件,自动记录访问情况,让我们可以更快的识别...
采集站的必备资源是自动审核,要做到日收录也离不开定时发布。而本插件的自动...