0 264 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模板中插入360推送代码,会发现在插入360推送代码后,无法正...
我们知道,帝国cms既可以做动态页,也可以做静态页,还可以做伪静态页。那么,他们...
每次更新发布文章tag信息后,tag数据表的时间会自动同步,但tag信息表的修改时...
帝国cms删除栏目出错,提示select newstext from **_ecms_news where classid...
近日有客户找到鸥哥协助找回密码,对方使用的是旧版帝国cms6.6 ,密码找回本来...
帝国cms提示信息函数printerror2,可用于直接提示信息,且调用方式简单。...
帝国cms复选框是一个比较常见的功能,我们可以通过使用复选款实现许多复杂的...
帝国cms默认是不允许修改系统模型ID的,因为一旦修改牵扯较大。那么,如果一定...
视频文件默认会被pc浏览器直接打开,此时download属性也同样无效。那么,要怎样...
帝国cms怎样提取正文里的3张图片做缩略图呢?...
分享一个帝国cms双色球开奖号码与开机号码是否命中的代码。一方面判断中了...