# 視頻

  • 目錄 html/vod
  • 所屬模型 model('Vod')
  • 模型mid 5
  • 視頻標簽 {maccms:vod 參數1="值" 參數2="值" }...{/maccms:vod}

# 標簽參數

  • order 排列順序desc倒序,asc正序
  • by 排序依據 id,time,time_add,score,hits,hits_day,hits_week,hits_month,up,down,level,rnd
  • start 從第幾條開始
  • num 獲取條數
  • ids 指定1,2,3一組ID;
  • not 不抱含id 多個逗號鏈接
  • type 指定獲取分類數據 all所有;1,2,3指定;
  • class 指定某擴展分類 支持多個 動作,喜劇
  • tag 指定tag 支持多個 aaa,xxx
  • level 指定推薦值 支持多個 1,2
  • area 指定地區 支持多個 大陸,香港
  • lang 指定語言 支持多個 國語,粵語
  • year 指定年代 支持多個 2002,2003
  • state 資源類別 支持多個 高清版,劇場版,搶先版
  • version 資源版本 支持多個 正片,預告片
  • weekday 更新周期 支持多個 一,二,三
  • rel 指定關聯數據 1,2,3 或 變形金剛
  • timeadd 添加時間 一天前 -1 day,一周前-1 week,一月前-1 month,一小時前-1 hour
  • timehits 點擊時間 一天前 -1 day,一周前-1 week,一月前-1 month,一小時前-1 hour
  • time 更新時間 一天前 -1 day,一周前-1 week,一月前-1 month,一小時前-1 hour
  • hitsmonth 月點擊量 大於一千 gt 1000, 小於一千 lt 1000,區間一千二千之間 between 1000,2000
  • hitsweek 周點擊量 大於一千 gt 1000, 小於一千 lt 1000,區間一千二千之間 between 1000,2000
  • hitsday日點擊量 大於一千 gt 1000, 小於一千 lt 1000,區間一千二千之間 between 1000,2000
  • hits 總點擊量 大於一千 gt 1000, 小於一千 lt 1000,區間一千二千之間 between 1000,2000
  • paging 是否分頁yes
  • pageurl 分頁地址
  • cachetime 自定義緩存時間單位秒
  • isend是否連載完畢 0,1
  • plot是否包含分集劇情 0,1
  • 使用示例:
{maccms:vod type="all" by="time" num="10" order="desc"}
   <img src="{$vo.vod_pic|mac_url_img}"/>
   <h5>{$vo.vod_name}</h5>
    <!-- 更多內部標簽字段請參考視 視頻字段 以$vo.開頭即可 -->
{/maccms:vod}
1
2
3
4
5

# 視頻字段

在使用maccms:vod標簽獲取視頻列表時可以使用 數據表mac_vod裏的全部字段,並且在視頻詳情視頻播放視頻下載頁 一樣支持全字調用。

使用差異

  • maccms:vod 內部使用字段默認以 $vo 開頭, 如影片名稱 {$vo.vod_name}
  • 在 詳情頁、播放頁和下載頁使用 $obj 開頭,如影片名稱 {$obj.vod_name}
<!-- 視頻字段 -->

{$obj.vod_id} 視頻id
{$obj.type_id} 分類id
{$obj.type_id_1} 一級分類id
{$obj.type} 分類對象,二級屬性可參考分類屬性
{$obj.type.type_name} 分類名
{$obj.type.type_en} 分類拼音
{$obj.type_1} 一級分類對象,二級屬性可參考分類屬性
{$obj.type_1.type_name} 一級分類名
{$obj.type_1.type_en} 一級分類拼音
{$obj.group_id} 用戶組id
{$obj.vod_name} 視頻名
{$obj.vod_sub} 副標題
{$obj.vod_en} 別名
{$obj.vod_status} 狀態0未審1已審
{$obj.vod_letter} 首字母
{$obj.vod_color} 顏色
{$obj.vod_tag} tags 
{$obj.vod_class} 擴展分類
{$obj.vod_pic} 圖片
{$obj.vod_pic_thumb} 縮略圖
{$obj.vod_pic_slide} 幻燈圖
{$obj.vod_pic_screenshot}截圖多個圖片用$$$連接
{$obj.vod_actor} 主演
{$obj.vod_director} 導演
{$obj.vod_writer}編劇
{$obj.vod_behind}幕後
{$obj.vod_blurb} 簡介
{$obj.vod_remarks} 備註
{$obj.vod_pubdate}上映日期
{$obj.vod_total} 總集數
{$obj.vod_serial} 連載數
{$obj.vod_tv} 上映電視臺
{$obj.vod_weekday} 節目周期
{$obj.vod_area} 地區
{$obj.vod_lang} 語言
{$obj.vod_year} 年代
{$obj.vod_version} 版本-dvd,hd,720p
{$obj.vod_state} 資源類別-正片,預告片,花絮
{$obj.vod_author} 編輯人員
{$obj.vod_jumpurl} 跳轉url
{$obj.vod_tpl} 獨立模板
{$obj.vod_tpl_play} 獨立播放頁模板
{$obj.vod_tpl_down} 獨立下載頁模板
{$obj.vod_isend} 是否完結
{$obj.vod_lock} 鎖定1
{$obj.vod_level} 推薦級別
{$obj.vod_points} 訪問整個視頻所需積分
{$obj.vod_points_play} 每集點播付費
{$obj.vod_points_down} 每集下載付費
{$obj.vod_hits} 總點擊量
{$obj.vod_hits_day} 日點擊量
{$obj.vod_hits_week} 周點擊量
{$obj.vod_hits_month} 月點擊量
{$obj.vod_duration} 時長
{$obj.vod_up} 頂數
{$obj.vod_down} 踩數
{$obj.vod_douban_score} 豆瓣評分
{$obj.vod_douban_id} 豆瓣ID
{$obj.vod_score} 平均分
{$obj.vod_score_all} 總評分
{$obj.vod_score_num} 評分次數
{$obj.vod_time} 更新時間
{$obj.vod_time_add} 添加時間
{$obj.vod_time_hits} 點擊時間
{$obj.vod_time_make} 生成時間
{$obj.vod_trysee} 試看時長分
{$obj.vod_reurl} 來源地址
{$obj.vod_rel_vod} 關聯視頻ids
{$obj.vod_rel_art} 關聯文章ids
{$obj.vod_content} 詳細介紹
{$obj.vod_pwd} 訪問內容頁密碼
{$obj.vod_pwd_url} 獲取密碼鏈接
{$obj.vod_pwd_play} 訪問播放頁密碼
{$obj.vod_pwd_play_url} 獲取密碼鏈接
{$obj.vod_pwd_down} 訪問下載頁密碼
{$obj.vod_pwd_down_url} 獲取密碼鏈接
{$obj.vod_copyright} 是否開啟版權提示
{$obj.vod_play_from} 播放組
{$obj.vod_play_server} 播放服務器組
{$obj.vod_play_note} 播放備註
{$obj.vod_play_url} 播放地址
{$obj.vod_down_from} 下載租
{$obj.vod_down_server} 下載服務器組
{$obj.vod_down_note} 下載備註
{$obj.vod_down_url} 下載地址
{$obj.vod_plot} 是否包含分集劇情
{$obj.vod_plot_name} 分集劇情名稱
{$obj.vod_plot_detail} 分集劇情詳情

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91

# 常用函數

{:mac_url_vod_detail($obj)}  視頻詳情頁鏈接
{:mac_url_vod_play($obj,['sid'=>1,'nid'=>1])}   視頻播放頁鏈接
{:mac_url_vod_play($obj,'first')}   視頻播放頁第一條鏈接
{:mac_url_vod_down($obj,['sid'=>1,'nid'=>1])}   視頻下載頁鏈接
{:mac_url_vod_down($obj,'first')}   視頻下載頁第一條鏈接
{$obj.vod_content|mac_url_content_img} 影片詳情介紹

1
2
3
4
5
6
7

# 視頻首頁

這個頁面模板一般情況很少用到,只是為了滿足個別大型站點需要分獨立主頁時用到。

  • 文件目錄 html/vod/index.html
  • 頁面aid值 10

# 視頻分類

  • 文件目錄 html/vod/type.html
  • 頁面aid值 11
  • 當前分類數組 $obj,
  • 詳細字段參考- 【分類字段】

# 獲取當前分類列表示例

<!-- 列表 -->
{maccms:vod num="24" paging="yes" type="current" order="desc" by="time"}
 <li><a href="{:mac_url_vod_detail($vo)}" title="{$vo.vod_name}">
    <img src="{:mac_url_img($vo.vod_pic)}" alt="{$vo.vod_name}"/>
    <h2>{$vo.vod_name}</h2>
    <p>{$vo.vod_actor}</p>
    <i>{$vo.vod_version}</i>
</a></li>
{/maccms:vod}



1
2
3
4
5
6
7
8
9
10
11
12

# 視頻篩選

  • 文件目錄 html/vod/show.html
  • 頁面aid值 12
  • 當前分類數組 $obj
  • 詳細字段參考- 【分類字段】
  • 可傳URL參數
參數 示例值 必有參數 參數說明
id 1 分類id
area 大陸 地區篩選
lang 國語 語言篩選
year 2019 年份篩選
level 9 推薦值篩選
letter A 首字母篩選
state 1 審核狀態篩選
tag 國產大片 tag篩選
class 科幻片 擴展分類,類型篩選
order desc 倒序正序篩選
by
time
排序依據篩選:默認支持:id, time,time_add,score,hits,hits_day,hits_week,hits_month,up,down,level,rnd,in
  • 請求url帶參數示例
/index.php/vodshow/1/area/大陸/by/time/class/科幻/lang/國語/letter/A/year/2020.html
1
  • 接受參數
  • $param 數組,html 模板 標簽為 {$param},例如:獲取當前的篩選的地區 {$param['area']}
  • 常用篩選示例代碼
<!-- 篩選條件 -->
<div class="ui-box filter-focus">
    <div class="ui-title"><h3>{$obj.type_name} - 高級搜索</h3></div>
    <div class="ui-cnt">
        <div class="filter-list fn-clear">
            <h5>類型:</h5>
            <ul>
                <li><a {if condition="$param['class'] eq ''"} class="current" {/if} href="{:mac_url_type($obj,['area'=>$param['area'],'lang'=>$param['lang'],'year'=>$param['year'],'level'=>$param['level'],'letter'=>$param['letter'],'state'=>$param['state'],'tag'=>$param['tag'],'class'=>'','order'=>$param['order'],'by'=>$param['by'] ],'show')}">全部</a></li>
                {empty name="$obj.type_extend.area"}
                {maccms:foreach name=":explode(',',$obj.parent.type_extend.class)" id="vo2" key="key2"}
                <li><a {if condition="$param['class'] eq $vo2"} class="current" {/if} href="{:mac_url_type($obj,['area'=>$param['area'],'lang'=>$param['lang'],'year'=>$param['year'],'level'=>$param['level'],'letter'=>$param['letter'],'state'=>$param['state'],'tag'=>$param['tag'],'class'=>$vo2,'order'=>$param['order'],'by'=>$param['by'] ],'show')}">{$vo2}</a></li>
                {/maccms:foreach}
                {else /}
                {maccms:foreach name=":explode(',',$obj.type_extend.class)" id="vo2" key="key2"}
                <li><a {if condition="$param['class'] eq $vo2"} class="current" {/if} href="{:mac_url_type($obj,['area'=>$param['area'],'lang'=>$param['lang'],'year'=>$param['year'],'level'=>$param['level'],'letter'=>$param['letter'],'state'=>$param['state'],'tag'=>$param['tag'],'class'=>$vo2,'order'=>$param['order'],'by'=>$param['by'] ],'show')}">{$vo2}</a></li>
                {/maccms:foreach}
                {/empty}
            </ul>
        </div>
        <div class="filter-list fn-clear">
            <h5>地區:</h5>
            <ul>
                <li><a {if condition="$param['area'] eq ''"} class="current" {/if} href="{:mac_url_type($obj,['area'=>'','lang'=>$param['lang'],'year'=>$param['year'],'level'=>$param['level'],'letter'=>$param['letter'],'state'=>$param['state'],'tag'=>$param['tag'],'class'=>$param['class'],'order'=>$param['order'],'by'=>$param['by'] ],'show')}">全部</a></li>
                {empty name="$obj.type_extend.area"}
                    {maccms:foreach name=":explode(',',$obj.parent.type_extend.area)" id="vo2" key="key2"}
                    <li><a {if condition="$param['area'] eq $vo2"} class="current" {/if} href="{:mac_url_type($obj,['area'=>$vo2,'lang'=>$param['lang'],'year'=>$param['year'],'level'=>$param['level'],'letter'=>$param['letter'],'state'=>$param['state'],'tag'=>$param['tag'],'class'=>$param['class'],'order'=>$param['order'],'by'=>$param['by'] ],'show')}">{$vo2}</a></li>
                    {/maccms:foreach}
                {else /}
                    {maccms:foreach name=":explode(',',$obj.type_extend.area)" id="vo2" key="key2"}
                    <li><a {if condition="$param['area'] eq $vo2"} class="current" {/if} href="{:mac_url_type($obj,['area'=>$vo2,'lang'=>$param['lang'],'year'=>$param['year'],'level'=>$param['level'],'letter'=>$param['letter'],'state'=>$param['state'],'tag'=>$param['tag'],'class'=>$param['class'],'order'=>$param['order'],'by'=>$param['by'] ],'show')}">{$vo2}</a></li>
                    {/maccms:foreach}
                {/empty}
            </ul>
        </div>
        <div class="filter-list fn-clear">
            <h5>語言:</h5>
            <ul>
                <li><a {if condition="$param['lang'] eq ''"} class="current" {/if} href="{:mac_url_type($obj,['area'=>$param['area'],'lang'=>'','year'=>$param['year'],'level'=>$param['level'],'letter'=>$param['letter'],'state'=>$param['state'],'tag'=>$param['tag'],'class'=>$param['class'],'order'=>$param['order'],'by'=>$param['by'] ],'show')}">全部</a></li>
                {empty name="$obj.type_extend.lang"}
                    {maccms:foreach name=":explode(',',$obj.parent.type_extend.lang)" id="vo2" key="key2"}
                    <li><a {if condition="$param['area'] eq $vo2"} class="current" {/if} href="{:mac_url_type($obj,['area'=>$param['area'],'lang'=>$vo2,'year'=>$param['year'],'level'=>$param['level'],'letter'=>$param['letter'],'state'=>$param['state'],'tag'=>$param['tag'],'class'=>$param['class'],'order'=>$param['order'],'by'=>$param['by'] ],'show')}">{$vo2}</a></li>
                    {/maccms:foreach}
                {else /}
                    {maccms:foreach name=":explode(',',$obj.type_extend.lang)" id="vo2" key="key2"}
                    <li><a {if condition="$param['lang'] eq $vo2"} class="current" {/if} href="{:mac_url_type($obj,['area'=>$param['area'],'lang'=>$vo2,'year'=>$param['year'],'level'=>$param['level'],'letter'=>$param['letter'],'state'=>$param['state'],'tag'=>$param['tag'],'class'=>$param['class'],'order'=>$param['order'],'by'=>$param['by'] ],'show')}">{$vo2}</a></li>
                    {/maccms:foreach}
                {/empty}
            </ul>
        </div>
        <div class="filter-list fn-clear">
            <h5>年代:</h5>
            <ul>
                <li><a {if condition="$param['year'] eq ''"} class="current"{/if} href="{:mac_url_type($obj,['area'=>$param['area'],'lang'=>$param['lang'],'year'=>'','level'=>$param['level'],'letter'=>$param['letter'],'state'=>$param['state'],'tag'=>$param['tag'],'class'=>$param['class'],'order'=>$param['order'],'by'=>$param['by'] ],'show')}">全部</a></li>
                {empty name="$obj.type_extend.year"}
                    {maccms:foreach name=":explode(',',$obj.parent.type_extend.year)" id="vo2" key="key2"}
                    <li><a {if condition="$param['area'] eq $vo2"} class="current" {/if} href="{:mac_url_type($obj,['area'=>$param['area'],'lang'=>$param['lang'],'year'=>$vo2,'level'=>$param['level'],'letter'=>$param['letter'],'state'=>$param['state'],'tag'=>$param['tag'],'class'=>$param['class'],'order'=>$param['order'],'by'=>$param['by'] ],'show')}">{$vo2}</a></li>
                    {/maccms:foreach}
                {else /}
                    {maccms:foreach name=":explode(',',$obj.type_extend.year)" id="vo2" key="key2"}
                    <li><a {if condition="$param['year'] eq $vo2"} class="current" {/if} href="{:mac_url_type($obj,['area'=>$param['area'],'lang'=>$param['lang'],'year'=>$vo2,'level'=>$param['level'],'letter'=>$param['letter'],'state'=>$param['state'],'tag'=>$param['tag'],'class'=>$param['class'],'order'=>$param['order'],'by'=>$param['by'] ],'show')}">{$vo2}</a></li>
                    {/maccms:foreach}
                {/empty}
            </ul>
        </div>
        <div class="filter-list filter-list-letter fn-clear">
            <h5>字母:</h5>
            <ul>
                <li><a  {if condition="$param['letter'] eq ''"} class="current"{/if} href="{:mac_url_type($obj,['area'=>$param['area'],'lang'=>$param['lang'],'year'=>$param['year'],'level'=>$param['level'],'letter'=>'','state'=>$param['state'],'tag'=>$param['tag'],'class'=>$param['class'],'order'=>$param['order'],'by'=>$param['by'] ],'show')}">全部</a></li>
                {maccms:foreach name=":explode(',','A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,0~9')" id="vo2" key="key2"}
                <li><a {if condition="$param['letter'] eq $vo2"} class="current"{/if} {/if} href="{:mac_url_type($obj,['area'=>$param['area'],'lang'=>$param['lang'],'year'=>$param['year'],'level'=>$param['level'],'letter'=>$vo2,'state'=>$param['state'],'tag'=>$param['tag'],'class'=>$param['class'],'order'=>$param['order'],'by'=>$param['by'] ],'show')}">{$vo2}</a><li>
                {/maccms:foreach}
            </ul>
        </div>
    </div>
</div>
<!-- 排序方式 -->
<div class=" fn-clear">
    <div class="view-filter">
        <a href="{:mac_url_type($obj,['area'=>$param['area'],'lang'=>$param['lang'],'year'=>$param['year'],'level'=>$param['level'],'letter'=>$param['letter'],'state'=>$param['state'],'tag'=>$param['tag'],'class'=>$param['class'],'order'=>$param['order'],'by'=>'time' ],'show')}" class="order {if condition="$param.by eq '' || $param.by eq 'time'"}current{/if}">按時間</a>
        <a href="{:mac_url_type($obj,['area'=>$param['area'],'lang'=>$param['lang'],'year'=>$param['year'],'level'=>$param['level'],'letter'=>$param['letter'],'state'=>$param['state'],'tag'=>$param['tag'],'class'=>$param['class'],'order'=>$param['order'],'by'=>'hits' ],'show')}" class="order {if condition="$param.by eq 'hits'"}current{/if}">按人氣</a>
        <a href="{:mac_url_type($obj,['area'=>$param['area'],'lang'=>$param['lang'],'year'=>$param['year'],'level'=>$param['level'],'letter'=>$param['letter'],'state'=>$param['state'],'tag'=>$param['tag'],'class'=>$param['class'],'order'=>$param['order'],'by'=>'score' ],'show')}" class="order {if condition="$param.by eq 'score'"}current{/if}">按評分</a>
    </div>
</div>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
  • 當前篩選結果列表獲取
<!-- 篩選結果列表 -->
 {maccms:vod num="20" paging="yes" pageurl="vod/show" type="current" order="desc" by="time"}
   <li><a href="{:mac_url_vod_detail($vo)}" title="{$vo.vod_name}">
      <img src="{:mac_url_img($vo.vod_pic)}" alt="{$vo.vod_name}"/>
      <h2>{$vo.vod_name}</h2>
      <p>{$vo.vod_actor}</p>
      <i>{$vo.vod_remarks}</i>
   </a></li>
{/maccms:vod}
<!-- 通用分頁代碼 -->
1
2
3
4
5
6
7
8
9
10

# 視頻搜索

  • 文件目錄 html/vod/search.html
  • 頁面aid值 13
  • 可調用變量
參數 示例值 必有參數 參數說明
wd 1 關鍵詞
area 大陸 搜索地區
lang 國語 搜索語言
year 2019 搜索年代
tag 國產大片 搜索標簽
class 科幻片 搜搜類型
  • 搜索url帶參數示例
index.php/vodsearch/變形金剛-------------.html
1
  • 接受參數
  • $param 數組,html 模板 標簽為 {$param},例如:獲取當前的搜索關鍵詞 {$param['wd']}
  • 搜索表單示例
<!-- 表單 -->
<form id="search" name="search" method="get" action="{:mac_url('vod/search')}" onSubmit="return qrsearch();">
   <input type="text" name="wd" class="mac_wd" value="{$param.wd}" placeholder="請在此處輸入影片名或演員名稱" />
   <input type="submit" class="mac_search" value="搜索影片" />
</form>
<!-- 後臺預設關鍵詞 -->
 <div class="hotkeys">熱搜:
   {maccms:foreach name=":explode(',',$maccms.search_hot)" id="vo2" key="key2"}
   <a href="{:mac_url('vod/search',['wd'=>$vo2])}">{$vo2}</a>
   {/maccms:foreach}
</div>
1
2
3
4
5
6
7
8
9
10
11

# 視頻詳情

  • 文件目錄 html/vod/detail.html
  • 頁面aid值 14
  • 當前影片數組 $obj
  • 必帶參 id

提示

影片數據在詳情頁全字段輸出 到 {$obj} 數組,如下查詢全部字段 可以參考 視頻字段,或者在模板用{:print_r($obj)}打印當前影片全部數據,其他如播放地址或劇情等等需要用函數處理並且遍歷處相列表。

# 詳情常用示例

  • 多個截圖獲取調用例子
{notempty name="$obj.vod_pic_screenshot"}
{volist name=":explode('$$$',$obj.vod_pic_screenshot);" id="vo2"}
    <img src="{:mac_url_img($vo2)}" >
{/volist}
{/notempty}
1
2
3
4
5
  • 視頻播放地址和下載地址標簽
<!-- 播放 -->
{maccms:foreach name="obj.vod_play_list" id="vo"}
<div class="ui-box marg" id="playlist_1">
    <div class="down-title">
        <h2>{$vo.from}-在線播放</h2><span>[{$vo.player_info.tip}]</span>
    </div>
    <div class="video_list fn-clear">
        {maccms:foreach name="vo.urls" id="vo2"}
        <a href="{:mac_url_vod_play($obj,['sid'=>$vo.sid,'nid'=>$vo2.nid])}" >{$vo2.name}</a>
        {/maccms:foreach}
    </div>
</div>
{/maccms:foreach}
<!-- 下載 -->
{maccms:foreach name="obj.vod_down_list" id="vo"}
<div class="ui-box marg" id="downlist_1">
    <div class="down-title">
        <h2>{$vo.from}-下載</h2><span>[{$vo.player_info.tip}]</span>
    </div>
    <div class="video_list fn-clear">
        {maccms:foreach name="vo.urls" id="vo2"}
        <a href="{:mac_url_vod_down($obj,['sid'=>$vo.sid,'nid'=>$vo2.nid])}" >{$vo2.name}</a>
        {/maccms:foreach}
    </div>
</div>
{/maccms:foreach}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

# 視頻播放

  • 文件目錄 html/vod/play.html
  • 頁面aid值 15
  • 當前影片數組 $obj
  • 必帶參 id

提示

播放頁和詳情頁一樣數有當前影片的 {$obj} 數組,如下查詢全部字段 可以參考 視頻字段,或者在模板用{:print_r($obj)}打印當前影片全部數據,其他如播放地址或劇情等等需要用函數處理並且遍歷處相列表。

參數 示例值 必有參數 參數說明
id 1 影片id
nid 1 當前播放組id
aid 1 當前集數id

# 播放頁獨有標簽

=======視頻播放頁獨有標簽=======
{$param.sid} 當前播放組序號
{$param.nid} 當前集數序號

{$obj.player_info.link_next} 下一頁地址,最後一頁時此鏈接將當前頁鏈接
{$obj.player_info.link_pre} 上一頁地址,第一頁時此鏈接將當前頁鏈接

{$obj['vod_play_list'][$param['sid']]} 獲取當前播放組數據
{$obj['vod_play_list'][$param['sid']]['player_info']}  播放器信息
{$obj['vod_play_list'][$param['sid']]['server_info']}  服務器組信息
{$obj['vod_play_list'][$param['sid']]['url_count']} 總集數
{$obj['vod_play_list'][$param['sid']]['urls']} 集數信息
{$obj['vod_play_list'][$param['sid']]['urls'][$param['nid']]} 當前集數信息
{$obj['vod_play_list'][$param['sid']]['urls'][$param['nid']]['name']} 當前集數名稱
{$obj['vod_play_list'][$param['sid']]['urls'][$param['nid']]['url']} 當前集數url
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
  • 下載頁獲取以上信息,請把vod_play_list改為vod_down_list,其他參數不變

# 調出播放器

  • 需要下面兩個標簽缺一不可
{$player_data} 播放數據
{$player_js} 加載播放器
1
2

# 獲取與當前視頻相關聯視頻和關聯文章數據

<h2><strong>“{$obj.vod_name}”</strong>關聯的視頻</h2>
<ul class="img-list dis">
    {maccms:vod num="6" ids="'.$obj['vod_rel_vod'].'" order="desc" by="time"}
        <li><a href="{:mac_url_vod_detail($vo)}" title="{$vo.vod_name}"><img src="{:mac_url_img($vo.vod_pic)}" alt="{$vo.vod_name}"/><h2>{$vo.vod_name}</h2><p></p><i>{$vo.vod_version}</i><em></em></a></li>
    {/maccms:vod}
</ul>
<h2><strong>“{$obj.vod_name}”</strong>關聯的文章</h2>
<ul class="img-list dis">
    {maccms:art num="6" ids="'.$obj['vod_rel_art'].'" order="desc" by="time"}
        <li><a href="{:mac_url_art_detail($vo)}" title="{$vo.art_name}"><img src="{:mac_url_img($vo.art_pic)}" alt="{$vo.art_name}"/><h2>{$vo.art_name}</h2><p></p><i>{$vo.vod_from}</i><em></em></a></li>
    {/maccms:art}
</ul>
1
2
3
4
5
6
7
8
9
10
11
12

# 版權跳轉

  • 配合後臺提供的跳轉url字段,在內容頁播放頁通用。
<script>
    {if condition="$obj.vod_jumpurl neq ''"}
        location.href='{$obj.vod_jumpurl}';
    {/if}
</script>
1
2
3
4
5
  • 如果想判斷每集是否跳轉,可把要跳轉的集數地址寫成固定的格式,方便讀取和操作。
  • 比如火影忍者有10集, 第2集版權跳轉,地址寫為jump://baidu.com
  • 在播放頁加入代碼 只跳轉這一集
<script>
    {if condition="strpos($obj['vod_play_list'][$param['sid']]['urls'][$param['nid']]['url'],'jump:')!==false "}
        location.href='{$obj['vod_play_list'][$param['sid']]['urls'][$param['nid']]['url']|str_replace="jump:","http:",###}';
    {/if}
</script>
1
2
3
4
5

# iframe播放器

這個嵌入iframe 播放器頁面只會在後臺開啟收費試看模式才會啟用.

  • 文件目錄 html/vod/player.html
  • 頁面aid值
  • 支持當前影片數組
  • 參數基本上和播放頁一致,同樣需要 {$player_data}{$player_js}兩個標簽來輸出播放器。
  • 代碼實例
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
    <title>iframe播放器</title>
    <style>*{word-wrap:break-word;outline:none} html,body{width:100%;height:100%;background:#000;color:#fff;}
    .player_popeom{ width:500px;height:150px; position:absolute;text-align:center; top:50%;left:50%;margin:-75px 0 0 -250px; }
    .player_popeom a{  padding: 10px 16px;
        font-size: 18px;
        line-height: 1.3333333;
        border-radius: 6px; color: #fff;  background-color: #5cb85c;  border-color: #4cae4c;  }
    </style>
    <script src="{$maccms.path}static/js/jquery.js"></script>
    <script>var maccms={"path":"__ROOT__","mid":"{$maccms['mid']}","url":"{$maccms['site_url']}","wapurl":"{$maccms['site_wapurl']}","mob_status":"{$maccms['mob_status']}"};</script>
</head>
<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">
{$player_data}
{$player_js}
{if condition="$popedom.code gt 1"/}
<div class="player_showtry" style="display:none;">
    <div class="player_box">
        <div class="player_popeom">
            {if condition="$obj.vod_points_play eq 0"}
            <p>試看{$popedom.trysee}分鐘結束,完整觀看本影片需要升級會員組,請升級後觀看。</p>
            <small>提示:購買VIP會員組,享受超級權限,謝謝支持。</small>
            <p><a href="{:url('user/index')}" target="_blank">會員中心</a> <a href="{:url('user/upgrade')}" target="_blank">馬上升級</a></p>
            {else/}
            <p>試看{$popedom.trysee}分鐘結束,完整觀看本影片需要花費{$obj.vod_points_play}積分,請支付後觀看。</p>
            <small>提示:一次支付,永久觀看,不重復扣費,謝謝支持。</small>

            {if condition="$user.group.group_id eq 1"}
                <p><a href="{:url('user/login')}" target="_blank">馬上登錄</a></p>
            {else/}
                <p><a href="{:url('user/buy')}" target="_blank">馬上充值</a> <a href="javascript:;" onclick="window.parent.MAC.User.BuyPopedom(this)" data-id="{$obj.vod_id}" data-sid="{$param.sid}" data-nid="{$param.nid}" data-type="4" data-mid="1">確認購買</a></p>
            {/if}
            {/if}

        </div>
    </div>
</div>
<script>
    //方式一本頁面計算
     window.setTimeout(function(){
     $('.MacPlayer').html( $('.player_showtry').html() );
     },1000*60*{$popedom.trysee});

    //方式二調用父頁面公共函數庫
    //window.parent.MAC.User.PopedomCallBack({$popedom.trysee},$('.player_showtry').html() );
</script>
{/if}


</body>
</html>


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57

# 視頻下載

  • 文件目錄 html/vod/play.html
  • 頁面aid值 16
  • 後端輸出數組 $obj
  • 必帶參 id

提示

和播放頁參數完全一致,僅僅為了劈開一個頁面作為下載而已,只是這個頁面對 vod_down_list數組進行單獨處理,其他參數不變。

# iframe下載器

  • 用法和iframe播放器完全一致,只是對下載付費配置單獨處理。
  • 代碼實例
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
    <title>iframe下載器</title>
    <style>*{word-wrap:break-word;outline:none} html,body{width:100%;height:100%;background:#000;color:#fff;}
    .player_popeom{ width:500px;height:150px; position:absolute;text-align:center; top:50%;left:50%;margin:-75px 0 0 -250px; }
    .player_popeom a{  padding: 10px 16px;
        font-size: 18px;
        line-height: 1.3333333;
        border-radius: 6px; color: #fff;  background-color: #5cb85c;  border-color: #4cae4c;  }
    </style>
    <script src="{$maccms.path}static/js/jquery.js"></script>
    <script>var maccms={"path":"__ROOT__","mid":"{$maccms['mid']}","url":"{$maccms['site_url']}","wapurl":"{$maccms['site_wapurl']}","mob_status":"{$maccms['mob_status']}"};</script>
</head>
<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">
{$player_data}
{$player_js}
{if condition="$popedom.code gt 1"/}
<div class="player_showtry" style="display:none;">
    <div class="player_box">
        <div class="player_popeom">
            {if condition="$obj.vod_points_down eq 0"}
            <p>試看{$popedom.trysee}分鐘結束,完整觀看本影片需要升級會員組,請升級後觀看。</p>
            <small>提示:購買VIP會員組,享受超級權限,謝謝支持。</small>
            <p><a href="{:url('user/index')}" target="_blank">會員中心</a> <a href="{:url('user/upgrade')}" target="_blank">馬上升級</a></p>
            {else/}
            <p>試看{$popedom.trysee}分鐘結束,完整觀看本影片需要花費{$obj.vod_points_down}積分,請支付後觀看。</p>
            <small>提示:一次支付,永久觀看,不重復扣費,謝謝支持。</small>

            {if condition="$user.group.group_id eq 1"}
                <p><a href="{:url('user/login')}" target="_blank">馬上登錄</a></p>
            {else/}
                <p><a href="{:url('user/buy')}" target="_blank">馬上充值</a> <a href="javascript:;" onclick="window.parent.MAC.User.BuyPopedom(this)" data-id="{$obj.vod_id}" data-sid="{$param.sid}" data-nid="{$param.nid}" data-type="5">確認購買</a></p>
            {/if}
            {/if}
        </div>
    </div>
</div>
<script>
    //方式一本頁面計算
     window.setTimeout(function(){
     $('.MacPlayer').html( $('.player_showtry').html() );
     },1000*60*{$popedom.trysee});
    //方式二調用父頁面公共函數庫
    //window.parent.MAC.User.PopedomCallBack({$popedom.trysee},$('.player_showtry').html() );
</script>
{/if}
</body>
</html>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52

# 分集劇情

  • 文件目錄 html/vod/plot.html
  • 頁面aid值 16
  • 後端輸出數組 $obj
  • 必帶參 id

# 影片角色

  • 文件目錄 html/vod/role.html
  • 頁面aid值 16
  • 後端輸出數組 $obj
  • 必帶參 id

# 相關提示

  • 購買權限提示 html/vod/confirm.html
  • 示例
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>使用積分購買權限</title>
	<link rel="stylesheet" href="__STATIC__/css/home.css">
	<style>
		body{background:#F9FAFD;color:#818181;}
		.text a{  padding: 10px 16px;
			font-size: 18px;
			line-height: 1.3333333;
			border-radius: 6px; color: #fff;  background-color: #5cb85c;  border-color: #4cae4c;  }
	</style>
	<script src="{$maccms.path}static/js/jquery.js"></script>
	<script>var maccms={"path":"__ROOT__","mid":"{$maccms['mid']}","url":"{$maccms['site_url']}","wapurl":"{$maccms['site_wapurl']}","mob_status":"{$maccms['mob_status']}"};</script>
	<script src="{$maccms.path}static/js/home.js"></script>
</head>
<body>
<div class="mac_msg_jump">
	<div class="msg_jump_tit">系統提示:</div>
	<div class="title">親愛的用戶:</div>
	<div class="text">
		{$popedom.msg}
		<p>提示:一次支付,永久觀看,不重復扣費,謝謝支持。</p>
		<p>
			{if condition="$user.group.group_id eq 1"}
			<a href="javascript:;" class="mac_user" target="_blank">馬上登錄</a>
			{else/}
			<a href="{:url('user/buy')}" target="_blank">馬上充值</a>
			<a href="javascript:;" onclick="MAC.User.BuyPopedom(this)" data-id="{$obj.vod_id}" data-sid="{$param.sid}" data-nid="{$param.nid}" data-mid="1" data-type="{if condition="$obj.player_info.flag eq 'play'"}4{else/}5{/if}" data-mid="1">確認購買</a>
			{/if}
		</p>
	</div>
</div>
<script type="text/javascript">

</script>
</body>
</html>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
  • 版權提示 html/vod/copyright.html
  • 示例
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
    <title>系統提示【{$obj['vod_name']}】因為版權問題,本站不提供在線播放</title>
    <link rel="stylesheet" href="__STATIC__/css/home.css">
    <style>
        body{background:#F9FAFD;color:#818181;}
    </style>
</head>
<body>
<div class="mac_msg_jump">
    <div class="msg_jump_tit">系統提示...</div>
    <div class="title">親愛的用戶:</div>
    <div class="text">【{$obj['vod_name']}】{$GLOBALS['config']['app']['copyright_notice']}</div>
    <div class="jump">
        {if condition="$obj['vod_jumpurl'] neq ''"}
        頁面自動 <a id="href" href="<?php echo($obj['vod_jumpurl']);?>">跳轉</a> 等待時間: <b id="wait">3</b>
        {/if}
    </div>
    <!-- 可自定義該頁面的顯示方式,可加入廣告 -->
</div>
<script type="text/javascript">
    {if condition="$obj['vod_jumpurl'] neq ''"}
    (function(){
        var wait = document.getElementById('wait'),
            href = document.getElementById('href').href;
        var interval = setInterval(function(){
            var time = --wait.innerHTML;
            if(time <= 0) {
                top.location.href = href;
                clearInterval(interval);
            };
        }, 1000);
    })();
    {/if}
</script>
</body>
</html>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
  • 詳情頁訪問密碼提示 html/vod/detail_pwd.html
  • 示例
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
    <title>系統提示......</title>
    <link rel="stylesheet" href="__STATIC__/css/home.css">
    <style>
        body{background:#F9FAFD;color:#818181}
        input{border:1px solid #ccc;padding:7px 0;border-radius:3px;padding-left:5px}
        .item{line-height:50px}
        .submit_btn{width:70px;height:40px;border-width:0;padding:10px;display:border-radius: 3px;background:#1E90FF;cursor:pointer;font-family:Microsoft YaHei;color:#fff;font-size:17px}
    </style>
    <script src="{$maccms.path}static/js/jquery.js"></script>
    <script>var maccms={"path":"__ROOT__","mid":"{$maccms['mid']}","url":"{$maccms['site_url']}","wapurl":"{$maccms['site_wapurl']}","mob_status":"{$maccms['mob_status']}"};</script>
    <script src="{$maccms.path}static/js/home.js"></script>
</head>
<body>
<div class="mac_msg_jump">
    <div class="msg_jump_tit">系統提示...</div>
    <div class="title">親愛的訪問此數據需要密碼哦~~~</div>
    <div class="text">
        <form id="form1" name="form1" action="" style="margin:0;width:400px;text-align: center;" method="post">
            <div class="item">
                <label>密碼:</label>
                <input type="password" name="pwd" placeholder="請在此輸入訪問密碼..."/>
                {if condition="$obj.vod_pwd_url neq ''"}
                    <a href="{$obj.vod_pwd_url}" target="_blank">點擊獲取密碼</a>
                {else/}
                    <span>密碼:{$obj.vod_pwd}</span>
                {/if}
            </div>
            <div class="item">
                <a class="submit_btn" href="javascript:;" onclick="MAC.Pwd.Check(this)" data-mid="1" data-id="{$obj.vod_id}" data-type="1" />點擊確認</a>
            </div>
        </form>
    </div>
</div>
</div>
</body>
</html>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
  • 播放頁訪問密碼提示 html/vod/player_pwd.html
  • 示例
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
    <title>系統提示......</title>
    <link rel="stylesheet" href="__STATIC__/css/home.css">
    <style>
        body{background:#000000;color:#818181}
        input{border:1px solid #ccc;padding:7px 0;border-radius:3px;padding-left:5px}
        .item{line-height:50px}
        .submit_btn{width:70px;height:40px;border-width:0;padding:10px;display:border-radius: 3px;background:#1E90FF;cursor:pointer;font-family:Microsoft YaHei;color:#fff;font-size:17px}
    </style>
    <script src="{$maccms.path}static/js/jquery.js"></script>
    <script>var maccms={"path":"__ROOT__","mid":"{$maccms['mid']}","url":"{$maccms['site_url']}","wapurl":"{$maccms['site_wapurl']}","mob_status":"{$maccms['mob_status']}"};</script>
    <script src="{$maccms.path}static/js/home.js"></script>
</head>
<body>
<div class="mac_msg_jump">
    <div class="msg_jump_tit">系統提示...</div>
    <div class="title">親愛的訪問此數據需要密碼哦~~~</div>
    <div class="text">
        <form id="form1" name="form1" action="" style="margin:0;width:400px;text-align: center;" method="post">
            <div class="item">
                <label>密碼:</label>
                <input type="password" name="pwd" placeholder="請在此輸入訪問密碼..."/>
                {if condition="$obj.vod_pwd_play_url neq ''"}
                    <a href="{$obj.vod_pwd_url}" target="_blank">點擊獲取密碼</a>
                {else/}
                    <span>密碼:{$obj.vod_pwd_play}</span>
                {/if}
            </div>
            <div class="item">
                <a class="submit_btn" href="javascript:;" onclick="MAC.Pwd.Check(this)" data-mid="1" data-id="{$obj.vod_id}" data-type="4" />點擊確認</a>
            </div>
        </form>
    </div>
</div>
</div>
</body>
</html>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
  • 下載頁訪問密碼提示 html/vod/downer_pwd.html
  • 示例
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
    <title>系統提示......</title>
    <link rel="stylesheet" href="__STATIC__/css/home.css">
    <style>
        body{background:#000000;color:#818181}
        input{border:1px solid #ccc;padding:7px 0;border-radius:3px;padding-left:5px}
        .item{line-height:50px}
        .submit_btn{width:70px;height:40px;border-width:0;padding:10px;display:border-radius: 3px;background:#1E90FF;cursor:pointer;font-family:Microsoft YaHei;color:#fff;font-size:17px}
    </style>
    <script src="{$maccms.path}static/js/jquery.js"></script>
    <script>var maccms={"path":"__ROOT__","mid":"{$maccms['mid']}","url":"{$maccms['site_url']}","wapurl":"{$maccms['site_wapurl']}","mob_status":"{$maccms['mob_status']}"};</script>
    <script src="{$maccms.path}static/js/home.js"></script>
</head>
<body>
<div class="mac_msg_jump">
    <div class="msg_jump_tit">系統提示...</div>
    <div class="title">親愛的訪問此數據需要密碼哦~~~</div>
    <div class="text">
        <form id="form1" name="form1" action="" style="margin:0;width:400px;text-align: center;" method="post">
            <div class="item">
                <label>密碼:</label>
                <input type="password" name="pwd" placeholder="請在此輸入訪問密碼..."/>
                {if condition="$obj.vod_pwd_down_url neq ''"}
                    <a href="{$obj.vod_pwd_url}" target="_blank">點擊獲取密碼</a>
                {else/}
                    <span>密碼:{$obj.vod_pwd_down}</span>
                {/if}
            </div>
            <div class="item">
                <a class="submit_btn" href="javascript:;" onclick="MAC.Pwd.Check(this)" data-mid="1" data-id="{$obj.vod_id}" data-type="5" />點擊確認</a>
            </div>
        </form>
    </div>
</div>
</div>
</body>
</html>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
  • rss html/vod/rss.html