get_videos()


Description : Get videos in ClipBucket

Parameters


[array] $params :

An array of parameters to fetch videos

limit : Put a limit on how many videos to fetch
order : Order to display videos in
active : Fetch active videos only
status : Fetch videos with specific status
broadcast : Fetch videos with specific broadcast options
category : Fetch videos with specific category
date_span : Fetch videos from specific timespan
user : Fetch videos of specific user
nonuser : Exclude videos of specific user
editor_pick : Include or exclude editor pick videos
mass_embed_status : Fetch videos with specific mass embed status
tags : Fetch videos with matching tags
title : Fetch videos with matching titles
featured : Include or exclude featured videos
videoid : Fetch videos by video id
videoids : Fetch videos by an array of videoids
videokey : Fetch videos by videokey
exclude : Videos ids to be excluded from results
duration : Fetch videos with specific duration
filename : Fetch videos with specific filename
cond : Apply additional condition to query
count_only : Get number of videos only
show_related : Get related videos as well
assign : assign for smarty usage
pr : Print videos data

Function usage

											
												<?php $videos = get_videos($params); ?>
											
										

Examples :


Get most popular videos

											
												{$videos = get_videos(["order" =>"views DESC", "limit" =>5])}
{foreach $videos as $video}
{include file="$style_dir/blocks/video.html"}
{/foreach}
											
										

Get most recent videos

											
												{$videos=get_videos(["order" =>" date_added DESC", "limit" =>5])}
{foreach $videos as $video}
{include file="$style_dir/blocks/video.html"}
{/foreach}
											
										

Get random videos

											
												{$videos=get_videos(["order" =>" Rand()", "limit" =>5])}
{foreach $videos as $video}
{include file="$style_dir/blocks/video.html"}
{/foreach}
											
										

Display active videos only

											
												{$videos=get_videos(["active" =>" yes", “order” => “views DESC” , "limit" =>5])}
{foreach $videos as $video}
{include file="$style_dir/blocks/video.html"}
{/foreach}
											
										

Display videos from multiple categories

											
												{$videos=get_videos(["Category" =>" 19", "limit" =>5])}
{foreach $videos as $video}
{include file="$style_dir/blocks/video.html"}
{/foreach}
											
										

Display top rated videos

											
												{$videos=get_videos(["order" =>" rating DESC ", "limit" =>5])}
{foreach $videos as $video}
{include file="$style_dir/blocks/video.html"}
{/foreach}
											
										

Display only public videos

											
												{$videos=get_videos(["private" =>" no ", "limit" =>5])}
{foreach $videos as $video}
{include file="$style_dir/blocks/video.html"}
{/foreach}
											
										

Display videos from specific user

											
												{$videos=get_videos(["user " =>" 15 ", "limit" =>5])}
{foreach $videos as $video}
{include file="$style_dir/blocks/video.html"}
{/foreach}
											
										

Display video by videoid

											
												{$videos=get_videos(["videoid" =>" 291 ", "limit" =>5])}
{foreach $videos as $video}
{include file="$style_dir/blocks/video.html"}
{/foreach}
											
										

Exclude a video by videoid

											
												{$videos=get_videos(["date_span" =>" today ", “exclude” => “291”, "limit" =>5])}
{foreach $videos as $video}
{include file="$style_dir/blocks/video.html"}
{/foreach}
											
										

Display only successfully converted videos

											
												{$videos=get_videos(["successful" =>" yes ", “order” => “views” , "limit" =>5])}
{foreach $videos as $video}
{include file="$style_dir/blocks/video.html"}
{/foreach}
											
										

video_exists()


Description : Check if a video exists using videoid

Parameters


[integer] $vid :

Videoid that you want to get details for

Function usage

											
												<?php
	global $cbvid; 
	$cbvid->video_exists($vid);
?>
											
										

get_video_details()


Description : Get all details about a single video

Parameters


[integer] $vid :

ID of video that you want to fetch all details for

Function usage

											
												<?php
	global $cbvid; 
	$cbvid->get_video_details($vid);
?>
											
										

delete_video()


Description : Delete a video using videoid

Parameters


[integer] $vid :

ID of video to be deleted

Function usage

											
												<?php
	global $cbvid; 
	$cbvid->delete_video($vid);
?>
											
										

get_video_owner()


Description : Get uploader of video

Parameters


[integer] $vid :

Id of video to get uploader for

Function usage

											
												<?php
	global $cbvid; 
	$cbvid->get_video_owner($vid);
?>
											
										

is_video_owner()


Description : Check if a user is uploader of a video

Parameters


[integer] $vid :

Id of video to run check on

[integer] $uid :

Id of user to check video against

Function usage

											
												<?php
	global $cbvid; 
	$cbvid->is_video_owner($vid, $uid);
?>
											
										

get_video_rating()


Description : Get ratings related data of a video

Parameters


[integer] $id :

Id of video to get rating data for

Function usage

											
												<?php
	global $cbvid; 
	$cbvid->get_video_rating($id);
?>
											
										

get_playlist_items()


Description : Get items of a playlist

Parameters


[integer] $playlist_id :

Id of playlist to get items of

[string] $order :

Order to apply on output results

[integer] $limit :

Limit to be applied on results

Function usage

											
												<?php
	global $cbvid; 
	$cbvid->get_playlist_items($playlist_id, $order, $limit);
?>
											
										

video_playable()


Description : Checks if video is playable or not

Parameters


[integer] $id :

Id of video to be checked for ability off playing

Function usage

											
												<?php 
	video_playable($id);
?>
											
										

get_thumb()


Description : Get thumbnail for a video

Parameters


[array] $vdetails :

All details of video for which thumb is to be fetched

[integer] $num :

Number of thumb to be retrieved e.g 1 or 3 or 4

[boolean] $multi :

If true, handles thumb for Multiserver

[boolean] $count :

If true, returns how many thumbs of video are found

[boolean] $return_full_path :

Output will include full file path if this is true

[boolean] $return_big :

If true, best quality thumb will be returned

[string] $size :

Specify the size that you wish to fetch

Function usage

											
												<?php 
	get_thumb($vdetails, false, false, false, false, 'big');
?>
											
										

vkey_exists()


Description : Check if video key exists

Parameters


[string] $key :

Key of video to be checked

Function usage

											
												<?php 
	vkey_exists($vkey); 
?>
											
										

file_name_exists()


Description : Check if file name exists

Parameters


[string] $name :

Name of file to run check against

Function usage

											
												<?php 
	vkey_exists($name);
?>
											
										

call_watch_video_function()


Description : calls are necessary video functions on watch video page

Parameters


[array] $vdo :

An array with all details of video on which functions are to be called

Function usage

											
												<?php 
	call_watch_video_function($vdo);
?>
											
										

call_delete_video_function()


Description : calls are necessary video functions on deleting a video

Parameters


[array] $vdo :

An array with all details of video on which functions are to be called

Function usage

											
												<?php 
	call_delete_video_function($vdo);
?>
											
										

call_download_video_function()


Description : calls are necessary video functions on download of a video

Parameters


[array] $vdo :

An array with all details of video on which functions are to be called

Function usage

											
												<?php 
	call_download_video_function($vdo);
?>
											
										

is_phone_user()


Description : Check if a user is viewing website from mobile

Parameters


[array] $data :

An array with all data of user platform

Function usage

											
												<?php 
	is_phone_user($data);
?>
											
										

is_phone_user Function Example

											
												<?php 
	$data = get_browser_details();
	is_phone_user($data);
?>
											
										

pre_upload()


Description : Run pre upload functions to ensure video will upload

Parameters


NONE

Function usage

											
												<?php 
	pre_upload();
?>
											
										

connect()


Description : Connect to a database to use with ClipBucket

Parameters


[string] $host :

Host of database that you are trying to connect to e.g localhost

[string] $name :

Name of database that you are trying to connect to

[string] $uname :

Username of database that you need to make connection to

[mixed] $pwd :

Password of database you are trying to connect to

Function usage

											
												<?php 
	$db->connect($host,$name,$uname,$pwd);
?>
											
										

Function example

											
												<?php 
	global $db;
	$connection = $db->connect($host,$name,$uname,$pwd);
	if ($connection) {
		echo “Connected to database successfully”;
	} else {
		echo “Something went wrong connecting to database”;
	}
?>
											
										

select()


Description : Select data from connected database with a custom select query

Parameters


[string] $query :

Query to run in MySQL

Function usage

											
												<?php 
	$db->_select($query);
?>
											
										

Function example

											
												<?php 
	global $db;
	$query = “SELECT site_title FROM cb_config WHERE configid != ''”;
	$data = $db->_select($query);

	// prints website title
	$data['site_title'];

?>
											
										

select()


Description : select data from connected database with dynamic query

Parameters


[string] $tbl :

Name of table to select data from

[string] $fields :

* or name of fields to select

[string] $cond :

Custom condition to apply on MySQL query e.g where id == 200

[string] $limit :

Number of results to fetch e.g 10,15

[string] $order :

Order to sort results in

[string] $ep :

Extra parameters to be attached at end of query

Function usage

											
												<?php 
	$db->select($tbl, 'title', $cond, '10,20');
?>
											
										

Function example

											
												<?php 
	// prints all users from database
	global $db;
	$users = $db->select(tbl('users'),'username','userid != ""');
	foreach ($users as $userKey => $user) {
	    pr($user,true);
	}
?>
											
										

count()


Description : count number of rows in given table

Parameters


[string] $tbl :

Name of table to count values from

[string] $fields :

Fields that you want to run count on

[string] $cond :

Additional condition to be attached at end of MySQL query

Function usage

											
												<?php 
	$db->count($tbl,'videoid');
?>
											
										

Function usage

											
												<?php 
	global $db;
	$counted = $db->count(tbl('video'),'videoid','title != "test video"');
	// prints number of rows
	pr($counted,true);
?>
											
										

Execute()


Description : Execute a MySQL query

Parameters


[string] $query :

Query to run

Function usage

											
												<?php 
	$db->Execute($query);
?>
											
										

Function usage

											
												<?php 
	global $db;
	$db->Execute(“SELECT * from cb_config”);
?>
											
										

update()


Description : Update a table in MySQL

Parameters


[string] $tbl :

Table to update values in

[array] $flds :

Array with names of all fields to be updated

[array] $vls :

Array with all values to be updated

[string] $cond :

Additional condition to be added to query

[string] $ep :

Additional parameters to add to end of query

Function usage

											
												<?php 
	$db->update($tbl,$flds,$vls,$cond);
?>
											
										

Function usage

											
												<?php 
	global $db;
	$flds = array('username','email');
	$vals = array('blackwolf','admin@something.com');
	$cond = 'username != “”);
	$db->update(tbl('config'),$flds,$vls,$cond);
?>
											
										

db_update()


Description : Update database with an associative array

Parameters


[string] $tbl :

Table to be updated

[array] $fields :

An associative array with fields and values

[string] $cond :

Condition to apply at end of query

Function usage

											
												<?php 
	$db->db_update($tbl, $fields, $cond);
?>
											
										

Function example

											
												<?php 
	global $db;
	$tbl = 'table_name';
	$fields = array(
		'field_name'=>'field_value',
		'field_name2'=>'field_value2'
		);
	$cond = 'configid != 201';
	$db->db_update(tbl($tbl),$fields,$cond);
?>
											
										

delete()


Description : Delete an element from database

Parameters


[string] $tbl :

Table to be updated

[array] $flds :

An associative array with fields and values

[array] $vls :

Array with values to delete

[string] $ep :

Extra parameter to attach at end of query

Function usage

											
												<?php 
	$db->delete($tbl, $flds, $vls);
?>
											
										

Function example

											
												<?php 
	global $dbl
	$tbl = 'users';
	$flds = array('username','email');
	$vals = array('jason','jason@gmail.com');
	$ep = 'userid != 212';
	$db->delete(tbl($tbl), $flds, $vals, $ep);
?>
											
										

insert()


Description : Insert data into database

Parameters



[string] $tbl :

Table to be updated

[array] $flds :

An associative array with fields and values

[array] $vls :

Array with values to insert

[string] $ep :

Extra parameter to attach at end of query

											
																							
										

Function usage

											
												<?php 
	$db->insert($tbl, $flds, $vls);
?>
											
										

Function example

											
												<?php 
	global $db;
	$tbl = 'users';
	$flds = array('social_ntwork','social_id');
	$vls = array('facebook','12582185');
	$db->tbl(tbl($tbl),$flds,$vls);
?>
											
										

db_insert()


Description : Insert value in database with associative array

Parameters


[string] $tbl :

Table to be updated

[string] $tbl :

Table to insert values into

[array] $fields :

An array with fields and values

Function usage

											
												<?php 
	$db->db_insert($tbl, $fields);
?>
											
										

Function example

											
												<?php 
	global $db;
	$table = 'users';
	$fields = array(
			'base_language' => 'eng',
			'height' => 'xfeet'
		);

	$db->db_update(tbl($table),$fields);
?>
											
										

insert_id()


Description : Get id of last inserted element

Parameters



NONE

Function usage

											
												<?php 
	$db->insert_id();
?>
											
										

create_session_key()


Description : Creates session key for user

Parameters


[string] $session :

Session to create key against

Function usage

											
												<?php 
	create_session_key($session, $pass); 
?>
											
										

login_user()


Description : Login a user into ClipBucket

Parameters


[string] $username :

Username of user to be logged in

[string] $password :

Password of user to be logged in

[boolean] $remember :

If true, user session will be maintained

Function usage

											
												<?php 
	login_user($username, $password, true);
?>
											
										

get_user_with_pass()


Description : Get all details of a user matching combination of username & password

Parameters


[string] $username :

Username of user to be logged in

[string] $pass :

Password of user to fetch

Function usage

											
												<?php 
	get_user_with_pass($username, $pass);
?>
											
										

is_banned()


Description : Check if a userid is banned

Parameters


[integer] $uid :

Userid of user to run check against

Function usage

											
												<?php 
	is_banned($userid);
?>
											
										

logout()


Description : Logout a user from

Parameters



NONE

Function usage

											
												<?php 
	logout();
?>
											
										

delete_user()


Description : Delete a user from ClipBucket

Parameters


[integer] $uid :

Userid of user to be deleted

Function usage

											
												<?php 
	delete_user($userid);
?>
											
										

remove_user_subscribers()


Description : Remove all subscribers of a user

Parameters


[integer] $uid :

Userid of user whose subscribers are to be removed

Function usage

											
												<?php 
	remove_user_subscribers($uid);
?>
											
										

GetUserData()


Description : Get all details of a user

Parameters


[integer] $id :

Id of user whose details you want to fetch

Function usage

											
												<?php 
	GetUserData($userid);
?>
											
										

increment_watched_vides()


Description : Increase number of videos a user has watched by 1

Parameters


[integer] $userid :

Id of user whose watched videos count is to be increased

Function usage

											
												<?php 
	increment_watched_vides($userid);
?>
											
										

avatar()


Description : Get avatar of a user

Parameters


[array] $udetails :

An array with all details of user

[string] $size :

Size of avatar

[integer] $uid :

Id of user

Function usage

											
												<?php 
	avatar($udetails, $size, $uid);
?>
											
										

add_comment()


Description : Get avatar of a user

Parameters


[string] $comment :

Comment that you would like to additional

[integer] $id :

Id of element that you want add comment to

[string] $reply_to :

Null by default, id of comment that you are replying to

[string] $type :

Type of item that you are commenting at

Possible options are :

collection
video
photo

Function usage

											
												<?php 
	add_comment($comment, $id, $reply, $type);
?>
											
										

delete_comment()


Description : Delete a comment

Parameters


[integer] $id :

Id of comment to be deleted

Function usage

											
												<?php 
	delete_comment($comment_id);
?>
											
										

get_user_vids()


Description : Get videos of a user

Parameters


[integer] $uid :

Id of user that you want to get videos of

[string] $cond :

Additional condition to apply on query

[boolean] $count_only :

If true, returns number of videos only

Function usage

											
												<?php 
	get_user_vids($uid, $cond, false);
?>
											
										

signup_user()


Description : Signup a user into ClipBucket

Parameters


[array] $array :

An array with paramters

Below are required fields :

username : username of user
email : email address of the user
password : password of user
cpassword : reconfirmation of user password
dob : Date of birth of user
country : Country of user
category : Category of user

[boolean] $send_signup_email :

If true, sends an email to user right after successful signup

Function usage

											
												<?php 
	signup_user($data,true);
?>
											
										

Function usage

											
												<?php 
	$data = array(
	    'username' => 'blacowolf',
	    'email' => 'sasidbas@gmailc.om',
	    'password' => 'admin',
	    'cpassword' => 'admin',
	    'dob' => '1988-04-07',
	    'country' => 'PK',
	    'gender' => 'Male',
	    'category' => '1',
	    'agree' => 'yes',
	    'signup' => 'signup'
	);

	signup_user($data, true);
?>
											
										

get_users()


Description : Get users from database

Parameters


[array] $params :
An array of parameters

limit : Limit of how many users to fetch
order : Order to display output results in
ban : Include or exclude banned users
status : Fetch users with specific status
category : Fetch users from specific categories
date_span : Fetch users from specific time zone
featured : Include or exclude featured users
username : Fetch users by username
email : Fetch users by email
exclude : User id of users to be excluded
userid : Fetch user by userid
gender : Fetch user by specific gender
level : Fetch user of specific levels
cond : Add additional condition to query
count_only : Set true if you only want to count total users
assign : If true, values will be assigned for smarty usage


Function usage

											
												<?php 
	get_users($params);
?>
											
										

friendship_status()


Description : Get status of friendship between two users

Parameters



[integer] $logged_in_user :

Id of user that is currently logged in

[integer] $channel_user :

Id of user that you are checking against


Function usage

											
												<?php 
	friendship_status(userid(), $channel_user);
?>
											
										

get_website_configurations()


Description : Return all of website configuration

Parameters


NONE

Function usage

											
												<?php 
	$videos = get_website_configurations();
 ?>
											
										

create_dated_folder()


Description : Create date based folders

Parameters


[string] $headFolder :

Directory to create folders into

Function usage

											
												<?php 
	create_dated_folder($dir);
 ?>
											
										

prettyNum()


Description : Pretty print a number

Parameters


[integer] $num :

Number to be pretty printed

Function usage

											
												<?php 
	prettyNum($num);
 ?>
											
										

photo_exists()


Description : Checks if a photo exists

Parameters


[integer] $id :

Id of photo that needs to be checked for existence

Function usage

											
												<?php 
	photo_exists($id);
 ?>
											
										

get_photo()


Description : Get all details of a photo

Parameters


[integer] $pid :

Photo id that you need to fetch details for

Function usage

											
												<?php 
	get_photo($pid);
 ?>
											
										

get_photos()


Description : Get photos from database

Parameters


[array] $p :

An array of parameters

order : Order to show photos in
limit : Number of photos to be fetched
broadcast : Fetch specific type of photos
pid : Fetch photo by id
key : Fetch photo by key
filename : Fetch photo by filename
extension : Fetch photos with specific extension
date_span : Fetch photos from specific date span
featured : Include or exclude featured photos
user : Fetch photos of a specific user
exclude : Exclude photos
title : Fetch photos matching a title
tags : Fetch photos matching tags
extra_cond : Add additional condition on query
get_orphans : Include or exclude orphan photos
show_related : If true, fetches related photos
collection : Fetch photos of specific collection
count_only : Set it to true, if you only want to count
assign : If true, assigns results for smarty usage

Function usage

											
												<?php 
	get_photos($p);
 ?>
											
										

pkey_exists()


Description : Check if photo key exists

Parameters


[string] $key :

Key to run checks against

Function usage

											
												<?php 
	pkey_exists($key);
 ?>
											
										

delete_photo()


Description : Delete a photo from ClipBucket

Parameters


[integer] $id :

ID of photo to be deleted

Function usage

											
												<?php 
	delete_photo($id);
 ?>
											
										

insert_photo()


Description : Insert a photo into ClipBucket database

Parameters


[array] $array :

An array with details

insertPhoto
title
file_name
collection_id
ext
photo_title
photo_description
photo_tags
server_url
active
folder
filename

Function usage

											
												<?php 
	insert_photo($array);
 ?>
											
										

Function example

											
												<?php 
	$data = array(
		'title' => '1443451481-6a9ee-9',
		'file_name' => '1475233122373007',
		'collection_id' => '19',
		'ext' => 'jpg',
		'photo_title' => 'no-tag',
		'photo_description' => 'no-tag',
		'photo_tags' => 'no-tag',
		'server_url' => '',
		'active' => '1',
		'folder' => '2016/09/30',
		'filename' => '1475233122373007'
	);

	insert_photo($data);
 ?>
											
										

throw_error()


Description : Thrown an exception error

Parameters


[string] $message :

Error message to be shown

[string] $pointer :

Pointer name (array index) to set

Function usage

											
												<?php 
	throw_error($msg, false);
 ?>
											
										

curPageURL()


Description : Fetch complete url of currently active page

Parameters


NONE

Function usage

											
												<?php 
	// outputs whatever page you call it at
	curPageURL();
 ?>
											
										

Replacer()


Description : Cleans a string to ensure it is safe for MySQL

Parameters


[string] $string :

String to be cleaned

Function usage

											
												<?php 
	Replacer($string);
 ?>
											
										

Function example

											
												<?php 
	$string = “hello world <alert> hello </alert><php?”;
	$cleaned = Replacer($string);

 ?>
											
										

Replacer()


Description : Cleans a string to ensure it is safe for MySQL

Parameters


[string] $string :

String to be cleaned

Function usage

											
												<?php 
	Replacer($string);
 ?>
											
										

clean()


Description : Clean a string with option to remove HTML

Parameters


[string] $string :

String to be cleaned

[boolean] $allow_html :
If set to true, HTML will not be replaced when cleaning string

Function usage

											
												<?php 
	clean($string, true);
 ?>
											
										

Function usage

											
												<?php 
	$string = '<h1>Hello</h1>Now it works';
	$cleaned = clean($string, true);
 ?>
											
										

pass_code()


Description : Creates password hash for ClipBucket

Parameters


[string] $string :

Password string to be turned into password hash

Function usage

											
												<?php 
	pass_code('your_password_here');
 ?>
											
										

mysql_clean()


Description : Ensures that a string is MySQL safe and cleans parts that are necessary

Parameters


[string] $id :

String to be cleaned

[boolean] $replacer :
Does additional cleaning if true

Function usage

											
												<?php 
	mysql_clean($query);
 ?>
											
										

escape_gpc()


Description : Escape characters with backslashes

Parameters


[string] $in :

String to be cleaned

Function usage

											
												<?php 
	escape_gpc($string);
 ?>
											
										

RandomString()


Description : Generates a random string of given length

Parameters


[integer] $length :

Length of random string to be generated

Function usage

											
												<?php 
	RandomString(10);
 ?>
											
										

cbmail()


Description : Send an email from ClipBucket

Parameters


[array] $array :

An array of paramters

$array['content'] : Body of email
$array['subject'] : Subject of email
$array['to'] : Recipient of email
$array['from'] : Sender of email
$array['to_name'] : Recipient name
$array['from_name'] : Sender name

Function usage

											
												<?php 
	cbmail($array);
 ?>
											
										

Function usage

											
												<?php 
	$mailData = array();
	$mailData['content'] = "This is sample mail";
	$mailData['subject'] = "Sample mail subject";
	$mailData['to'] = 'recipient@gmail.com';
	$mailData['from'] = 'sender@gmail.com';
	$mailData['to_name'] = 'Fahad Abbass';
	$mailData['from_name'] = 'Saqib Razzaq';

	cbmail($mailData);
 ?>
											
										

send_email()


Description : Send email more simply using cbmail function

Parameters


[string] $from :
Email address of sender

[string] $to :
Email address of recipient

[string] $subj :
Subject of email to be sent

[string] $message :
Body of email to be sent

Function usage

											
												<?php 
	send_email($from,$to,$subj,$message);
 ?>
											
										

Function usage

											
												<?php 
	$from = 'sender@gmail.com';
	$to = 'recipient@gmail.com';
	$subj = 'Subject of email';
	$message = 'Sandwiches are silly';
	send_email($from,$to,$subj,$message);
 ?>
											
										

wrap_email_content()


Description : Wrap contents of email into HTML body tag

Parameters


[string] $content :
Content to be wrapped in and tags

Function usage

											
												<?php 
	wrap_email_content($content);
 ?>
											
										

Function usage

											
												<?php 
	$string = “this goes my string”;
	wrap_email_content($string);
 ?>
											
										

GetName()


Description : Get base name of any file

Parameters


[string] $file :
Path to file to get name of

Function usage

											
												<?php 
	GetName($file);
 ?>
											
										

Function usage

											
												<?php 
	$file = '/var/www/html/some_directory/yourfile.mp4';

	// outputs yourfile
	GetName($file);
 ?>
											
										

GetExt()


Description : Get extension of a file

Parameters


[string] $file :
Full path to file to get extension of


Function usage

											
												<?php 
	GetExt($file);
 ?>
											
										

Function usage

											
												<?php 
	
	$file = '/home/dean_ambrose.mp4';

	// outputs mp4
	GetExt($file);
 ?>
											
										

SetTime()


Description : Convert seconds into hour:minutes:seconds format

Parameters


[string] $sec :
Second to be converted into time format


Function usage

											
												<?php 
	SetTime($seconds);
 ?>
											
										

isValidText()


Description : Checks if given is a valid TEXT (string)

Parameters


[mixed] $text :
Text to be checked for validation



Function usage

											
												<?php 
	isValidText($text);
 ?>
											
										

isValidEmail()


Description : Checks if given is a valid email address

Parameters


[string] $email :
Email to tested and validated



Function usage

											
												<?php 
	isValidEmail('your_email@gmail.com');
 ?>
											
										

htmlspecialchars_decode()


Description : Decode html special characters

Parameters


[string] $text :
Text to be decoded

Function usage

											
												<?php 
	htmlspecialchars_decode($text);
 ?>
											
										

get_directory_size()


Description : Get size of a directory

Parameters


[string] $path :
Path of directory

Function usage

											
												<?php 
	get_directory_size($path);
 ?>
											
										

formatfilesize()


Description : Formats file size in human friendly way

Parameters


[integer] $data :
Size to be formated in friendly manner

Function usage

											
												<?php 
	formatfilesize($size);
 ?>
											
										

Function usage

											
												<?php 
	$size = 10214124;
	formatfilesize($size);
 ?>
											
										

shell_output()


Description : Executes an external program and get output

Parameters


[string] $cmd :
Command to be executed

Function usage

											
												<?php 
	shell_output($cmd);
 ?>
											
										

Function example

											
												<?php 
	$command = 'php –version';
	$data = shell_output($command);

	// will printout your php version info
	pr($data,true);

 ?>
											
										

getComments()


Description : Get comments of a video or photo

Parameters


[array] $params :
An array of paramters

$params['order'] : Listing order of comments
$params['limit'] : Limit of comments to fetch
$params['type'] : Type of post [ photo or video ]

Function usage

											
												<?php
    getComments($params);
 ?>
											
										

Function usage

											
												<?php 
	$params = array();
	$params['order'] = 'RAND()';
	$params['limit'] = '0,20';
	$params['type'] = 'v';
	$comments = getComments($params);
 ?>
											
										

getSmartyComments()


Description : Fetches comments and assigns them for using in Smarty

Parameters


[array] $params :
An array of paramters

$params['order'] : Listing order of comments
$params['limit'] : Limit of comments to fetch
$params['type'] : Type of post [ photo or video ]

Function usage

											
												<?php
    getSmartyComments($params);
 ?>
											
										

Function usage

											
												<?php 
	$params = array();
	$params['order'] = 'RAND()';
	$params['limit'] = '0,20';
	$params['type'] = 'v';
	getSmartyComments($params);
 ?>
											
										

getAd()


Description : Get an advertisement with paramters

Parameters


[array] $params :
An array with all paramters

$params['style'] : custom styling to apply on advertisement div
$params['class'] : additional class to be added on advertisement
$params['align'] : align position of advertisement
$params['place'] : advertisement place to fetch

Function usage

											
												<?php
    getAd($params);
 ?>
											
										

Function example

											
												<?php 
	$params = array();
	$params['style'] = 'margin-top:20px;';
	$params['class'] = 'your_class_here';
	$params['align'] = 'left';
	$params['place'] = 'ad_728x90';
	getAd($params);
 ?>
											
										

getCategoryList()


Description : Get a list of categories

Parameters


[array] $params :
An array of paramters

$params['type'] : type of content that we are fetching categories for

Function usage

											
												<?php
    getCategoryList($params);
 ?>
											
										

Function example

											
												<?php 
	$params = array();
	$params['type'] = 'users';
	$categories  = getCategoryList($params);
 ?>
											
										

dbInsert()


Description : Insert values into database

Parameters


[string] $tbl :
Table to insert values into

[array] $flds :
Array of fields to be inserted

[array] $vls :
Array of values to be inserted

[string] $ep :
Extra parameter to be attached to end of string

Function usage

											
												<?php
    dbInsert($tbl, $fields, $values, $ep);
 ?>
											
										

Function example

											
												<?php 
	$tbl = 'users';
	$fields = array('userColor');
	$values = array('red');
	dbInsert(tbl($tbl), $fields, $values);
 ?>
											
										

dbUpdate()


Description : Update values into database

Parameters


[string] $tbl :
Table to update values into

[array] $flds :
Array of fields to be updated

[array] $vls :
Array of values to be updated

[string] $cond :
Condition to be applied on MySQL query

[string] $ep :
Extra paramter to be attached to end of string

Function usage

											
												<?php
    dbUpdate($tbl, $flds, $vls, $cond, $ep);
 ?>
											
										

Function example

											
												<?php 
	$flds = array('username','email');
	$vals = array('blackwolf','admin@something.com');
	$cond = 'username != “”);
	dbUpdate(tbl('config'),$flds,$vals,$cond);
 ?>
											
										

dbDelete()


Description : Deletes an element from database

Parameters


[string] $tbl :
Table to delete values from

[array] $flds :
An array of fields to be deleted

[array] $vls :
An array of values to be deleted

[string] $ep :
Additional parameter at end of query

Function usage

											
												<?php
    dbDelete($tbl, $flds, $vls, $ep);
 ?>
											
										

Function example

											
												<?php 
	$tbl = 'users';
	$flds = array('username','email');
	$vals = array('jason','jason@gmail.com');
	$ep = 'userid != 212';
	dbDelete(tbl($tbl), $flds, $vals, $ep);
 ?>
											
										

dbselect()


Description : Select data from database

Parameters


[string] $tbl :
Table to select data from

[string] $fields :
Fields to select from database

[string] $cond :
Condition to apply on MySQL

[string] $limit :
Limit to be applied on results

[string] $order :
Order to display results in

[string] $p :
Extra parameter to be attached at end of string


Function usage

											
												<?php
    dbselect($tbl, $fields, $cond, $limit, $order, $p);
 ?>
											
										

pr()


Description : Print an array or text in a nice & clean way

Parameters


[string] $text :
Array or text to be pretty printed


[boolean] $pretty :
False by default, prints pretty string if true

Function usage

											
												<?php 
	pr($array,true);
 ?>
											
										

Function usage

											
												<?php 
	$array('animals','people','humans');
	pr($array,true);
 ?>
											
										

pex()


Description : Pretty prints an array or text exits right after

Parameters


[string] $text :
Text or array to be pretty printed

[boolean] $pretty :
False by default, prints pretty string if true

Function usage

											
												<?php 
	pex($array,true);
 ?>
											
										

FUNC()


Description : Call a php function from smarty without paramters

Parameters


[array] $params :
An array with parameter

$params['name'] : name of function to be called

Function usage

											
												<?php 
	FUNC($params);
 ?>
											
										

userid()


Description : Returns userid of currently logged in user

Parameters


NONE

Function usage

											
												<?php 
	userid();
 ?>
											
										

Function usage

											
												<?php 
	$userid = userid();
	echo “logged in user is “.$userid;
 ?>
											
										

username()


Description : Get username of currently logged in user

Parameters


NONE

Function usage

											
												<?php 
	user_name();
 ?>
											
										

has_access()


Description : Checks if currently logged in user has certain access or not

Parameters



[string] $access :
Type of access to check again

[boolean] $check_only :
False by default, returns boolean

[boolean] $verify_logged_user :
Verifies that user is currently logged in or not

Function usage

											
												<?php 
	has_access($access,true);
 ?>
											
										

is_valid_syntax()


Description : Check if syntax if given value is valid

Parameters



[string] $code :
Codename of field you are going to check

[string] $text :
Value to check against

Function usage

											
												<?php 
	// checking if current user has admin access
	if (has_access('admin_access') {
		echo “yes, user is admin”;
	} else {
		echo “na, he is just another guy”;
	}
 ?>
											
										

Function usage

											
												<?php 
	$email = 'admin@website.com';
	$validation_check = is_valid_syntax('email',$email);
 ?>
											
										

is_valid_value()


Description : Apply a function on a given value

Parameters



[string] $func :
Name of function to be called

[string] $val :
Value to call function on

Function usage

											
												<?php 
	is_valid_value($func, $val);
 ?>
											
										

Function usage

											
												<?php 
	$val = array('jazib','ali','fahad','saqib');
	$func = 'pr';
	is_valid_value($func, $val);
 ?>
											
										

apply_func()


Description : Call an array of functions with a paramter

Parameters



[string] $func :
Array of functions to be called

[string] $val :
Value to be used as parameter for calling those functions

Function usage

											
												<?php 
	apply_func($func, $val);
 ?>
											
										

Function usage

											
												<?php 
	$funcs = array('pr','pex');
	$user = userid();
	apply_func($funcs, $user);
 ?>
											
										

validate_collection_category()


Description : Check if given is valid collection category

Parameters



[array] $array :
An array with category

Function usage

											
												<?php 
	validate_collection_category($cat);
 ?>
											
										

Function usage

											
												<?php 
	$cat = array('category'=>'test');
	validate_collection_category($cat);
 ?>
											
										

avatar()


Description : Get avatar of a user

Parameters



[array] $param :
An array of parameters

$param['details'] : all details of user to fetch avatar of
$param['size'] : size of avatar
$param['uid'] : user id of user to get avatar of

Function usage

											
												<?php 
	avatar($params);
 ?>
											
										

Function usage

											
												<?php 
	$params = array();
	$params['details'] = $userquery->get_user_details(1);
	$params['size'] = '200x300';
	$params['uid'] = 1;
	avatar($params);
 ?>
											
										

php_path()


Description : Returns PHP path of system

Parameters


NONE

Function usage

											
												<?php 
	php_path();
 ?>
											
										

get_binaries()


Description : Gets binaries for ClipBucket

Parameters


[array / string] $path :
An array with paramters or a string

Function usage

											
												<?php 
	get_binaries('ffmpeg');

	Other options are :

	php
	mp4box
	media_info
	i_magick
	ffprobe_path
	flvtool2
	ffmpeg

 ?>
											
										

unhtmlentities()


Description : Function to call when htmlspecialchars_decode doesn't work

Parameters


[string] $string :
String to be decoded

Function usage

											
												<?php 
	unhtmlentities($string);
 ?>
											
										

bgexec()


Description : Executes a command in background

Parameters


[string] $cmd :
Command to be executed

Function usage

											
												<?php 
	bgexec($commnad);
 ?>
											
										

array_find()


Description : Function used to get array value if you know partial value of array and wants to know complete ,value of an array, this function is being used then

Parameters


[string / int] $needle :
Element to search for

[array] $haystack :
Array to find item inside

Function usage

											
												<?php 
	array_find($needle, $haystack);
 ?>
											
										

get_category()


Description : Get details of a category using category id

Parameters


[integer] $id :
Id of category to be fetched

Function usage

											
												<?php 
	get_category($id);
 ?>
											
										

get_user_vids()


Description : Count total videos uploaded by a user

Parameters


[integer] $uid :
User id to count videos formated

[string] $cond :
Additional condition to apply at end of query

Function usage

											
												<?php 
	get_user_vids($uid,$cond);
 ?>
											
										

template_files()


Description : Include HTML structure for current page

Parameters


[string] $file :
Name of file to include

[string] $folder :
False by default, folder that template file is in

[boolean] $follow_show_page :
True by default, decide if you want to follow $Cbucket->show_page or not

Function usage

											
												<?php 
	template_files('index.html');
 ?>
											
										

showpagination()


Description : Show pagination in ClipBucket

Parameters


[integer] $total :
Total number of pages found

[integer] $page :
Page number that you are currently on

[string] $link :
False by default, link to go to on clicking

[mixed] $extra_params :
Extra parameters to be applied

[string] $tag :
Format of pagination : #page# by default

Function usage

											
												<?php 
	paginate($total_pages,$page,$link,$extra_params,$tag);
 ?>
											
										

check_disallowed_user()


Description : Checks if user is disallowed or not

Parameters


[string] $username :
Username to be checked

Function usage

											
												<?php 
	check_disallowed_user('blackwolf');
 ?>
											
										

username_check()


Description : Runs a username through multiple cases to confirms its validation

Parameters


[string] $username :
Username to run checks against

Function usage

											
												<?php 
	username_check('crazzy_egg');
 ?>
											
										

user_exists()


Description : Check if a user already exists

Parameters


[string] $user :
Username to check for existence

Function usage

											
												<?php 
	user_exists('ned_stark');
 ?>
											
										

email_exists()


Description : Check if an email already exists

Parameters



[string] $email :
Email address to check for existence

Function usage

											
												<?php 
	email_exists('ned_stark@tower_of_joy.com');
 ?>
											
										

create_query_limitq()


Description : Create MySQL limit for query

Parameters



[string] $page :
Page that you are currently at

[string] $result :
Max results you want to show on page


Function usage

											
												<?php 
	create_query_limitq($page, $result);
 ?>
											
										

Function example

											
												<?php 
	$page = 20;
	$result = 10;
	create_query_limitq($page, $result);
 ?>
											
										

get()


Description : Read values of $_GET method

Parameters



[string] $val :
Value to read from $_GET

Function usage

											
												<?php 
	get('username');
 ?>
											
										

post_form_val()


Description : Read values from $_POST

Parameters


[string] $val :
Value to read from $_POST

Function usage

											
												<?php 
	post_form_val('something');
 ?>
											
										

request_form_val()


Description : Read values from $_REQUEST

Parameters


[string] $val :
Value to read from $_REQUEST

Function usage

											
												<?php 
	request_form_val('something');
 ?>
											
										

lang()


Description : Read a language dynamic string from language pack

Parameters


[string] $var :
Language code of translation to read

Function usage

											
												<?php 
	lang('upload');
 ?>
											
										

add_js()


Description : Add a javascript file into ClipBucket Js array

Parameters


[string / array] $files :
Single file path or an array with file paths to include

Function usage

											
												<?php 
	add_js($file);
 ?>
											
										

add_header()


Description : Add a file into ClipBucket header form plugin

Parameters


[string] $file :
File to be included

Function usage

											
												<?php 
	add_header($file);
 ?>
											
										

getConstant()


Description : Get value of a constant after running it through some checks

Parameters


[string] $constantName :
Name of constant that you need to get value of

Function usage

											
												<?php 
	getConstant('BASEDIR');
 ?>
											
										

call_view_channel_functions()


Description : Calls all necessary functions for view channel page

Parameters


[integer] $u :
Id of user whose channel is being vieweed

Function usage

											
												<?php 
	call_view_channel_functions($user_id);
 ?>
											
										

call_view_collection_functions()


Description : Call all necessary functions for view collection page

Parameters


[[array] $cdetails :
An array with all details of collection that is being viewed

Function usage

											
												<?php 
	call_view_collection_functions($udetails);
 ?>
											
										

increment_views()


Description : Increase views of an element by 1

Parameters


[integer] $id :
Id of element to increase views of

[string] $type :
Type of element to increase views of

Possible options are :

v : video
video : video

u : user
user : user
channel : user

c : collection
collect : collection
collection : collection

photos : photo
photo : photo
p : photo

Function usage

											
												<?php 
	increment_views($id,$type);
 ?>
											
										

Function example

											
												<?php 
	$videoid = '2914';
	$type = 'v';
	$inc_check = increment_views($videoid, $type);
	if ($inc_check) {
		echo "Views incremented successfully";
	} else {
		echo "Something went wrong incrementing video views";
	}

 ?>
											
										

post()


Description : Get a value from $_POST variable

Parameters


[string] $var :
The value you want to read from $_POST array

Function usage

											
												<?php 
	post($var);
 ?>
											
										

show_share_form()


Description : Show share form

Parameters


[array] $array :
An array of parameters

$array['id'] : Id of element to show share form for
$array['type'] : Type of element to show share form for

Function usage

											
												<?php 
	show_share_form($array);
 ?>
											
										

show_flag_form()


Description : Show flag form

Parameters


[array] $array :
An array of parameters

$array['id'] : Id of element to show flag form for
$array['type'] : Type of element to show flag form for

Function usage

											
												<?php 
	show_flag_form($array);
 ?>
											
										

show_playlist_form()


Description : Show playlist form

Parameters


[array] $array :
An array of parameters

$array['id'] : video id to show playlist form for
$array['type'] : Type of element to show playlist form for
$array['user'] : User whose playlist is to be shown

Function usage

											
												<?php 
	show_playlist_form($array);
 ?>
											
										

show_collection_form()


Description : Show collections form

Parameters


[array] $array :
An array of parameters

$array['id'] : Id of element to show collection form for
$array['type'] : Type of element to show collection form for

Function usage

											
												<?php 
	show_collection_form($array);
 ?>
											
										

cbdate()


Description : Function used to convert timestamps into date

Parameters


[string] $format :
Current format of time

[string] $timestamp :
Null by default, converts timestamp if true

Function usage

											
												<?php 
	cbdate($format, $timestamp);
 ?>
											
										

count_pages()


Description : Function used to count pages and return total divided

Parameters


[integer] $total :
Total pages that were found

[integer] $count :
Pages that are to be displayed

Function usage

											
												<?php 
	count_pages($total, $count);
 ?>
											
										

get_user_level()


Description : Fetch user level using a user id

Parameters


[integer] $id :
Id of user to fetch level of

Function usage

											
												<?php 
	get_user_level($userid);
 ?>
											
										

validate_cb_form()


Description : Validate a ClipBucket form and all of its values

Parameters


[array] $input :
An array with all of form values

[array] $array :
An array with all of form fields

Function usage

											
												<?php 
	validate_cb_form($input, $array);
 ?>
											
										

template_file_exists()


Description : Check if a template file exists

Parameters


[string] $file :
Filename to check

[string] $dir :
Directory to search filename inside

Function usage

											
												<?php 
	template_file_exists($file, $dir);
 ?>
											
										

nicetime()


Description : Convert date into pretty time

Parameters


[string] $date :
Date to be converted into pretty time

Function usage

											
												<?php 
	nicetime($date);
 ?>
											
										

get_country()


Description : Get name of country using country code

Parameters


[string] $code :
Country code to get name for

Function usage

											
												<?php 
	get_country('PK');
 ?>
											
										

get_collections()


Description : Fetches data of collections

Parameters


[array] $p :
An array of parameters

$p['limit'] : Limit of collections to fetch
$p['order'] : Order to return collections in
$p['active'] : Show active collections only
$p['broadcast'] : Show public collections only
$p['category'] : Show collections from specific category
$p['date_span'] : Show collections within a date span
$p['user'] : Show collections of a user only
$p['featured'] : Show featured collections only
$p['public_upload'] : Show collections with public uploading enabled
$p['exclude'] : Collections to be excluded
$p['cid'] : Get collection with specific id
$p['has_items'] : Get collections which are not empty
$p['name'] : Get collection by name
$p['tags'] : Get collections by tags
$p['count_only'] : Only count number of collections present
$p['assign'] : Assign all data from smarty usage

Function usage

											
												<?php 
	get_collections($params);
 ?>
											
										

Function usage

											
												<?php 
	$params = array("active"=>"yes","limit"=>$start_index.",".$loop_size);
	get_collections($params);
 ?>
											
										

get_users()


Description : Fetch users from in ClipBcket

Parameters


[array] : $params

An array of paramters

$params['limit'] : Limit on users to be fetched
$params['order'] : Order to fetch users in
$params['ban'] : Fetch or exculde banned users
$params['status'] : Fetch users with specific status
$params['category'] : Fetch users of specific category
$params['date_span'] : Fetch users from a specific time span
$params['featured'] : Fetch or exclude users that are featured
$params['username'] : Fetch user by username
$params['email'] : Fetch user by email adress
$params['exclude'] : Exclude users
$params['userid'] : Fetch users with a userid
$params['gender'] : Fetch users by gender
$params['level'] : Fetch user with specific user levels
$params['cond'] : Fetch user with additional cond
$params['count_only'] : Count how many users there are
$params['assign'] : Assign values for smarty usage

Function usage

											
												<?php 
	get_users($params);
 ?>
											
										

is_installed()


Description : Check if a plugin is installed or not

Parameters


[string] $plugin :
Plugin main file name [without php]

Function usage

											
												<?php 
	is_installed($plugin);
 ?>
											
										

cbtitle()


Description : Show ClipBucket website title in browser tab

Parameters


NONE

Function usage

											
												<?php 
	cbtitle();
 ?>
											
										

whos_your_daddy()


Description : Ah! Who indeed ??? :P

Parameters


NONE

Function usage

											
												<?php 
	whos_your_daddy();
 ?>
											
										

subtitle()


Description : Set subtitle for a page

Parameters


[string] $title :
String to be set as subtitle

Function usage

											
												<?php 
	subtitle('Videos Page');
 ?>
											
										

get_username()


Description : Get username of a user using userid

Parameters


[integer] $uid :
Id of user to get username of

Function usage

											
												<?php 
	get_username($uid);
 ?>
											
										

delete_collection_photos()


Description : Delete all photos that you have inside of a collection

Parameters



[array] $details :
An array with all details of collection to delete photos from

Function usage

											
												<?php 
	delete_collection_photos($collection_details);
 ?>
											
										

head_menu()


Description : Fetches head menu of ClipBucket

Parameters



NONE

Function usage

											
												<?php 
	head_menu();
 ?>
											
										

foot_menu()


Description : Fetches footer menu of ClipBucket

Parameters



NONE

Function usage

											
												<?php 
	foot_menu();
 ?>
											
										

xml2array()


Description : Convert XML into an array

Parameters



[string] $url :
Url to fetch XML from

Function usage

											
												<?php 
	xml2array($url);
 ?>
											
										

xml2array()


Description : Convert XML into an array

Parameters



[string] $url :
Url to fetch XML from

Function usage

											
												<?php 
	xml2array($url);
 ?>
											
										

array2xml()


Description : Convert an array to XML

Parameters



[array] $array :
Array to be converted into XML

Function usage

											
												<?php 
	array2xml($array);

 ?>
											
										

Function usage

											
												<?php 
	$params = array();
	$params['file'] = 'path_to_file.html';
	include_header($params);
 ?>
											
										

is_includeable()


Description : Function used to check weather to include given file or not

Parameters



[array] $array :
An array with files to include

Function usage

											
												<?php 
	is_includeable($array);
 ?>
											
										

check_ffmpeg()


Description : Check if FFMPEG is installed or not

Parameters



[string] $path :
Possible path of ffmpeg


Function usage

											
												<?php 
	check_ffmpeg($path);
 ?>
											
										

check_php_cli()


Description : Check if PHP CLI (commnad line interface) is installed or not

Parameters



[string] $path :
Possible path of php-cli

Function usage

											
												<?php 
	check_php_cli($path);
 ?>
											
										

check_media_info()


Description : Check if MediaInfo is installed or not

Parameters



[string] $path :
Possible path of MediaInfo

Function usage

											
												<?php 
	check_media_info($path);
 ?>
											
										

check_imagick()


Description : Check if Imagick is installed or not

Parameters



[string] $path :
Possible path of Imagick

Function usage

											
												<?php 
	check_imagick($path);
 ?>
											
										

check_ffprobe_path()


Description : Check if FFPROBE is installed or not

Parameters



[string] $path :
Possible path of FFPROBE

Function usage

											
												<?php 
	check_ffprobe_path($path);

 ?>
											
										

check_mp4box()


Description : Check if MP4Box is installed or not

Parameters



[string] $path :
Possible path of MP4Box


Function usage

											
												<?php 
	check_mp4box($path);
 ?>
											
										

parse_version()


Description : Parse version of a tool from its output

Parameters



[string] $path :
Path of tool to check version of

[mixed] $result :
Data to parse out version from e.g output of php –version from CLI


Function usage

											
												<?php 
	parse_version($path, $result);
 ?>
											
										

Function usage

											
												<?php 
	parse_version($path, $result);
	$path = '/usr/bin/php';
	$result = “PHP 5.5.12-2ubuntu4.4 (cli) (built: Apr 17 2015 11:47:44) 
	Copyright (c) 1997-2014 The PHP Group
	Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
	    with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies”;
	parse_version($path, $result);
 ?>
											
										

get_db_size()


Description : Get size of ClipBucket database

Parameters



NONE


Function usage

											
												<?php 
	get_db_size();
 ?>
											
										

marked_spammed()


Description : Check if a user has marked current comment as spam or not

Parameters



[Array] $comment :
An array with all details of comment to run checks against

Function usage

											
												<?php 
	marked_spammed($comment);
 ?>
											
										

get_time_zones()


Description : Get a list of all time zones

Parameters



NONE

Function usage

											
												<?php 
	get_time_zones();
 ?>
											
										

conv_status()


Description : Get status of video conversion in human friendly way

Parameters



[string] $in :
Code of status

Function usage

											
												<?php 
	conv_status('p');
 ?>
											
										

conv_status()


Description : Get status of video conversion in human friendly way

Parameters



[string] $in :
Code of status

Function usage

											
												<?php 
	conv_status('p');
 ?>
											
										

check_install()


Description : Check if ClipBucket is installed or not

Parameters



[string] $type :
Type of check to run e.g before or after

Function usage

											
												<?php 
	check_install('before');
 ?>
											
										

get_server_url()


Description : Get server URL that ClipBucket is installed on

Parameters



NONE

Function usage

											
												<?php 
	get_server_url();
 ?>
											
										

get_server_protocol()


Description : Get protocol of server

Parameters



NONE

Function usage

											
												<?php 
	get_server_protocol();
 ?>
											
										

embeded_code()


Description : Generates an OBJECT embed code against given video

Parameters



[array] $vdetails :
An array with all details of video to be embeded


Function usage

											
												<?php 
	embeded_code($vdetails);
 ?>
											
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										
											
																							
										

Authentication

The Stripe API is organized around REST. Our API has predictable, resource-oriented URLs, and uses HTTP response codes to indicate API errors. We use built-in HTTP features, like HTTP authentication and HTTP verbs, which are understood by off-the-shelf HTTP clients. We support cross-origin resource sharing, allowing you to interact securely with our API from a client-side web application (though you should never expose your secret API key in any public website's client-side code). JSON is returned by all API responses, including errors, although our API libraries convert responses to appropriate language-specific objects.

The Stripe API is organized around REST. Our API has predictable, resource-oriented URLs, and uses HTTP response codes to indicate API errors. We use built-in HTTP features, like HTTP authentication and HTTP verbs, which are understood by off-the-shelf HTTP clients. We support cross-origin resource sharing, allowing you to interact securely with our API from a client-side web application (though you should never expose your secret API key in any public website's client-side code). JSON is returned by all API responses, including errors,legal_entitythough our API libraries convert responses to appropriate language-specific objects.

The account object

Authentication

The Stripe API is organized around REST. Our API has predictable, resource-oriented URLs, and uses HTTP response codes to indicate API errors. We use built-in HTTP features, like HTTP authentication and HTTP verbs, which are understood by off-the-shelf HTTP clients. We support cross-origin resource sharing, allowing you to interact securely with our API from a client-side web application (though you should never expose your secret API key in any public website's client-side code). JSON is returned by all API responses, including errors, although our API libraries convert responses to appropriate language-specific objects.

The Stripe API is organized around REST. Our API has predictable, resource-oriented URLs, and uses HTTP response codes to indicate API errors. We use built-in HTTP features, like HTTP authentication and HTTP verbs, which are understood by off-the-shelf HTTP clients. We support cross-origin resource sharing, allowing you to interact securely with our API from a client-side web application (though you should never expose your secret API key in any public website's client-side code). JSON is returned by all API responses, including errors,legal_entitythough our API libraries convert responses to appropriate language-specific objects.

The account object

Attributes

ID string

A unique identifier for the account

ID string

A unique identifier for the account

Whether string

Whether or not Stripe will attempt to reclaim negative account balances from this account’s bank account.

API libraries

API libraries

Official libraries for the Stripe API are available in several languages. Community-supported libraries are also available for additional languages.

Official libraries for the Stripe API are available in several languages. Community-supported libraries are also available for additional languages.