苹果maccms把电影视频和文章通过数组结合输出,按最新时间排序
【苹果CMS V10】整合文章视频输出,可用于一些数据流的输出
分别循环输出视频和文章,然后把两者的数据结合起来归类为新的数组,然后通过数组按时间顺序输出内容
代码如下
{php}$data_lista = array();$data_list = array();{/php}
{maccms:vod num="40" type="all" order="desc" by="time"}
{php}
$data_lista[$vo['vod_id']] = strval($vo['vod_id']);
{/php}
{/maccms:vod}
{php}
shuffle($data_lista);
$data_listb = join(",",$data_lista );
dump($data_listb);
{/php}
{maccms:vod num="40" type="all" order="desc" by="time" }
{php}
//dump($vo);
$data_list[$vo['vod_time']]['vid'] = $vo['vod_id'];
$data_list[$vo['vod_time']]['type'] = $vo['type_id'];
$data_list[$vo['vod_time']]['title'] = $vo['vod_name'];
$data_list[$vo['vod_time']]['pic'] = $vo['vod_pic'];
$data_list[$vo['vod_time']]['content'] = mb_substr(trim($vo['vod_blurb'],PHP_EOL) ,0 , 100);
$data_list[$vo['vod_time']]['time'] = $vo['vod_time'];
$data_list[$vo['vod_time']]['hits'] = $vo['vod_hits'];
$data_list[$vo['vod_time']]['class'] = $vo['vod_class'];
{/php}
{/maccms:vod}
{maccms:art num="40" type="all" order="desc" by="time" }
{php}
//dump($vo);
$data_list[$vo['art_time']]['aid'] = $vo['art_id'];
$data_list[$vo['art_time']]['type'] = $vo['type_id'];
$data_list[$vo['art_time']]['title'] = $vo['art_name'];
$data_list[$vo['art_time']]['pic'] = $vo['art_pic'];
$data_list[$vo['art_time']]['content'] = mb_substr(trim(htmlspecialchars($vo['art_blurb']), PHP_EOL ) ,0 , 50);
$data_list[$vo['art_time']]['time'] = $vo['art_time'];
$data_list[$vo['art_time']]['hits'] = $vo['art_hits'];
$data_list[$vo['art_time']]['class'] = $vo['art_class'];
{/php}
{/maccms:art}
{php}
krsort($data_list);
dump($data_list);
{/php}
{volist name="data_list" id="vo" key="key" length='40'}
{if condition="$vo['vid']"}
{$vo.title}{$vo.content|mac_filter_html|mac_substring=100}{$vo.aid|mac_url='art/detail',[],['art_id'=>###]}" >{$vo.pic}{$vo.class}{$vo.hits}{$vo.time|mac_friend_date}
{else /}
{$vo.title}{$vo.content|mac_filter_html|mac_substring=100}{$vo.aid|mac_url='art/detail',[],['art_id'=>###]}" >{$vo.pic}{$vo.class}{$vo.hits}{$vo.time|mac_friend_date}
{/if}
{/volist}
苹果maccms把电影视频和文章通过数组结合输出,按最新时间排序
文章由官网发布,如若转载,请注明出处:https://www.veimoz.com/531
0 评论
4.9k
发表评论
热门文章
自媒体博客Spimes主题33w 阅读
Spimes主题专为博客、自媒体、资讯类的网站设计....
vCard主题个人简历主题13w 阅读
一款个人简历主题,可以简单搭建一下,具体也比较简单....
Splity博客双栏主题11w 阅读
仿制主题,Typecho博客主题,昼夜双版设计,可....
Spzac个人资讯下载类主题11w 阅读
用于作品展示、资源下载,行业垂直性网站、个人博客,....
热评文章
自媒体博客Spimes主题416 评论
Splity博客双栏主题187 评论
Spzac个人资讯下载类主题89 评论
Splinx博客图片主题35 评论
Spzhi知识付费社区主题34 评论
三栏清新博客S_blog主题30 评论
vCard主题个人简历主题29 评论
Pure轻简主题28 评论
54447454
10月31日
[已回复]
能重复在发一下吗,无法下载了