您现在的位置是:首页 > 网站制作 > 网站建设网站建设

帝国cms新闻系统增加图片集,并且列表模板调用所有小图实现方法

胜于蓝2019-09-01【网站建设】人已围观

简介1、增加字段,可以仿照图片系统的字段值,添加到新闻系统,注意值,要不然调不出来
2、保存后,修改系统模型



刷新数据库,这样,新闻系统增加信息,就会有图集显示


列表页调用所有小图

1、增加字段,可以仿照图片系统的字段值,添加到新闻系统,注意值,要不然调不出来6Wb胜于蓝|优秀个人博客
2、保存后,修改系统模型6Wb胜于蓝|优秀个人博客
6Wb胜于蓝|优秀个人博客
6Wb胜于蓝|优秀个人博客
6Wb胜于蓝|优秀个人博客
刷新数据库,这样,新闻系统增加信息,就会有图集显示6Wb胜于蓝|优秀个人博客
6Wb胜于蓝|优秀个人博客
6Wb胜于蓝|优秀个人博客
列表页调用所有小图,方法如下:,一定要勾选使用程序代码6Wb胜于蓝|优秀个人博客
6Wb胜于蓝|优秀个人博客
 6Wb胜于蓝|优秀个人博客

$fr=$empire->fetch1("select * from {$dbtbpre}ecms_news where id='$r[id]'");6Wb胜于蓝|优秀个人博客
$rexp="\r\n";6Wb胜于蓝|优秀个人博客
$fexp="::::::";6Wb胜于蓝|优秀个人博客
$rr=explode($rexp,$fr[morepic]);6Wb胜于蓝|优秀个人博客
$count=count($rr);6Wb胜于蓝|优秀个人博客
$listtemp="";6Wb胜于蓝|优秀个人博客
for($i=1;$i<$count+1;$i++)6Wb胜于蓝|优秀个人博客
{6Wb胜于蓝|优秀个人博客
$frt=explode($fexp,$rr[$i-1]);6Wb胜于蓝|优秀个人博客
$listtemps.=('<a href="'.$frt[1].'"><img src="'.$frt[0].'"></a>');6Wb胜于蓝|优秀个人博客
}6Wb胜于蓝|优秀个人博客
$listtemp=('<li>'.$listtemps.'</li>');6Wb胜于蓝|优秀个人博客
如果表是副表,则添加_data_{$r[stb]}6Wb胜于蓝|优秀个人博客
select * from {$dbtbpre}ecms_news_data_{$r[stb]} where id='$r[id]'  红线标注为副表,注意区分6Wb胜于蓝|优秀个人博客
6Wb胜于蓝|优秀个人博客
内容页,如果也要对图集进行分割,可以这样:6Wb胜于蓝|优秀个人博客
<?php6Wb胜于蓝|优秀个人博客
$arr = array();6Wb胜于蓝|优秀个人博客
$arr = $navinfor['morepic'];6Wb胜于蓝|优秀个人博客
$newarr = explode(egetzy('rn'),$arr);6Wb胜于蓝|优秀个人博客
$count = count(explode(egetzy('rn'),$navinfor[morepic]));//图集的图片数量 6Wb胜于蓝|优秀个人博客
for($i=0;$i<$count;$i++)6Wb胜于蓝|优秀个人博客
{6Wb胜于蓝|优秀个人博客
$s_arr = array();6Wb胜于蓝|优秀个人博客
$s_arr[] = $newarr[$i];6Wb胜于蓝|优秀个人博客
$str = $s_arr[0];6Wb胜于蓝|优秀个人博客
$bot_arr = explode("::::::", $str);6Wb胜于蓝|优秀个人博客
$spic = $bot_arr[0];//小图6Wb胜于蓝|优秀个人博客
$bpic = $bot_arr[1];//大图6Wb胜于蓝|优秀个人博客
$picinfo = $bot_arr[2];//图片说明6Wb胜于蓝|优秀个人博客
6Wb胜于蓝|优秀个人博客
echo '  <li> <a href="javascript:void(0);"><img src="'.$spic.'"  alt="'.$picinfo.'" bigimg="'.$bpic.'"  text="'.$picinfo.'"  /></a></li>';6Wb胜于蓝|优秀个人博客
6Wb胜于蓝|优秀个人博客
}6Wb胜于蓝|优秀个人博客
?>6Wb胜于蓝|优秀个人博客
 

内容页图片统计6Wb胜于蓝|优秀个人博客
 <?php6Wb胜于蓝|优秀个人博客
6Wb胜于蓝|优秀个人博客
$sl=empty($navinfor[morepic])?0:count(explode(chr(13),$navinfor[morepic]));6Wb胜于蓝|优秀个人博客
6Wb胜于蓝|优秀个人博客
echo $sl;6Wb胜于蓝|优秀个人博客
6Wb胜于蓝|优秀个人博客
?>6Wb胜于蓝|优秀个人博客

 

 6Wb胜于蓝|优秀个人博客
以前讲过多样式调用,那如果要增加图片集该怎么调用呢?6Wb胜于蓝|优秀个人博客
$titlepic='';6Wb胜于蓝|优秀个人博客
$morepic='';6Wb胜于蓝|优秀个人博客
if($r[titlepic])6Wb胜于蓝|优秀个人博客
{6Wb胜于蓝|优秀个人博客
$titlepic='<a href="" target="_blank"> <span class="newspic"><img src="[!--titlepic--]" alt="[!--oldtitle--]" /></span></a>6Wb胜于蓝|优秀个人博客
        <h2 class="newstitle"><a href="[!--titleurl--]" target="_blank">[!--title--]</a></h2>';6Wb胜于蓝|优秀个人博客
}6Wb胜于蓝|优秀个人博客
if($r[morepic])6Wb胜于蓝|优秀个人博客
{6Wb胜于蓝|优秀个人博客
$fr=$empire->fetch1("select * from {$dbtbpre}ecms_news where id='$r[id]'");6Wb胜于蓝|优秀个人博客
$rexp="\r\n";6Wb胜于蓝|优秀个人博客
$fexp="::::::";6Wb胜于蓝|优秀个人博客
$rr=explode($rexp,$fr[morepic]);6Wb胜于蓝|优秀个人博客
$count=count($rr);6Wb胜于蓝|优秀个人博客
for($i=1;$i<5;$i++)6Wb胜于蓝|优秀个人博客
{6Wb胜于蓝|优秀个人博客
$frt=explode($fexp,$rr[$i-1]);6Wb胜于蓝|优秀个人博客
$titlepis.=('<li><i><a href="[!--titleurl--]"><img src="'.$frt[0].'"></a></i></li>');6Wb胜于蓝|优秀个人博客
}6Wb胜于蓝|优秀个人博客
$titlepic=('  <h2 class="newstitle"><a href="[!--titleurl--]" target="_blank">[!--title--]</a></h2><div class="newspicbox"><ul>'.$titlepis.'</ul><div class="count">'.$count.'图</div></div>');6Wb胜于蓝|优秀个人博客
}6Wb胜于蓝|优秀个人博客
6Wb胜于蓝|优秀个人博客
$listtemp='6Wb胜于蓝|优秀个人博客
<li class="newslist" data-scroll-reveal="enter bottom over 1s">     6Wb胜于蓝|优秀个人博客
'.$titlepic.'6Wb胜于蓝|优秀个人博客
        <div class="bloginfo">6Wb胜于蓝|优秀个人博客
          <ul>6Wb胜于蓝|优秀个人博客
            <li class="author">[!--writer--]</li>6Wb胜于蓝|优秀个人博客
            <li class="lmname"><a href="[!--this.classlink--]" title="[!--this.classname--]" target="_blank"  class="classname">[!--this.classname--]</a>6Wb胜于蓝|优秀个人博客
            <li class="timer">[!--newstime--]</li>6Wb胜于蓝|优秀个人博客
            <li class="view"><span>[!--onclick--]</span></li>6Wb胜于蓝|优秀个人博客
          </ul>6Wb胜于蓝|优秀个人博客
        </div>6Wb胜于蓝|优秀个人博客
      </li>6Wb胜于蓝|优秀个人博客
';6Wb胜于蓝|优秀个人博客
6Wb胜于蓝|优秀个人博客
效果如下图:6Wb胜于蓝|优秀个人博客

6Wb胜于蓝|优秀个人博客

6Wb胜于蓝|优秀个人博客
首页获取单张小图调用方法:6Wb胜于蓝|优秀个人博客
6Wb胜于蓝|优秀个人博客
$morepic='';6Wb胜于蓝|优秀个人博客
if($r[morepic])6Wb胜于蓝|优秀个人博客
{6Wb胜于蓝|优秀个人博客
$fr=$empire->fetch1("select * from {$dbtbpre}ecms_news where id='$r[id]'");6Wb胜于蓝|优秀个人博客
$rexp="\r\n";6Wb胜于蓝|优秀个人博客
$fexp="::::::";6Wb胜于蓝|优秀个人博客
$rr=explode($rexp,$fr[morepic]);6Wb胜于蓝|优秀个人博客
$count=count($rr);6Wb胜于蓝|优秀个人博客
for($i=1;$i<2;$i++)6Wb胜于蓝|优秀个人博客
{6Wb胜于蓝|优秀个人博客
$frt=explode($fexp,$rr[$i-1]);6Wb胜于蓝|优秀个人博客
$listtemps.=('<li><i><a href="[!--titleurl--]" title="[!--oldtitle--]"><img src="'.$frt[0].'"></a></i><span class="picture-item">[!--oldtitle--]</span></li>');6Wb胜于蓝|优秀个人博客
}6Wb胜于蓝|优秀个人博客
6Wb胜于蓝|优秀个人博客
}6Wb胜于蓝|优秀个人博客
6Wb胜于蓝|优秀个人博客
$listtemp=(''.$listtemps.'');6Wb胜于蓝|优秀个人博客
6Wb胜于蓝|优秀个人博客
6Wb胜于蓝|优秀个人博客
内容页:6Wb胜于蓝|优秀个人博客
6Wb胜于蓝|优秀个人博客
<?php6Wb胜于蓝|优秀个人博客
$picr=explode(egetzy('rn'),$navinfor[morepic]);6Wb胜于蓝|优秀个人博客
for($p=0;$p<count($picr);$p++)6Wb胜于蓝|优秀个人博客
{6Wb胜于蓝|优秀个人博客
$spicr=explode("::::::",$picr[$p]);6Wb胜于蓝|优秀个人博客
?>6Wb胜于蓝|优秀个人博客
        <li>6Wb胜于蓝|优秀个人博客
          <div class="picimg"><img src="<?=$spicr[0]?>" /></div>6Wb胜于蓝|优秀个人博客
          <div class="pictxt">6Wb胜于蓝|优秀个人博客
            <h3>[!--title--]</h3>6Wb胜于蓝|优秀个人博客
          </div>6Wb胜于蓝|优秀个人博客
        </li>6Wb胜于蓝|优秀个人博客
6Wb胜于蓝|优秀个人博客
<?php6Wb胜于蓝|优秀个人博客
}6Wb胜于蓝|优秀个人博客
?>6Wb胜于蓝|优秀个人博客

6Wb胜于蓝|优秀个人博客
 

Tags:

很赞哦! ()

文章评论

当前时间

快速排名

  • 网站建设|万词霸屏,企业软文推广,刷下拉框
  • 快速排名:不用再等SEO三个月,只需3-7天即可把行业关键词覆盖百度搜索引擎首页,点击不收费,排名报表,真实访问量报表一目了然。

合作加盟

  • 扫码请注明来意,否则不会通过
  • 填写商户姓名不要带有“超市”,“便利店” ,“百货”等
  • 扫码成为快钱代理
  • 扫码加站长微信,为您推荐快钱总部负责人
  • 快钱POSS机(电签版)
  • 1,免押版:签约费率快捷交易0.38%,常规交易0.65%
  • 贷记卡单笔≥3000元视为激活
  • 2,,有押版:签约快捷交易0.38%,常规交易0.65%
  • 激活首刷≥99元,扣除99元系统服务费,多出部分shishi到账
  • 电签版ipos参与每月扶持奖励
  • 电签版ipos与Mpos单独考核台均
  • 30台以上有效激活奖励3000元扶持金
  • 当月交易额≥3000元的为活跃用户

站点信息

  • 建站时间:2018-10-24
  • 网站程序:帝国CMS7.5
  • 主题模板《今夕何夕》
  • 文章统计7613篇文章
  • 标签管理标签云
  • 统计数据百度统计
  • 扫描二维码:请注明来意,否则不会通过
  • 微信号:扫描二维码,关注我们
歌名 - 歌手
0:00