苹果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.h2sheji.com/art/60.html

给TA买糖
共{{data.count}}人
人已赞赏
网站建设

苹果cms自动采集解除时间间隔设置 100%有效的办法

2020-7-14 0:26:45

网站建设

wordpress后台用户排序改成注册时间排序教程与PHP源代码

2020-7-17 5:32:06

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索