0 367 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有两大标签,其中一个叫万能标签,另一个叫灵动标签,两个标签用法截然不...
如果能将手里的资源合并,会员渠道打通,则用起来更加舒服。而帝国CMS自带的会...
在网站运营过程中,我们可能因为这样那样的原因需要批量删除大批文章信息,几十...
使用js实现点击按钮进入下一个内容页分页,用jQuery做肯定是最快捷的方式,因此...
在帝国cms二次开发过程中,我们有时会需要判断一条信息有没有缩略图(标题图)。...
使用360极速浏览器已经很长时间,一直感觉用起来相当不错。一方面有chrome的...
在网站开发的过程中,我们可能因为这样那样的问题遇到无数的出错。有可能是代...
视频文件默认会被pc浏览器直接打开,此时download属性也同样无效。那么,要怎样...
百度开放了系列AI功能api如图像上色、图像去雾、图像修复、无损放大、清晰...
采集站的必备资源是自动审核,要做到日收录也离不开定时发布。而本插件的自动...
帝国CMS自带的搜索功能虽然强大,但也有很强的局限性 -- 必须关键词完全匹配...
本插件基于帝国cms帝国cms每日自动审核插件,在自动审核指定条数信息的基础上...
使用帝国cms的企业用户、新闻资讯类站点的用户很多,此类站点很多时候需要有...
通过本插件,可以实现帝国cms网站对接百度云api实现图像无损放大的功能。经过...
通过本插件,可以实现帝国cms网站对接百度云api实现图像清晰度增强的功能。经...
一直没看到好用的帝国cms在线考试插件,所以自己开发了一款。在线考试插件用...