bootstrap 幻灯大图结合dedecms的autoindex

复制代码
 1     <div class="container" id="banner">
 2   <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
 3   <!-- Indicators -->
 4 
 5 
 6   <!-- Wrapper for slides -->
 7   <div class="carousel-inner" role="listbox">
 8  {dede:arclist row='5'     flag ='h' orderby ='id'}
 9     <div class="item [field:global name=autoindex runphp="yes"]if(@me==1){@me='active';}else{@me='';}[/field:global]">
10      <a href="[field:arcurl/]"><img src="[field:litpic function='firstimg(@me)'/]"  width="1024px" alt="" ></a> 
11     </div>
12     {/dede:arclist}
13   </div>
14 </div>
15 
16     </div>
17     <div  class="smallpic container wrap">
18           <ol class="btns">
19  {dede:arclist row='5'     flag ='h' orderby ='id'}
20      <li data-target="#carousel-example-generic" data-slide-to="[field:global name=autoindex runphp="yes"]@me=@me-1;[/field:global]" >
21       <img src="[field:litpic/]" alt="" >
22     </li>
23     {/dede:arclist}
24 
25   </ol>
26     </div>
复制代码

缩略图提取第一张大图

1 //将缩放图转变为文章第一张图片 
2 function firstimg($str_pic) 
3 { 
4 $str_sub=substr($str_pic,0,-7).".jpg";//删除缩略图字符串最后七位,然后再补上后缀.jpg 
5 if(!file_exists($_SERVER['DOCUMENT_ROOT'].$str_sub)) $str_sub=$str_pic;
6 return $str_sub; 
7 }

织梦自增标签的笔记

autoindex   itemindex 的使用心得区别  

channelartlist 标签下使用 {dede:global name='itemindex' runphp='yes'}@me;{/dede:global}

自增1

arclist            标签下使用 [field:global.autoindex/] 默认从1开始
channel         标签下使用 [field:global.autoindex/] 默认从0开始
channelartlist 标签下使用 {dede:global.itemindex/}  默认从1开始

arclist  从0开始 [field:global name=autoindex runphp="yes"]@me=@me-1;[/field:global]

channel  从1开始 [field:global name=autoindex runphp="yes"]@me=@me+1;[/field:global][field:typename/]

channelartlist  从0开始 {dede:global name=itemindex runphp='yes'}@me=@me-1;{/dede:global}

posted @   闲云-野鹤  阅读(437)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 25岁的心里话
· 按钮权限的设计及实现
点击右上角即可分享
微信分享提示