get_videos
{get_videos} is used to include your desired videos into the array. You have handful of parameters at your disposal.
Usage
{get_videos parameters}
It can use following parameters
Parameter Name
Options
assign
Store the result(Array) to this variable
active
Get active videos:
yes
no
broadcast
Type of video:
public
private
category
Specific category videos. Multiple categories should be separated with comma ‘,’:
Category ID.
count_only
Set to true if you only want to count result:
true
false
date_span
Get videos for specific time frame:
all_time
today
yesterday
this_week
last_week
this_month
last_month
this_year
last_year
exclude
Exclude video from result:
Video ID
featured
Get featured video:
yes
no
limit
Number of results you want:
Numercial Figure
nouser
It will exclude provided userid’s videos from result:
User ID
order
Sort your result. You also need to tell how to order your result. asc OR desc, e.g ‘videoid desc’
videoid
title
date_added
views
rating
last_viewed
featured_date
RAND()
show_related
Set to if you want to show related videos. For this to work properly, also provide title & tags:
true
false
status
Video Status:
Successful
Processing
Failed
tags
Video Tags. Multiple tags should be separated with comma ‘,’:
Tags
title
Video Title:
Title
user
User specific videos:
User ID
videoid
Specific video with video id:
Video ID
videokey
Specific video with video key:
Video Key
Examples
Example 1
{get_videos assign=custom_videos limit=10 featured="yes"}
Above code will get first 10 featured videos and stores the array in {$custom_videos} varible. Now we will loop through the variable to display the videos.
{section name=cv_list from=$custom_videos}
{include file="$style_dir/blocks/video.html" video=$custom_videos[cv_list]}
{/section}
[post_link id=”199″] and [post_link id=”237″]
Example 2
{get_videos assign=usr_feats active="yes" featured="yes" limit=5 order=" featured_date desc" user=1}
This will get first 5 active featured videos of user with ID “1” and will sort them according to their featured_date from lasted to oldest. {$usr_feats} contains loop. Time to display.
{section name=u_feat from=$usr_feats}
{include file="$style_dir/blocks/video.html" video=$usr_feats[u_feat]}
{/section}
Last updated