0 295 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之一,其程序效率毫无疑问。但,帝国CMS真的可以做...
帝国CMS的信息是绑定内容模板的,通过本教程可以实现在前台自由使用不同的模...
百度小程序的开放生态对网站站长及企业商家而言,能够从中获取到什么呢?百度智...
帝国CMS是一款相当安全的开源cms程序,如果使用规范的模板,一般是不会被挂马的...
帝国CMS安装报错 fatal error:require():Failed opening required ../clas...
在帝国cms二次开发过程中,我们经常需要调用模板的公共部位,也就是帝国cms的公...
帝国CMS列表页的分页函数是用系统设置中的分页函数,修改都是在系统设置里进...
帝国cms程序广泛应用于各行各业的网站建设,其安全性高、性能强大。但网站建...
百度开放了系列AI功能api如图像上色、图像去雾、图像修复、无损放大、清晰...
帝国cms 对接纳米数据(www.nami.com)接口,本接口主要接收、整理足球比赛实时数...
本插件基于帝国cms帝国cms每日自动审核插件,在自动审核指定条数信息的基础上...
使用帝国cms的企业用户、新闻资讯类站点的用户很多,此类站点很多时候需要有...
通过本插件,可以实现帝国cms网站对接百度云api实现图像清晰度增强的功能。经...
用户体验是我们的需求,百度蜘蛛的认可更是我们的需求。毕竟,没有收录排名,何来...
本插件适用于内网用户,可查看单篇文章访问者ip地址。如果添加访问者ip组,可查...
许多网站会做一些小功能小插件给客户使用以增强用户黏性,比如图片转文字,这种...