# What is ClipBucket

{% hint style="info" %}
**An opensource video sharing and streaming software:** ClipBucket is an Open Source and freely downloadable PHP script that will let you start your own Video Sharing website (YouTube Clone) in a matter of minutes. ClipBucket is the fastest growing video script with the most advanced video sharing and social features.

With ClipBucket, you will have almost all social media features in your hand. You can let your users create groups, playlists, collections and much more. They can send friend requests and private messages to each other as well. You can start a fully dedicated video sharing website or photo sharing websites and also both at the same time as well.

{% endhint %}

## Getting Started / Installing ClipBucket

**Got 3 minutes?** Check out a video how to quickly Install ClipBucket:

{% embed url="<https://www.youtube.com/watch?v=RoA2xPl0gcA>" %}

{% hint style="info" %}
**Good to know:** A succinct video overview is a great way to introduce folks to your product. Embed a Loom, Vimeo or YouTube video and you're good to go! We love this video from the fine folks at [Loom](https://loom.com) as a perfect example of a succinct feature overview.
{% endhint %}

### Guides: Jump right in

Follow our handy guides to get started on the basics as quickly as possible:

{% content-ref url="/pages/WH5DeuTk7xRCyZSB5dAJ" %}
[Template Customization](/guides/template-customization)
{% endcontent-ref %}

{% content-ref url="/pages/oD32NzkX2VfuSUny0GSt" %}
[Plugin Development](/guides/plugin-development)
{% endcontent-ref %}

{% content-ref url="/pages/vvRLlPMeQRMaXStH3koF" %}
[Anchors, Functions & Filters](/guides/anchors-functions-and-filters)
{% endcontent-ref %}

{% hint style="info" %}
**Good to know:** your product docs aren't just a reference of all your features! use them to encourage folks to perform certain actions and discover the value in your product.
{% endhint %}

### Fundamentals: Dive a little deeper

Learn the fundamentals of MyProduct to get a deeper understanding of our main features:

{% content-ref url="/pages/jJfuvow9XjF4l8zT1zUK" %}
[Files Structure](/fundamentals/files-structure)
{% endcontent-ref %}

{% content-ref url="/pages/e188m6sRppBM1Y0LyxdG" %}
[Basic Understandings](/fundamentals/basic-understandings)
{% endcontent-ref %}

{% content-ref url="/pages/ldEcTxm8dLUxLKLrF5tB" %}
[Broken mention](broken://pages/ldEcTxm8dLUxLKLrF5tB)
{% endcontent-ref %}

{% content-ref url="/pages/JLXiwcwxWFFc2UvyyFOq" %}
[Broken mention](broken://pages/JLXiwcwxWFFc2UvyyFOq)
{% endcontent-ref %}

{% hint style="info" %}
**Good to know:** Splitting your product into fundamental concepts, objects, or areas can be a great way to let readers deep dive into the concepts that matter most to them. Combine guides with this approach to 'fundamentals' and you're well on your way to great documentation!
{% endhint %}


# Files Structure

File structure

We have a very easy file structuring. It was designed to have an easy access. Unlike the typical MVP approach we followed somewhat inspired by Wordpress.

So when you download ClipBucket you will the structure as follow.

```
Root
- do_not_upload
- upload
```

#### /do\_not\_upload  directory

This directory has just one file - in case you lose your password as admin, you can upload this file to recover it.

### /upload directory

Where all the source code is present, the name is somewhat confusing, its because it was written in the days when you simply upload the files, so we created a folder named 'upload' so that users understands which content are required to upload.

Its the ROOT of our software...actually.

Folders in the upload directory are as follows

```
- actions
- admin_area
- ajax
- api
- cache
- cb_install
- files
- images
- includes
- js
- player
- plugins
- styles
```

#### /actions

It has basic files which are called when file upload request is made and when conversion request is asked for.  For Vodlix, It has a different purpose

#### /admin\_area

This has all the files related to Administration panel, it's authentication is done by including the config file. It loads PHP file and then renders a template from style within this directory

#### /ajax

it has the PHP files for Ajax Requests

#### /api

It has an absolutely nonsense Api files, please avoid it, we will write them in future.

#### /cache

Smarty Template engine Cache, by default its off

#### /cb\_install

ClopBucket Installation instructions are written here

#### /files

uploaded videos files are stored here&#x20;

#### /images

uploaded images that is not related to the videos are uploaded here

#### /includes

all the methods & classes are written in this folder so this is where you are going to spend most of your time

#### /js

javascript libraries and code

#### /player

Comes with video Js, this holds folders of each player, new player can be added and later selected through admin area

#### /upload/plugins

Plugins directory

#### /styles

Themes and template directory

### PHP & .htaccess files

#### /.htaccess

the magic file for apache

#### /403.php

loaded when permission is denied via htaccess

#### /404.php

when a wrong URL is hit

#### /LICENSE

file that you alwasy ignore, it simply tells you about our attribute assurances license and whos the daddy

#### /activations.php

for User activation

#### /add\_*group*\_videos.php

When videos are added to the group, this page is loaded

#### /ajax.php

for user ajax requests, yes we also have a folder that holds a group of ajax files, we didnt have teh API written so we went for the cheap mode

#### /captcha.php

for load the captcha, not really good but ... works

#### /channels.php&#x20;

list user profiles, we call them channels

#### /collections.php

List Collections, that are basically advance playlists. you can even create sub collections

#### /contact.php

Loads a contact page with a contact form..yep.

#### /create\_group.php

To create a new group

#### /download.php

for downloading a video file

#### /download\_photo.php

for downloading a photo

#### /edit\_account.php

for editing user profile details from front end

#### /edit\_group.php

to edit group details

#### /edit\_photo.php

to edit photo information

#### /edit\_video.php

to edit video information

#### /favicon.ico

favicon

#### /forgot.php

to recover forget password and username

#### /groups.php

list groups

#### /index.php

the main file

#### /invite\_group.php

for adding members via invitiation

#### /logout.php

logout

#### /manage\_collections.php

to manage a collection for user

#### /manage\_contacts.php

manage conctacts for user

#### /manage\_groups.php

manage groups for user

#### /manage\_photos.php

manage photos for user

#### /manage\_playlists.php

manage playlists for user

#### /manage\_videos.php

user videos manager

#### /module.php

load a module, thats used via Plugin

#### /myaccount.php

load my account details for user

#### /opensearch.php

for SEO open search

#### /package.json

package json thats never used

#### /photo\_upload.php

to upload photos

#### /photos.php

list photos

#### /privacy.php

loads privacy policy page

#### /private\_message.php

for messaging

#### /readme

ignore

#### /rss.php

for RSS feed, MRSS supported

#### /search\_result.php

search results

#### /signup.php

for creating new accounts for end users

#### /sitemap.php

sitemap

#### /upload.php

to upload a video

#### /upload\_thumb.php

to upload a thumb for a video

#### /user\_collections.php

list user collections&#x20;

#### /user\_contacts.php

list user contacts

#### /user\_photos.php

list user photos

#### /user\_videos.php

list user videos

#### /videos.php

list all videos

#### /view\_channel.php

Basically a user profile lis

#### /view\_collection.php

view collection details

#### /view\_group.php

show group details

#### /view\_*group*\_members.php

list group members

#### /view\_*group\_videos.php*

*View group videos*

#### */view\_item.php*

*View group items*

#### /view\_page.php

list a page with details created through backend

#### /view\_playlist.php

view a playlist

#### /view\_topic.php

view a group topic

#### /watch\_video.php

view video details


# Basic Understandings

Before we move forward, there is a basic understanding that you must have. This will give you a much broader command about how the code is written, how its connected and how you can made your favorite changes.

## Languages, DB, Tools and Libraries

### PHP

Version 7.3, We intent to upgrade but not sure When

### MYSQL/MariaDB

We used Mysqli driver

### [Smarty Templating Engine](https://www.smarty.net/)

we use Smarty Templating Engine for PHP to render the template, there is no specific purpose, its just easy to carry the objects and keep the front end totally seperate.

### FFMPEG

We use FFMPEG for video conversion

### VideoJS Video Player

we use video JS for Video Player, previously it was JWPlayer then they went stupid.

### Other Stuff

No Rest API system At the moment...Uh oh.

{% hint style="info" %}
We have made Functions for each object in order to easy access them across the project for example

We have a user object user.class.php and its initiated as `$userquery`. To get a Userid we use this method

**`$userquery->udetails['userid'];`**

Then we wrote  a function in file functions\_users.php and now we can fetch userid as

`userid();`
{% endhint %}

All objects names and function names are following pattern

{object}.class.php and function&#x73;*{object}.class.php e.g users.class.php and functions\_userrs.php*

## Objects, Classes & Functions

Each Object or class is mentioned in the **includes/classes/** folder. We have following Major Objects, there are more but we will cover the basics.

### [videos.class.php](/fundamentals/basic-understandings/videos-class-and-functions)

This manages all the Operations related to the Videos, from Edit, Publishing and other important Stuff.&#x20;

### **actions.class.php**

For those methods that are common accross all objects e.g Add\_*to\_*&#x66;avorites is called in video, photos and groups so we use one class, re initate it in the object and call it e.g

in videoc.class.php we

```
$this->action = new cbactions();

then call this->action->add_to_Favorites
```

### **ads.class.php**

&#x20;For managing Ads System

### **caldate.class.php**

Honestly, this class does not even make sense anymore. It was for calculate dates.

### category.class.php

Category system is integral part of ClipBucket, we Extend the category system to all major objects. e.g CBVideo in video.class.php is extended from CBCategory.&#x20;

It manages the category system for all objects, we can even use on category system for multiple objects.

### cbemail.class.php

For sending emails and setting email templates.

### cbfeeds.class.php

ClipBucket has a built in Feeds system, this basically records all major activies of the users.

### cbpage.class.php

Found in the admin area, CBPage is a page management class

### ClipBucket.class.php

Core Class of ClipBucket, initiates and maintain all operations of ClipBucket

### collections.class.php

Advance Playlist system. Collections class is for Managing the collections across ClipBucket. Collections can be used as Playlists for videos while Albums for Photos and Music.

We create thsi class in each major object to use it as specific collection for example in video.class.php we created $this->collection = new Collections(); to assign a collection to a $vod object.

### [db.class.php](#db.class.php)

Database object class. Basically does very basic handling, nothing fancy. The good thing is all DB queries are went through this object so we can manipulate or log everything here.

### errorhandlers.class.php

Unlike the original PHP Error Handler, its just to log ClipBucket operations for example 'Invalid username & password' is an error, we log using this object

### form.class.php

Its one of the classic forms class of ClipBucket, this basically takes an array and returns a fully fledged HTML Form element. I request you to read it throughly, experiment with it before using it.

This acctually helped us achieve dynamic form fields for signup and upload. which, in future we are dumping and replacing with json forms.

### gravatar.class.php

Just as the name suggests

### groups.class.php

For managing all operations related to the groups system in ClipBucket, Groups system is similar to the FB groups but .. a very small part of it.

### lang.class.php

Language manegement system

### log.class.php

Unlike the name, its basically an activity recorder and Records and manages all activities related to any object. This Object is re-initiated in all major objects e.g videos, photos, etc. We store all activities in actions table.&#x20;

### mass\_upload.class.php

This class was used to handle multiple videos at once

### menuhandler.class.php

For creating front end and backend menus include Admin Area Menu

### my\_queries.class.php

In earlier versions of ClipBucket, there were no seperate classes, so myquery class was used. now its a stalled.

### objects.class.php

For small Objects to display e.g list of template with a dropdown. You can say 'widgets' in other terms

### pages.class.php

Dont confuse it with CBPages, pages.class.php is actually used for Pagination and creating links.

### photos.class.php

This is for managing photos operations

### player.class.php

for player operations, like changing height, which player to use etc.

### playlist.class.php

Collections should have been used but in earlier version playlist was used. we intended to replace it but we didnt so playlist still exists and is current linked to videos only.

### plugin.class.php

THe magical Plguins class for manaing plugins

### pm.class.php

Pm is for Private Messaging, yes ClipBucket also offers that.

### reindex.class.php

For Re-indexing the data such as No for videos of a user tc..

### search.class.php

Search object is re initiated in each object to setup its search functionality just like actions and collections.

e.g in videos.class.php -> init\_search function

```
$this->search = new cbsearch;
```

and $vdo->search->search() will return the results

### session.class.php

For handling sessions ... and cookies

### [template.class.php](/fundamentals/basic-understandings/template-class-and-functions)

for managing the template system of ClipBucket

### upload.class.php

For handling the video uploading, however..it was stupid to have one seperate class.

### [user.class.php](/fundamentals/basic-understandings/user-class-and-functions)

for handlng alll user related operations

### [video.class.php](/fundamentals/basic-understandings/videos-class-and-functions)

For handling videos operations

###


# Videos Class & Functions

```
//Class is initated as  $vdo
$vdo->get_video($videoid);
```

Absolute Path of the Class File **/includes/classes/videos.class.php**

Absolute Path of teh functions file **/includes/functions\_videos.php**

{% hint style="info" %}
For Some Odd Reason, I know. submit\_upload (Add Video Method) was written in /includes/class/upload.class.php
{% endhint %}

| Object Methods                                                                                                                                                                                                                                            | Functions                                             | Purpose                                                                                                                                              |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| ::get\_basic\_fields()                                                                                                                                                                                                                                    |                                                       |                                                                                                                                                      |
| ::video\_exists(int $video)                                                                                                                                                                                                                               | video\_exists(int $videoid);                          |                                                                                                                                                      |
| <p>::get\_video(int $vid, bool $file, bool $basic)</p><p></p><p>$vid = videoid</p><p>$file = if set to true $vid will be searched in file\_name column instead of videoid column</p><p></p><p>$basic = if set to true, only basic fields are returned</p> | <p>get\_<em>video(); same has ::get</em>Video<br></p> |                                                                                                                                                      |
| ::get\_video(int $videoid)                                                                                                                                                                                                                                | get\_video(int $vid)                                  | get video details                                                                                                                                    |
| ::video\_exists(int $vid)                                                                                                                                                                                                                                 | video\_exists(int $vid);                              | check if video exists                                                                                                                                |
| ::action($case, $videoid)                                                                                                                                                                                                                                 |                                                       | <p>Case Values</p><p><strong>activate</strong></p><p><strong>deactivate</strong></p><p><strong>feature</strong></p><p><strong>unfeature</strong></p> |
| ::delete\_video(int $vid)                                                                                                                                                                                                                                 |                                                       |                                                                                                                                                      |
| ::get\_videos(array $params)                                                                                                                                                                                                                              | get\_videos()                                         | Get list of videos                                                                                                                                   |


# User Class & Functions

```
//Class is initated as  $userquery
$userquery->get_user_details($userid);
```

Absolute Path of the Class File **/includes/classes/videos.class.php**

Absolute Path of the functions file **/includes/functions\_videos.php**

| Object Methods                                               | Functions        |                                                                                           |
| ------------------------------------------------------------ | ---------------- | ----------------------------------------------------------------------------------------- |
| ::get\_basic\_fields                                         |                  | Get the basic fields that are required in a user object                                   |
| ::login\_user($username, $password, $remember)               |                  | Used to login user with username and Password.                                            |
| ::login*check($access, $check\_only, $verify\_logged\_user)* |                  | Very important, basically its to see if user has Access to a page, the name is confusing. |
| ::logout                                                     |                  | logs out user                                                                             |
| ::delete\_user(int $int)                                     |                  | Delete's user                                                                             |
| ::get\_user\_details($id)                                    |                  | Fetches the user information                                                              |
| ::get\_logged\_username                                      | get\_username(); | Fetches logged in username                                                                |
|                                                              | get\_userid();   | get logged in userid                                                                      |
| ::signup\_user(array $params)                                |                  | Add New User                                                                              |


# Template Class & Functions

```
//Class is initated as  $cbtpl
$cbtpl->Fetch($name);
```

Absolute Path of the Class File **/includes/classes/template.class.php**

Absolute Path of the functions file **/includes/functions\_template.php**

| Methods in Object      | Functions                        | Purpose                                                                                                                                                                                                                                                                                               |
| ---------------------- | -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ::fetch($file\_path)   | fetch($name, bool $inside)       | <p>This fetches a smarty template. in $cbtl->fetch() we provide an absolute path of the Template file while in fetch we only mention the file name so that we dont have to provide aboslute. </p><p></p><p>in fetch function, LAYOUT directory is automaticall appended if $inside is set to true</p> |
| ::assign($var, $value) | assign($var, $value)             | Assign a variable that can be used in smarty template                                                                                                                                                                                                                                                 |
|                        | Template($file, boolean $layout) | Add a template file in a List of files to load when Displa\_it(); is called                                                                                                                                                                                                                           |
|                        | display\_it();                   | Display it will render body.html found in Layout dir and loop all templates files that are assigned using Templatete(); method                                                                                                                                                                        |
|                        |                                  |                                                                                                                                                                                                                                                                                                       |

Further read

How to Edit a Template


# DB.class & Functions

```
//Class is initated as  $cbtpl
$db->select($query);
```

Absolute Path of the Class File **/includes/classes/db.class.php**

Absolute Path of the functions file **/includes/functions\_db.php**

| Object Methods                              | Functions                                      | Purpose                                                                                    |
| ------------------------------------------- | ---------------------------------------------- | ------------------------------------------------------------------------------------------ |
| **::**\_select($query)                      | db\_select($query)                             | Executes a MYSQL query and return ARRAY                                                    |
| ::select($tbl, $fields, $condition, $order) |                                                | <p>Executes Mysql SELECT query and returns data.</p><p></p>                                |
| ::db\_update                                | db\_*update($tbl, $assoc\_fields, $condition)* | Update a DB table and set values acording to the Assoc\_array fields and as per $condition |
| ::db\_insert                                | db\_insert($tbl, assoc array $fields)          | Insert data into a table                                                                   |
| ::insert\_id                                |                                                | returns last insert\_id                                                                    |
| ::Execute()                                 |                                                | Executes a raw Mysql Command                                                               |


# User Levels & Permissions

Functions Used

* User Levels
* – Functions List
* User Permissions
* – Functions List

Levels — *userquery.class.php*

* get\_levels()
* get\_levels\_details()
* get\_level\_users()
* get\_level\_permissions()
* add\_user\_level()
* update\_user\_level()
* delete\_user\_level()
* level\_type\_exists

Permissions — *userquery.class.php*

* add\_new\_permission()
* permission\_exists()
* get\_permissions()
* remove\_permission()
* perm\_check()

General Purpose

* has\_access() — *functions.php*

### User Levels

User levels are used to group users in different levels ie. Administrators, Moderators, Registered users etc.

ClipBucket has 5 Default Levels that cannot be deleted but you can edit them

1. Administrator
2. Registered User
3. Inactive User
4. Gues
5. Global Moderator

as their names define, they are generatl purpose use, any inactive user will have “Inactive leve”, gues will have “Guest” , admin will have “Administrator” and so on..

Eeach Level has its own [permissions](broken://pages/VUoGHUi4ul0AGnKwjkde) that can be added, edit or delete from admin panel. You can assign users 1 level at one time and he can access different areas of your website if his level has permission to access the page, Levels are Linked with permissions as showed in following diagram

[![Levels and Permissions Relation Diagram](http://docs.clip-bucket.com/wp-content/uploads/2010/01/level_permission_relation_diagram-200x300.png)](http://docs.clip-bucket.com/wp-content/uploads/2010/01/level_permission_relation_diagram.png)

Levels and Permissions Relation Diagram

![](https://clipbucket.com/docs/wp-content/plugins/wp-postratings/images/loading.gif)Loading...


# Template Customization

{% hint style="info" %}
**Good to know:** your product docs aren't just a reference of all your features! use them to encourage folks to perform certain actions and discover the value in your product.
{% endhint %}

#### [Jump Straight to the video](#template-editing-in-action)

## The basics

We use Smarty Templating Engine to Render Template. Here is the current structure. and how it works.

For each file that Person is landed on we load the HTML file of it using Smarty. E.g&#x20;

When user open **/watch\_*****video.php**, for smarty, we have **watch\_video.html** file present in **/styles/template/layout/** folder*

![](https://1251267480-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLNyBPqFiivUvEbfQHZYb%2Fuploads%2FY6yG4D4iAotfQI5QEP99%2Fimage.png?alt=media\&token=9a95b56b-bc16-4a8f-8f9b-60051ffd64ba)

{% hint style="info" %}
template\_*directory is basically a placeholder by default template\_directory is **cb\_28***
{% endhint %}

### Directory Structure

```
/styles 
|--/template_directory 
   |--/layout 
   |--/theme 
   |--/images 
   |--/template.xml
```

#### /Layout Directory

it has all the HTML files of the template and that is where you edit the files. to access this folder dynamically use **{$tyles\_dir}**

```
//Home Page is index.php and we load index.html file
{include file="$styles_dir/my_file.html}

//This will load file that is present in /styles/template_directory/layout/my_file.html
```

#### /theme Directory

this is where we place our CSS files, this is to include them easily and place them seperately.

```
<link rel="stylesheet" href="{$theme}/css/bootstrap.min.css?cache={$cache_buster}" />
/images Directory
//This will load css from /styles/template_directory/theme/css/bootstrap.min.css
```

#### /images Directory

This directory is where we place our images file required for any template and to access it

```
<img src="{$imageurl}/logo.png" />
```

### Common Variables

### $baseurl

returns the base url of the website

### $imageurl

to access the images folder URL of the template

### $theme\_url&#x20;

to access the theme folder of the URL

## Objects & Methods That you can use&#x20;

$vdo object from Video.class.php

$userquery object from User.class.php

Basically all is mentioned in /includes/common.php

### Methods

userid();

get\_videos();

get\_video();

and all PHP functions...because smarty support PHP

{% hint style="info" %}
in Vodlix we use two parenthesis {{ }} for smarty while for ClipBucket we use single.&#x20;

So in case of ClipBucket if you enter a JS code such as data({'yes','test'}) it will throw an error so you will have to wrap this kind of a code in {literal} ... {/literal}
{% endhint %}

### Template Editing in Action

{% embed url="<https://youtu.be/_2NkCKB3D64>" %}


# Plugin Development

{% hint style="info" %}
ClipBucket was inspired by Wordpress For the Development however its not as efficient as Wordpress, we will try to get things done vial available options

Good news is Vodlix & ClipBucket share the same Core for the Plugins
{% endhint %}

## Folder Strucuture

```
- plugins
  |-plugin_folder
    |- plugin_name.php
    |- plugin_name_install.php //Call when plugin is about to install
    |- plugin_name_uninstall.php //Caled when plugin is about to uninstall

//Example

- plugins
  |-global_announcement
    |-global_announcement.php
```

### Plugin Meta

Just like wordpress, you have mention the plugin detail at the top in comments just as shown below

```
<?php
/*
	Plugin Name: Global announcement
	Description: This will let you post a global announcement on your website
	Author: Arslan Hassan
	ClipBucket Version: 1.8
	Plugin Version: 1.0
	Website: http://google.com/
*/


```

### Plugin Installation Script

This is pure PHP Script, nothing fancy, we usually just call DB Queries in it. e.g

```

//Creating Table for anncoument if not exists
function install_global_announcement()
{
	global $db;
	$db->Execute(
	'CREATE TABLE IF NOT EXISTS '.tbl("global_announcement").' (
	  `announcement` text NOT NULL
	) ENGINE=InnoDB DEFAULT CHARSET=utf8;;'
	);
	
	//inserting new announcment
	$db->Execute("INSERT INTO  ".tbl('global_announcement')." (announcement) VALUES ('')");
}


//This will first check if plugin is installed or not, if not this function will install the plugin details
install_global_announcement();
```

### Plugin Uninstall Script

```
//Function used to uninstall Plugin
function un_install_global_announcement()
{
    global $db;
    $db->Execute(
        'DROP TABLE '.tbl("global_announcement").''
    );
}

un_install_global_announcement();
```

## Resource from ClipBucket

{% embed url="<https://clipbucket.com/docs/getting-started-with-plugins>" %}

### Global Announcement Tutorial

{% embed url="<https://clipbucket.com/docs/creating-advance-global-announcement-plugin-for-clipbucket>" %}

### Understanding Plugin Development

{% embed url="<https://youtu.be/JADQaKCqCGU>" %}


# Anchors, Functions & Filters

To make Plugin development & Customization easier. We have created the following functionalities in ClipBucket.

Good news is same functionalities are also available in Vodlix and on much much greater value.

### Anchors

{% embed url="<https://youtu.be/-IZ-zQGaaqQ>" %}

### Dynamic Functions

{% embed url="<https://youtu.be/hrLwalpHi_0>" %}

### Filters

{% embed url="<https://youtu.be/tJjDGqxyIEo>" %}


# Clipbucket template files

Clip-bucket templates has over 60 files and it can get pretty bad if you don’t know what file , serves what purpose ? This post is dedicated to give a proper list of template layout files and when these are used.

#### Main Files

| 403.html                | When a 403 error occurs, this layout is used.                                                                               |
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| 404.html                | When a 404 error occurs, this file is used                                                                                  |
| activation.html         | This file is used when user is activating his account.                                                                      |
| add\_group\_videos.html | When user wants to add videos in his group.                                                                                 |
| body.html               | This is the back-bone of your template.                                                                                     |
| channels.html           | When displaying list of channels/users.                                                                                     |
| contact.html            | Your website contact page.                                                                                                  |
| create\_group.html      | When creating new group.                                                                                                    |
| download.html           | When downloading a video, only uploaded ones are allowed to download.                                                       |
| edit\_account.html      | When editing profile settings, email, password, avatar & background, subscriptions and ban users, this single file is used. |
| edit\_group.html        | When editing a group.                                                                                                       |
| edit\_video.html        | When editing a video.                                                                                                       |
| footer.html             | It serves as footer of your template. [Note](broken://pages/b9KfiSYnDrAikrnogXw2)                                           |
| forgot.html             | When user wants to request forgotten username or password.                                                                  |
| global\_header.html     | This file contains \<head> tag.                                                                                             |
| gourps.html             | When displaying list of groups.                                                                                             |
| header.html             | It serves as header of your template.                                                                                       |
| index.html              | Your homepage.                                                                                                              |
| manage\_contacts.html   | When user wants to perform some actions on his contacts. Private                                                            |
| manage\_groups.html     | When user wants to perform some actions on his groups. Private                                                              |
| manage\_playlists.html  | When user wants to perform some actions on his playlists. Private                                                           |
| manage\_videos.html     | When user wants to perform some actions on his videos. Private                                                              |
| message.html            | This is used to display Clip-bucket messages i-e Errors , Success and Warnings                                              |
| myaccount.html          | Home of your account.                                                                                                       |
| private\_message.html   | Used to display inbox, notifications, sent messages and to compose new message.                                             |
| search.html             | Used to display Search Form and Search Results.                                                                             |
| signup.html             | Used to display signup and login forms.                                                                                     |
| upload.html             | When user wants to upload video. This file contains all three steps.                                                        |
| user\_contacts.html     | When someone wants to view user contacts. Public                                                                            |
| user\_videos.html       | When someone wants to view user videos. Public                                                                              |
| videos.html             | When displaying list of videos                                                                                              |
| view\_channel.html      | When viewing a channel/user                                                                                                 |
| view\_group.html        | When viewing a group                                                                                                        |
| view\_page.html         | When viewing a page                                                                                                         |
| view\_topic.html        | When viewing a topic                                                                                                        |
| watch\_video.html       | When viewing a video                                                                                                        |

Above list are the main files of template. Following are block files(small pieces of code) that are used inside files, to make it more clean & readable. We will break these files according to folders

#### /blocks

| category\_list.html | Used to display categories of videos, channels and groups. |
| ------------------- | ---------------------------------------------------------- |
| flag\_form.html     | Used to display Report Form.                               |
| group.html          | Used to display a block group.                             |
| pagination.html     | Used to display pagination.                                |
| playlist\_form.html | Used to display add to playlist form.                      |
| rating.html         | Used to display rating on watch\_video.html.               |
| share\_form.html    | Used to display share form.                                |
| subscriptions.html  | Used to display subscription videos.                       |
| user.html           | Used to display a block of channel/user.                   |
| video.html          | Used to display a block video.                             |

#### /blocks/comments

| add\_comment.html | Used to display add comment form. It also used on view\_channel and view\_topic for replies. |
| ----------------- | -------------------------------------------------------------------------------------------- |
| comment.html      | Used to display a comment.                                                                   |
| comments.html     | Used to display comments.                                                                    |

#### /blocks/editor\_pick

| index\_featured\_video.html | Used to display editors pick videos list. |
| --------------------------- | ----------------------------------------- |
| video\_block.html           | Used to display editors pick video player |

#### /blocks/group

| add\_topic.html    | Used to display new topic form.       |
| ------------------ | ------------------------------------- |
| group\_header.html | Used to display group top portion.    |
| group\_topics.html | Used to display list of group topics. |

#### /blocks/manage

| manage\_group.html             | Used to display a block group. Private                                                                             |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
| account\_head.html             | Used to display header of your account.                                                                            |
| account\_left.html             | Used to display left side of your account.                                                                         |
| account\_user.html             | Used to display a block user. Private                                                                              |
| account\_video.html            | Used to display a block video. Private                                                                             |
| group\_manage\_links.html      | Used to display a list manage links for group i-e Manage Members, Manage Videos, Edit Group, Delete Group. Private |
| user\_account\_pagination.html | Used to display pagination for your account. If you want to can use your main pagination.                          |

#### /blocks/pm

#### /blocks/quicklist

| block.html        | Used to display the block of quicklist            |
| ----------------- | ------------------------------------------------- |
| video\_block.html | Used to display the video block inside block.html |

#### /blocks/view\_channel

| channel\_global.html | Used to take advantage of background settings found in user account |
| -------------------- | ------------------------------------------------------------------- |
| channel\_left.html   | Used to display left side of view\_channel.html                     |
| channel\_top.html    | Used to display top of view\_channel.html                           |

![](https://clipbucket.com/docs/wp-content/plugins/wp-postratings/images/loading.gif)Loading...


# Functions


# add\_admin\_menu

Function : add\_admin\_menu\
File : includes/plugins.functions.php\
Since : 2.x

This function used to add links admin area. When you create or develop a plugin you must point links to access or configure plugin pages, in order to make it easier we have created system, an easy system so you can write files dedicated to admin area only. [Please read Add Plugin Pages For Admin Area.](broken://pages/TKmAkLd5m1YNegofWpLF)

**Usage**

function add\_admin\_menu($header=’Tool Box’,$name,$link,$plug\_folder=false,$is\_player\_file=false)

**Uses**

* ClipBucket->AdminMenu

**Overview**

To create menu in admin area, we will simply pass links to an array $Cbucket->AdminMenu and then we create a loop in admin area html files to render the links accordingly, there are too many functions involved and we will try to document them all one by one

| Parameter Name         | **Options**                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| $header (String)       | A header of amin menu under which link will be displayed, by default we have ‘Stats and Configurations’, ‘Videos’ etc..please take a look at [this pic](http://docs.clip-bucket.com/images/admin_menu_pic_reference.png) for proper understanding. By default its Tool Box so all your plugin links will be listed under Tool Box if not specified                                                                                                                |
| $name (String)         | Name of your menu link that are displayed under your header, like we have ‘Manage videos’ under Videos header                                                                                                                                                                                                                                                                                                                                                     |
| $link (String)         | Link to your plugin file that you will load or call when admin clicks on it or it can be direct Http link (leave other to params blank for direct http link), e.g for /plugins/global\_announcement/admin/manage.php , simply set it as ‘manage.php’                                                                                                                                                                                                              |
| $plug\_folder (String) | <p>Path to the folder of the files, relative to /plugins directory, e.g if you have a plugin folder ‘global\_announcement’ , then according to given above example , it should be ‘global\_announcement/admin’Note : $plug\_folder and $link makes a complete path to the file relative to plugins directory ie.</p><p>/plugins/$plug\_folder/$link</p><p>its default value is false, it will ultimately load file from /plugins directory</p><p>/plugs/$link</p> |
| $is\_player (Boolean)  | default is false, just to tell CB if plugin file is for player                                                                                                                                                                                                                                                                                                                                                                                                    |

#### Example

this code

```
<?php
add_admin_menu("Audio","Audio Configuration",'audio_configurations.php','cb_audio/back_end/');
add_admin_menu("Audio","Audio Manager",'audio_manager.php','cb_audio/back_end/');
add_admin_menu("Audio","Manage Categories",'audio_categories.php','cb_audio/back_end/');
add_admin_menu("Audio","Flagged Audios",'flagged_audios.php','cb_audio/back_end/');
add_admin_menu("Audio","Inactive Audios",'audio_manager.php&search=search&active=no','cb_audio/back_end/');
?>
```

will generate something like this

[![](http://docs.clip-bucket.com/wp-content/uploads/2011/11/admin_menu_pic_reference_2.png)](http://docs.clip-bucket.com/wp-content/uploads/2011/11/admin_menu_pic_reference_2.png)

Final view of admin menu

![](https://clipbucket.com/docs/wp-content/plugins/wp-postratings/images/loading.gif)Loading...


# get\_thumb

Function : get\_thumb\
File : functions\_videos.php\
Since : v2.x

This function is used to get thumbnails of a video.

This function will get all video thumbnails and list them in array, you can single thumbnail using incremental number or all thumbnails in an array or just count how many thumbnails are available. This function has few limitations that we will try to cover in upcoming updates.

**Usage**

get\_thumb($vdetails,$num=’default’,$multi=false,$count=false,$return\_full\_path=true,$return\_big=true,$size=Null);

**Uses**

* default\_thumb();
* MyQuery->get\_video\_details();

paramater marked with \* is required

| Parameter Name                | **Options**                                                                                                                                                                                                                                                                 |
| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| $vdetails (Array\|Int) \*     | It can either be an array of video details or just videoid and it will automatically fetch video details                                                                                                                                                                    |
| $num (Int)                    | incremental number of thumb, default is 1, depends on how many thumbs generation you have set, by default there are 3 thumbs that clipbucket generates so you can set this between 1 to 3.***if set to 2 it will return <http://website.tld/files/thumbs/filename-2.jpg>*** |
| $multi (Boolean)              | default is false, on setting true it will return a complete list of thumbs in an array.                                                                                                                                                                                     |
| $count (Boolean)              | default is false, if set to true, this function will only return number of thumbs of videos (int)                                                                                                                                                                           |
| $return\_full\_path (Boolean) | default is true, it will return thumbail with complete URL i.e *<http://website.td/files/thumbs/filename-1.jpg>*, if set to false it will only return *filename-1.jpg*                                                                                                      |
| $return\_big (Boolean)        | default is false, if set to true it will return big thumbnail of video, depends on what resolution you have set in configuration default is *320×240 and file name will be filename-big-1.jpg*                                                                              |
| $size (String)                | default is null, depends on what size you want, it can be 120×90 or whatever sizes you have set for thumbs generation                                                                                                                                                       |

#### Examples

```
<?php

	//set your videoid, it can also bevideokey
	$vid = 1236;
	$vdetails = get_video_details($vid);
	$default_thumb = get_thumb($vdetails);
	$second_thumb = get_thumb($vdetails,2);
	$all_thumbs = get_thumb($vdetails,NULL,true);
	$count_thumbs = get_thumb($vdetails,NULL,false,true);

	echo '<pre>';
	var_dump($default_thumb);
	var_dump($second_thumb);
	var_dump($all_thumbs);
	var_dump($count_thumbs);
	echo '</pre>';
?&gt
```

![](https://clipbucket.com/docs/wp-content/plugins/wp-postratings/images/loading.gif)Loading...


# FlashPlayer

{FlashPlayer } function is used to create flash video player.

**Usage**

```
{FlashPlayer parameters}
```

It can use following parameters

| Parameter Name      | **Options**                                                                    |
| ------------------- | ------------------------------------------------------------------------------ |
| vdetails (Required) | Video Array                                                                    |
|                     |                                                                                |
| height              | Set the height of player. This will override the setting found in Admin Area.  |
| player\_div         | Name of tag ID which will wrap player. If left empty ‘**videoPlayer**‘ is used |
| width               | Set the width of player. This will override the setting found in Admin Area.   |

**Examples**

**Example 1**

```
{FlashPlayer vdetails=$video_array}
```

The above would simple display video player with all default settings.

**Example 2**

```
{FlashPlayer vdetails=$video_array height='300' width='300'}
```

This code will display player with your custom height & width.

![](https://clipbucket.com/docs/wp-content/plugins/wp-postratings/images/loading.gif)Loading...


# {ANCHOR }

ClipBucket anchors are basically hook points where you can execute your codes via plugins

for example

if you want to call code under your video player, you will simply create or write an anchor after your player code as follows

```
{ANCHOR place="after_video_player"}
```

now if you want to call code at this anchor, you will simply “register anchor code” or “anchor function”

there are two functions for registering codes for anchor points

1. register\_anchor
2. register\_anchor\_function

#### Register\_Anchor

```
register_anchor(String[text you want to display on this anchor point], String[Anchor place]);  
```

now if you want to show a text “Hello World!” , you simply have to do is

```
 register_anchor("Hello World!","after_video_player");
```

#### Register\_Anchor\_Function

```
register_anchor(String[function name], String[Anchor place]);  
```

now if you want to execute a function on place “after\_video\_player” , here how you will do that

```
register_anchor_function("my_function","after_video_player");
```

and you also have to write my\_function code such as

```
 function my_function(){ echo "Hello World!"; }  
```

#### Passing Parameters To Function Via Anchor

if you want to pass paramters to function via anchor, its really simple. First you have to add a paramter in anchor function

```
{ANCHOR place='after_video_player' data="This is me, Mickey!"}
```

and the function you want to call is my\_function($text) , you just have to do is

```
register_anchor_function("my_function","after_video_player");
function my_function($text){ echo "Hello World! ".$text;  }
```

it will show the whole phrase as “Hello World! This is me, Mickey”;

Hope i have cleared the mystery of our Anchor points, need more help regarding this , please leave a comment or discuss it on forums.clip-bucket.com

![](https://clipbucket.com/docs/wp-content/plugins/wp-postratings/images/loading.gif)Loading...


# add\_js

### add\_js

ClipBucket has a very useful function that is used to add Js file in ClipBucjet template so that you dont need to add js file in each template seperately, all you have to do is to add a little code and your file will be included in all templates

usage

add\_js(array\[]);

explanation

array(“file”=>”scope”);

file

Make sure your file is placed in /js directory, e.g if you want to call my.js , you first place it in /js directory and then add array(“my.js”=>”watch\_video”); , similarly if your file in /js/somefolder/myfile.js , you will add it array(“somefolder/myfile.js”=>”watch\_video”);

scope

scope basically tells the clipbucket in which files we should include this file , ie , watch\_video, home, view\_channel etc…  or say for each **file\_name.php** scope name is file\_name. ok , if you add

array(“my.js”=>”watch\_video”); array(“my.js”=>”view\_channel”); array(“my.js”=>”view\_group”);

it will include my.js file in all these “watch\_video” , “view\_channel” and “view\_group” files..\
if you want to add my.js in all files, simply, call function as follow

array(“my.js”=>”global”);

![](https://clipbucket.com/docs/wp-content/plugins/wp-postratings/images/loading.gif)Loading...


# lang

{lang }function is basically used to display phrases such as User doesnt exist. It helps make Clip Bucket Multilingual.

**Usage**

```
{lang code='var_code'}
```

**Examples**

**Example 1**

```
{lang code='usr_exist_err'}
```

Above code will print ‘User doesnot Exist’.

**Example 2**

There are some phrases which uses ‘[sprint\_f](http://php.net/manual/en/function.sprintf.php)‘ modifier to assign values on-fly. With these phrases lang function is used a little differently.

```
{lang code="user_commented_time"}
```

This will print ‘%s commented %s’. This makes no sense. So we will assign this value to a variable.

```
{lang code="user_commented_time" assign="comment_string"}
```

Now it is stored in variable called {$comment\_string}. We will now use ‘sprintf’ modifier to assign values one by one.

```
{$comment_string|sprintf:'http://test.com':'Username','3 weeks ago'}
```

This will print: [Username](http://test.com/) commented 3 weeks ago.

Complete list of phrases with respective codes can be found here

![](https://clipbucket.com/docs/wp-content/plugins/wp-postratings/images/loading.gif)Loading...


# {videoLink }

[September 21, 2010](broken://pages/n9vPx2VeIBtkh2d5ahSh) [Fawaz](https://clipbucket.com/docs/author/fawaz/) [Template Functions](https://clipbucket.com/docs/category/clipbucket-v2/developers-guide/template-functions/)

{videoLink} function is used generate video related URLs.

**Usage**

```
{videoLink parameters}
```

It uses following parameters

| Parameters | **Options**                                                                            |
| ---------- | -------------------------------------------------------------------------------------- |
| vdetails   | <p>It needs video array or video id.</p><ul><li>Video Array</li><li>Video ID</li></ul> |
| type       | <p>Type of url:</p><ul><li>download</li></ul>                                          |

Tags:[designers](https://clipbucket.com/docs/tag/designers/)[template functions](https://clipbucket.com/docs/tag/template-functions-2/)[video link](https://clipbucket.com/docs/tag/video-link/)[videos](https://clipbucket.com/docs/tag/videos/)

![1 Star](https://clipbucket.com/docs/wp-content/plugins/wp-postratings/images/stars/rating_on.gif)![2 Stars](https://clipbucket.com/docs/wp-content/plugins/wp-postratings/images/stars/rating_on.gif)![3 Stars](https://clipbucket.com/docs/wp-content/plugins/wp-postratings/images/stars/rating_on.gif)![4 Stars](https://clipbucket.com/docs/wp-content/plugins/wp-postratings/images/stars/rating_on.gif)![5 Stars](https://clipbucket.com/docs/wp-content/plugins/wp-postratings/images/stars/rating_on.gif) (**1** votes, average: **5.00** out of 5)<br>

![](https://clipbucket.com/docs/wp-content/plugins/wp-postratings/images/loading.gif)Loading...


# get\_users

{get\_users} is used to include your desired users into the array. You have handful of parameters at your disposal.

**Usage**

```
{get_users parameters}
```

It can use following parameters

| Parameter Name | **Options**                                                                                                                                                                                                                                                                                                                                    |
| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| assign         | Store the result(Array) to this variable                                                                                                                                                                                                                                                                                                       |
| ban            | <p>Check user ban status:</p><ul><li>yes</li><li>no</li></ul>                                                                                                                                                                                                                                                                                  |
| category       | <p>Specific category users. Multiple categories should be separated with comma ‘,’:</p><ul><li>Category ID.</li></ul>                                                                                                                                                                                                                          |
| count\_only    | <p>Set to true if you only want to count result:</p><ul><li>true</li><li>false</li></ul>                                                                                                                                                                                                                                                       |
| date\_span     | <p>Get users for specific time frame:</p><ul><li>all\_time</li><li>today</li><li>yesterday</li><li>this\_week</li><li>last\_week</li><li>this\_month</li><li>last\_month</li><li>this\_year</li><li>last\_year</li></ul>                                                                                                                       |
| email          | <p>Get user of provided email:</p><ul><li>User Email</li></ul>                                                                                                                                                                                                                                                                                 |
| exclude        | <p>Exclude user from result:</p><ul><li>User ID</li></ul>                                                                                                                                                                                                                                                                                      |
| featured       | <p>Get featured users:</p><ul><li>yes</li><li>no</li></ul>                                                                                                                                                                                                                                                                                     |
| gender         | <p>Get users of specific gender:</p><ul><li>female</li><li>male</li></ul>                                                                                                                                                                                                                                                                      |
| level          | <p>Get users of specific level:</p><ul><li>Level ID</li></ul>                                                                                                                                                                                                                                                                                  |
| limit          | <p>Number of results you want:</p><ul><li>Numercial Figure</li></ul>                                                                                                                                                                                                                                                                           |
| order          | <p>Sort your result. You also need to tell how to order your result. asc OR desc, e.g ‘username desc’</p><ul><li>userid</li><li>username</li><li>usr\_status</li><li>ban\_status</li><li>sex</li><li>doj</li><li>profile\_hits</li><li>subscribers</li><li>rating</li><li>total\_videos</li><li>total\_groups</li><li>featured\_date</li></ul> |
|                |                                                                                                                                                                                                                                                                                                                                                |
| status         | <p>Check your user status:</p><ul><li>Ok</li><li>ToActivate</li></ul>                                                                                                                                                                                                                                                                          |
| userid         | <p>Get user of provided ID:</p><ul><li>User ID</li></ul>                                                                                                                                                                                                                                                                                       |
| username       | <p>Get user of provided username:</p><ul><li>Username</li></ul>                                                                                                                                                                                                                                                                                |

#### Examples

**Example 1**

```
{get_users assign=month_users date_span="this_month " status="Ok" order=" doj asc"}
```

Above code will get users of current month but only those with status of “Ok” and order according to their date-of-joined from oldest to latest. Function returned an array which is stored in {$month\_users} variable. Time to loop through array and display our users.

```
{section name=mon_urs from=$month_users}
	{include file="$style_dir/blocks/user.html" user=$month_users[mon_usrs]}
{/section}
```

\[post\_link id=”199″] and \[post\_link id=”237″]

**Example 2**

```
{get_users assign=featured_user limit=1 featured="yes" order=RAND()}
```

This code will get 1 featured user randomly out of all featured users. To display see following code

```
{section name=feat_user from=$featured_user}
	{include file="$style_dir/blocks/user.html" user=$featured_user[feat_user]}
{/section}
```

![](https://clipbucket.com/docs/wp-content/plugins/wp-postratings/images/loading.gif)Loading...


# 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         | <p>Get active videos:</p><ul><li>yes</li><li>no</li></ul>                                                                                                                                                                                                   |
| broadcast      | <p>Type of video:</p><ul><li>public</li><li>private</li></ul>                                                                                                                                                                                               |
| category       | <p>Specific category videos. Multiple categories should be separated with comma ‘,’:</p><ul><li>Category ID.</li></ul>                                                                                                                                      |
| count\_only    | <p>Set to true if you only want to count result:</p><ul><li>true</li><li>false</li></ul>                                                                                                                                                                    |
| date\_span     | <p>Get videos for specific time frame:</p><ul><li>all\_time</li><li>today</li><li>yesterday</li><li>this\_week</li><li>last\_week</li><li>this\_month</li><li>last\_month</li><li>this\_year</li><li>last\_year</li></ul>                                   |
| exclude        | <p>Exclude video from result:</p><ul><li>Video ID</li></ul>                                                                                                                                                                                                 |
| featured       | <p>Get featured video:</p><ul><li>yes</li><li>no</li></ul>                                                                                                                                                                                                  |
| limit          | <p>Number of results you want:</p><ul><li>Numercial Figure</li></ul>                                                                                                                                                                                        |
| nouser         | <p>It will exclude provided userid’s videos from result:</p><ul><li>User ID</li></ul>                                                                                                                                                                       |
| order          | <p>Sort your result. You also need to tell how to order your result. asc OR desc, e.g ‘videoid desc’</p><ul><li>videoid</li><li>title</li><li>date\_added</li><li>views</li><li>rating</li><li>last\_viewed</li><li>featured\_date</li><li>RAND()</li></ul> |
| show\_related  | <p>Set to if you want to show related videos. For this to work properly, also provide title & tags:</p><ul><li>true</li><li>false</li></ul>                                                                                                                 |
| status         | <p>Video Status:</p><ul><li>Successful</li><li>Processing</li><li>Failed</li></ul>                                                                                                                                                                          |
| tags           | <p>Video Tags. Multiple tags should be separated with comma ‘,’:</p><ul><li>Tags</li></ul>                                                                                                                                                                  |
| title          | <p>Video Title:</p><ul><li>Title</li></ul>                                                                                                                                                                                                                  |
| user           | <p>User specific videos:</p><ul><li>User ID</li></ul>                                                                                                                                                                                                       |
| videoid        | <p>Specific video with video id:</p><ul><li>Video ID</li></ul>                                                                                                                                                                                              |
| videokey       | <p>Specific video with video key:</p><ul><li>Video Key</li></ul>                                                                                                                                                                                            |

#### 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}
```

![](https://clipbucket.com/docs/wp-content/plugins/wp-postratings/images/loading.gif)Loading...


# Users

## Fetches the users

<mark style="color:blue;">`GET`</mark> `https://user.vodlix.com`

#### Request Body

| Name | Type   | Description |
| ---- | ------ | ----------- |
|      | String |             |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}


