【苹果CMS V10】整合文章视频输出,可用于一些数据流的输出
{php}$data_lista = array();$data_list = array();{/php}
{maccms:vod num="30" level="9,1" type="4" timehits="-3 month" paging="no" order="desc" by="hits_month"}
{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="10" paging="no" type="all" order="desc" by="time" cachetime='0'}
{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'];
{/php}
{/maccms:vod}
{maccms:art num="10" paging="no" type="all" order="desc" by="time" cachetime='0'}
{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'];
{/php}
{/maccms:art}
{php}
krsort($data_list);
dump($data_list);
{/php}
{volist name="data_list" id="vo" key="key" length='10'}
{if condition="$vo['vid']"}
这是视频输出----{$vo.time|mac_friend_date}{$vo.vid|mac_url='vod/detail',[],['vod_id'=>###]}<br>
{else /}
这是文章输出----{$vo.time|mac_friend_date}{$vo.aid|mac_url='art/detail',[],['art_id'=>###]}<br>
{/if}
{/volist}