# Conflicts:
#	upload/includes/langs/en.lang
This commit is contained in:
MacWarrior 2016-11-29 18:54:10 +01:00
commit 3017bf7981
44 changed files with 485 additions and 490 deletions

View file

@ -24,7 +24,7 @@ switch($mode)
{
$title = getName($_POST['title']);
$file_name = $_POST['file_name'];
if ($_POST['serverUrl']) {
if ($_POST['serverUrl'] && $_POST['serverUrl'] != "none") {
$file_directory = date('Y/m/d');
} else {
$file_directory = createDataFolders();

View file

@ -8,7 +8,9 @@
//Sleeping..
//sometimes video is inserted after video conversion so in this case, video can get lost
// sometimes this file gets executed before video insertion completes
// so it needs to be put to sleep for a short short time
sleep(5);
$in_bg_cron = true;
include(dirname(__FILE__)."/../includes/config.inc.php");

View file

@ -13,6 +13,8 @@ if(!$userquery->is_admin_logged_as_user())
}
$pages->page_redir();
if($_GET['revert'])
{
$userquery->revert_from_user();
@ -20,6 +22,16 @@ if($_GET['revert'])
}
$uid = $_GET['uid'];
$udetails = $userquery->get_user_details(userid());
$userLevel = $udetails['level'];
$userToLoginAsDetails = $userquery->get_user_details($uid);
$userToLoginAsLevel = $userToLoginAsDetails['level'];
if ($userLevel > 1 && $userToLoginAsLevel == 1) {
e("You do not have enough permissions to login as Admin user");
}
if($userquery->login_as_user($uid))
redirect_to(BASEURL);
display_it();

View file

@ -11,7 +11,8 @@ require'../includes/admin_config.php';
$userquery->admin_login_check();
$userquery->login_check('member_moderation');
$pages->page_redir();
$udetails = $userquery->get_user_details(userid());
$userLevel = $udetails['level'];
/* Assigning page and subpage */
if(!defined('MAIN_PAGE')){
define('MAIN_PAGE', 'Users');
@ -176,8 +177,15 @@ if(isset($_POST['unban_selected'])){
$result_array['order'] = " doj DESC ";
#pr($result_array,true);
$users = get_users($result_array);
if ($userLevel > 1) {
foreach ($users as $key => $currentUser) {
if ($currentUser['level'] == 1) {
unset($users[$key]);
}
}
}
Assign('users', $users);
Assign("userLevel", (int)$userLevel);
//Collecting Data for Pagination
$mcount = $array;

View file

@ -79,7 +79,8 @@
</div>
</div>
</td>
<td>
<td>
<div id="usr_opt-{$u.userid}" class="dropdown pull-right">
<button id="dropdownMenu1" class="btn btn-primary btn-xs dropdown-toggle" data-toggle="dropdown">
Actions<i class="icon-angle-down icon-on-right"></i>
@ -124,6 +125,7 @@
{/foreach}
</ul>
</div>
</td>
</tr>

View file

@ -31,11 +31,7 @@
</tr>
{if $videos}
{foreach from=$videos item=video}
{if !isReconvertAble($video)}
{$noReconv = true}
{else}
{$noReconv = false}
{/if}
<tr>
<td>
<input name="check_video[]" type="checkbox" id="check_video" value="{$video.videoid}"/>
@ -67,8 +63,9 @@
{$video.conv_progress} % Converted
</span> -->
{/if*}
<span class="label {if $video.re_conv_status=='started'}label-warning{else if $video.re_conv_status=='failed'}label-danger{else if $video.re_conv_status=='done'}label-success{else}label-primary{/if}">
{if $video.re_conv_status == 'done'}Reconverted{else if $video.re_conv_status == 'started'}Reconverting{else if $video.re_conv_status == 'failed' } Reconverting Failed {else if $noReconv == true} Non-reconvertable {/if} </span>
<!-- <span class="label {if $video.re_conv_status=='started'}label-warning{else if $video.re_conv_status=='failed'}label-danger{else if $video.re_conv_status=='done'}label-success{else}label-primary{/if}">
{if $video.re_conv_status == 'done'}Reconverted{else if $video.re_conv_status == 'started'}Reconverting{else if $video.re_conv_status == 'failed' } Reconverting Failed {else if $noReconv == true} Non-reconvertable {/if} </span> -->
{if $video.featured=='yes'}
<span class="label label-info">
Featured</span>
@ -78,6 +75,11 @@
{foreach from=$cbvid->video_manager_link_new item=links}
{$cbvid->video_manager_link_new($links,$video)}
{/foreach}
{if !isReconvertAble($video)}
<span class="label label-warning">Non-Convertable</span>
{else}
<span class="label label-info">Re-Convertable</span>
{/if}
</div>
</div>

View file

@ -1,26 +1,31 @@
<?php
require_once '../includes/admin_config.php';
$userquery->admin_login_check();
$pages->page_redir();
/* Assigning page and subpage */
if(!defined('MAIN_PAGE')){
define('MAIN_PAGE', 'Stats And Configurations');
}
if(!defined('SUB_PAGE')){
define('SUB_PAGE', 'Update Logo');
}
/*
* File is used for uploading logo in ClipBucket
*/
$source = BASEURL.'/styles/cb_28/theme/images/logo.png';
require_once '../includes/admin_config.php';
$userquery->admin_login_check();
$pages->page_redir();
/* Assigning page and subpage */
if(!defined('MAIN_PAGE')){
define('MAIN_PAGE', 'Stats And Configurations');
}
if(!defined('SUB_PAGE')){
define('SUB_PAGE', 'Update Logo');
}
// Upload and Rename File
$source = BASEURL.'/styles/cb_28/theme/images/logo.png';
if (isset($_POST['submit'])) {
// function used to upload site logo.
upload_logo() ;
}
// Upload and Rename File
if (isset($_POST['submit'])) {
// function used to upload site logo.
upload_logo() ;
}
assign('source',$source);
subtitle("Update Logo");
template_files('upload_logo.html');
display_it();
assign('source',$source);
subtitle("Update Logo");
template_files('upload_logo.html');
display_it();
?>

View file

@ -409,6 +409,12 @@ class Collections extends CBCategory
$cond .= " AND ";
$cond .= " ".tbl('collections.total_objects')." >= '1'";
}
if (!has_access("admin_access")) {
if($cond != '')
$cond .= " AND ";
$cond .= " ".tbl('collections.broadcast')." != 'private'";
}
$title_tag = '';

View file

@ -962,12 +962,15 @@ class FFMpeg{
{
$video_width=(int)$value[0];
$video_height=(int)$value[1];
if($this->input_details['video_height'] > $video_height-1)
$bypass = $this->check_threshold($this->input_details['video_height'],$video_height);
logData($bypass,'reindex');
if($this->input_details['video_height'] > $video_height-1 || $bypass)
{
$more_res['video_width'] = $video_width;
$more_res['video_height'] = $video_height;
$more_res['name'] = $video_height;
logData($more_res['video_height'],'reindex');
$this->convert(NULL,false,$more_res);
}
@ -1021,6 +1024,26 @@ class FFMpeg{
}
}
/**
* Used to checks if video is under threshold for conversion
* @param : { Array } { app_id }
* @todo : This Function checks if video is under threshold
* @example : check_threshold($input_vidoe_height,$current_video_height) { will check the threshold for 240p }
* @return : { Boolean } { True/ False }
* @since : 27th Oct, 2016 Feedback 1.0
* @author : Fahad Abbas
*/
function check_threshold($input_video_height,$current_video_height){
$threshold = '200';
if ($current_video_height == "240"){
if ($input_video_height > $threshold){
return True;
}
}
return False;
}
public function generate_thumbs($input_file,$duration,$dim='120x90',$num=3,$prefix=NULL, $rand=NULL,$gen_thumb=FALSE,$output_file_path=false,$specific_dura=false)
{
@ -2035,6 +2058,7 @@ class FFMpeg{
}
$count = $count+1;
if (!$regenerateThumbs){
$this->TemplogData .= "\r\n Command : $command ";
$this->TemplogData .= "\r\n File : $file_path ";
}
@ -2051,6 +2075,7 @@ class FFMpeg{
$command = $this->ffMpegPath." -i $input_file -an $dimension -y -f image2 -vframes $num $file_path ";
$output = $this->executeCommand($command);
if (!$regenerateThumbs){
$this->TemplogData .= "\r\n Command : $command ";
$this->TemplogData .= "\r\n File : $file_path ";
}
}

View file

@ -571,6 +571,11 @@ class CBPhotos
{
$query = $main_query;
if ( $cond ) {
if (!has_access("admin_access")) {
// get collections that are either not private or created by logged in user
$cond .= " AND collections.broadcast != 'private' OR collections.userid = 'userid()'";
}
$query .= " WHERE ".$cond;
}
@ -579,7 +584,7 @@ class CBPhotos
$result = select( $query );
}
if($p['show_related'])
{
$query = $main_query;
@ -614,7 +619,7 @@ class CBPhotos
$query .= $limit;
$result = select( $query );
// We found nothing from TITLE of Photos, let's try TAGS
if($db->num_rows == 0)
{

View file

@ -4114,6 +4114,16 @@ class userquery extends CBCategory{
function action($case,$uid)
{
global $db;
$udetails = $this->get_user_details(userid());
$logged_user_level = $udetails['level'];
if ($logged_user_level > 1) {
$data = $this->get_user_details($uid);
if ($data['level'] == 1) {
e("You do not have sufficient permissions to edit an Admininstrator");
return false;
}
}
if(!$this->user_exists($uid))
return false;
//Lets just check weathter user exists or not

View file

@ -469,11 +469,19 @@ class CBvideo extends CBCategory
$query_field[] = 'rated_by';
$query_val[] = $array['rated_by'];
}
if (!empty($array['embed_code']))
{
$query_field[] = 'embed_code';
$query_val[] = $array['embed_code'];
}
}
$query_val[0] = str_replace('&lt;!--', '', $query_val[0]);
$query_val[1] = str_replace('&lt;!--', '', $query_val[1]);
$query_val[3] = strtolower($query_val[3]);
if(!userid())
{
e(lang("you_dont_have_permission_to_update_this_video"));
@ -1055,6 +1063,10 @@ class CBvideo extends CBCategory
'users' => $cb_columns->object('users')->temp_change('featured','user_featured')->get_columns()
);
if (!isset($fields['video_users'])) {
$fields[] = 'video_users';
}
$fields = tbl_fields( $fields );
if(!$params['count_only'] && !$params['show_related'])

View file

@ -2279,7 +2279,7 @@
// depending on the parameters passed to it
if (!empty($array['user'])) {
$playlists = $cbvid->action->get_playlists($array);
} else {
} elseif (userid()) {
$playlists = $cbvid->action->get_playlists();
}
assign('playlists',$playlists);
@ -4320,23 +4320,47 @@
if(PHP_OS == "Linux") {
$destination.'/'.$dest_name;
$saveTo = $destination.'/'.$dest_name;
#exit($saveTo);
$fp = fopen ($saveTo, 'w+');
} elseif (PHP_OS == "WINNT") {
$destination.'\\'.$dest_name;
$fp = fopen ($destination.'\\'.$dest_name, 'w+');
$saveTo = $destination.'/'.$dest_name;
}
$ch = curl_init($snatching_file);
curl_setopt($ch, CURLOPT_TIMEOUT, 600);
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_USERAGENT,
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2');
curl_exec($ch);
curl_close($ch);
fclose($fp);
cURLdownload($snatching_file, $saveTo);
return $saveTo;
}
}
/**
* This Function gets a file using curl method in php
*
* @param : { string } { $url } { file to be downloaded }
* @param : { string } { $file } { where to save the downloaded file }
*/
function cURLdownload($url, $file) {
$ch = curl_init();
if($ch)
{
$fp = fopen($file, "w");
if($fp)
{
if( !curl_setopt($ch, CURLOPT_URL, $url) ) {
fclose($fp); // to match fopen()
curl_close($ch); // to match curl_init()
return "FAIL: curl_setopt(CURLOPT_URL)";
}
if( !curl_setopt($ch, CURLOPT_FILE, $fp) ) return "FAIL: curl_setopt(CURLOPT_FILE)";
if( !curl_setopt($ch, CURLOPT_HEADER, 0) ) return "FAIL: curl_setopt(CURLOPT_HEADER)";
if( !curl_exec($ch) ) return "FAIL: curl_exec()";
curl_close($ch);
fclose($fp);
return "SUCCESS: $file [$url]";
}
else{
return "FAIL: fopen()";
}
}else{
return "FAIL: curl_init()";
}
}
/**
* Checks if CURL is installed on server
@ -5680,7 +5704,9 @@
}
function upload_logo() {
$target_dir = STYLES_DIR."/cb_28/theme/images/";
global $Cbucket;
$active_template = $Cbucket->configs['template_dir'];
$target_dir = STYLES_DIR.'/'.$active_template.'/theme/images/';
$filename = $_FILES["fileToUpload"]["name"];
$file_basename = basename($filename,".png");
$file_ext = pathinfo($filename, PATHINFO_EXTENSION);
@ -5786,6 +5812,34 @@
}
}
/**
* Check if a url exists using curl
* @param : { string } { $mainFile } { File to run check against }
* @author : Fahad Abbas
* @since : 14th November, 2016
*
* @return : { boolean } { true or false matching pattern }
*/
function is_url_exist($url){
try{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_exec($ch);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if($code == 200){
$status = true;
}else{
$status = false;
}
curl_close($ch);
return $status;
}catch(Exception $e){
echo 'Caught exception: ', $e->getMessage(), "\n";
}
}
include( 'functions_db.php' );
include( 'functions_filter.php' );

View file

@ -100,3 +100,41 @@
}
}
/**
* Returns playable video for user's channel page
* @param : { array } { $userVideos } { an array user videos }
* @return : { string / boolean } { video key if found a video matches pattern else false }
* @since : November 17th, 2016 ClipBucket 2.8.2
* @author : Saqib Razzaq
*/
function userMainVideo($userVideos) {
global $userquery;
if (is_array($userVideos)) {
$userid = $userquery->userid;
foreach ($userVideos as $key => $video) {
$vBroadcast = trim($video['broadcast']);
$vKey = $video['videokey'];
switch ($vBroadcast) {
case 'private':
if (is_numeric($userid)) {
$allowedUsers = explode(',', $video['video_users']);
if (in_array($userid, $allowedUsers)) {
return $vKey;
}
}
break;
case 'logged':
if (is_numeric($userid)) {
return $vKey;
}
break;
case 'public':
return $vKey;
break;
}
}
}
}

View file

@ -2015,24 +2015,48 @@
/**
* Checks if given video is reconvertable or not
* @param : { array } { $vdetails } { an array with all details regarding video }
* @since : 31st October, 2016
* @author : Saqib Razzaq
* @since : 14th November October, 2016
* @author : Fahad Abbas
*
* @return : { boolean } { returns true or false depending on matched case }
*/
function isReconvertAble($vdetails) {
global $cbvid;
if (is_array($vdetails)) {
if (empty($vdetails['embed_code']) || $vdetails['embed_code'] == 'none') {
$files = get_video_files($vdetails);
if (!empty($files)) {
if (is_array($files) || !strpos($files, 'no_video.mp4')) {
return true;
try{
global $cbvid;
if (is_array($vdetails) && !empty($vdetails)) {
$fileName = $vdetails['file_name'];
$fileDirectory = $vdetails['file_directory'];
$serverPath = $vdetails['file_server_path'];
if(empty($vdetails['file_server_path'])){
if(!empty($fileDirectory) ){
$path = VIDEOS_DIR."/".$fileDirectory .'/'. $fileName."*";
$vid_files = glob($path);
}
else{
$path = VIDEOS_DIR .'/'. $fileName."*";
$vid_files = glob($path);
}
if (!empty($vid_files) && is_array($vid_files)){
$is_convertable = true;
}
}else{
$is_convertable = true;
}
if ($is_convertable){
return true;
}else{
return false;
}
}else{
return false;
}
} catch (Exception $e) {
echo 'Caught exception: ', $e->getMessage(), "\n";
}
}
/**
@ -2063,74 +2087,112 @@
// get details of single video
$vdetails = $cbvid->get_video($daVideo);
if (!isReconvertAble($vdetails)) {
e("Video with id ".$vdetails['videoid']." is not re-convertable");
continue;
} elseif (checkReConvStatus($vdetails['videoid']) == 'started') {
e("Video with id : ".$vdetails['videoid']." is already processing");
continue;
} else {
$toConvert++;
e("Started re-conversion process for id ".$vdetails['videoid'],"m");
}
if (!empty($vdetails['file_server_path'])){
// grab all video files against single video
$video_files = get_video_files($vdetails);
if(empty($vdetails['file_directory'])){
$vdetails['file_directory'] = str_replace('-', '/', $vdetails['datecreated']);
}
setVideoStatus($daVideo, 'Processing');
// possible array of video qualities
$qualities = array('1080','720','480','360','240','hd','sd');
$encoded['file_directory'] = $vdetails['file_directory'];
$encoded['file_name'] = $vdetails['file_name'];
$encoded['re-encode'] = true;
// loop though possible qualities, from high res to low
foreach ($qualities as $qualNow) {
$api_path = str_replace('/files', '', $vdetails['file_server_path']);
$api_path.= "/actions/re_encode.php";
// loop through all video files of current video
// and match theme with current possible quality
foreach ($video_files as $key => $file) {
$request = curl_init($api_path);
curl_setopt($request, CURLOPT_POST, true);
// get quality of current url
$currentQuality = getStringBetween($file, '-', '.');
curl_setopt($request,CURLOPT_POSTFIELDS,$encoded);
// output the response
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
$results_curl = curl_exec($request);
// pr($results_curl,true);
$results_curl_arr = json_decode($results_curl,true);
$returnCode = (int)curl_getinfo($request, CURLINFO_HTTP_CODE);
curl_close($request);
if(isset($results_curl_arr['success'])&&$results_curl_arr['success']=="yes"){
e( lang( 'Your request for re-encoding '.$vdetails[ 'title' ].' has been queued.' ), 'm' );
}
if(isset($results_curl_arr['error'])&&$results_curl_arr['error']=="yes"){
e( lang( $results_curl_arr['msg'] ) );
}
// get extension of file
$currentExt = pathinfo($file, PATHINFO_EXTENSION);
}else{
#pr($vdetails,true);
if (!isReconvertAble($vdetails)) {
e("Video with id ".$vdetails['videoid']." is not re-convertable");
continue;
} elseif (checkReConvStatus($vdetails['videoid']) == 'started') {
e("Video with id : ".$vdetails['videoid']." is already processing");
continue;
} else {
$toConvert++;
e("Started re-conversion process for id ".$vdetails['videoid'],"m");
}
// if current video file matches with possible quality,
// we have found best quality video
if ($qualNow === $currentQuality || $currentExt == 'flv') {
// grab all video files against single video
$video_files = get_video_files($vdetails);
// You got best quality here, perform action on video
$subPath = str_replace(BASEURL, '', $video_files[$key]);
$fullPath = BASEDIR.$subPath;
// possible array of video qualities
$qualities = array('1080','720','480','360','240','hd','sd');
// loop though possible qualities, from high res to low
foreach ($qualities as $qualNow) {
// loop through all video files of current video
// and match theme with current possible quality
foreach ($video_files as $key => $file) {
// get quality of current url
$currentQuality = get_video_file_quality($file, '-', '.');
// pex($currentQuality,true);
// get extension of file
$currentExt = pathinfo($file, PATHINFO_EXTENSION);
// if current video file matches with possible quality,
// we have found best quality video
if ($qualNow === $currentQuality || $currentExt == 'flv') {
// You got best quality here, perform action on video
$subPath = str_replace(BASEURL, '', $video_files[$key]);
$fullPath = BASEDIR.$subPath;
// change video status to processing
setVideoStatus($daVideo, 'Processing');
// change video status to processing
setVideoStatus($daVideo, 'Processing');
$file_name = $vdetails['file_name']; // e.g : 147765247515e0e
$targetFileName = $file_name.'.mp4'; // e.g : 147765247515e0e.mp4
$file_directory = $vdetails['file_directory']; // e.g : 2016/10/28
$logFile = LOGS_DIR.'/'.$file_directory.'/'.$file_name.'.log'; // e.g : /var/www/html/cb_root/files/logs/2016/10/28/147765247515e0e.log
$file_name = $vdetails['file_name']; // e.g : 147765247515e0e
$targetFileName = $file_name.'.mp4'; // e.g : 147765247515e0e.mp4
$file_directory = $vdetails['file_directory']; // e.g : 2016/10/28
$logFile = LOGS_DIR.'/'.$file_directory.'/'.$file_name.'.log'; // e.g : /var/www/html/cb_root/files/logs/2016/10/28/147765247515e0e.log
// remove old log file
unlink($logFile);
// remove old log file
unlink($logFile);
// path of file in temp dir
$newDest = TEMP_DIR.'/'.$targetFileName;
// path of file in temp dir
$newDest = TEMP_DIR.'/'.$targetFileName;
// move file from original source to temp
$toTemp = copy($fullPath, $newDest);
// move file from original source to temp
$toTemp = copy($fullPath, $newDest);
// add video in conversion qeue
$Upload->add_conversion_queue($targetFileName);
// add video in conversion qeue
$Upload->add_conversion_queue($targetFileName);
// begin the process of brining back from dead
exec(php_path()." -q ".BASEDIR."/actions/video_convert.php {$targetFileName} {$file_name} {$file_directory} {$logFile} > /dev/null &");
// begin the process of brining back from dead
exec(php_path()." -q ".BASEDIR."/actions/video_convert.php {$targetFileName} {$file_name} {$file_directory} {$logFile} > /dev/null &");
// set reconversion status
setVideoStatus($daVideo, 'started',true);
break 2;
// set reconversion status
setVideoStatus($daVideo, 'started',true);
break 2;
}
}
}
}
}
if ($toConvert >= 1) {
e("Reconversion is underway. Kindly don't run reconversion on videos that are already reconverting. Doing so may cause things to become lunatic fringes :P","w");

File diff suppressed because one or more lines are too long

View file

@ -8,6 +8,7 @@
<!-- This code is added for timecomments plugin-->
{$tcomments_params = ['function'=>'get_timeCommnets','videoid'=>$vdata.videoid]}
{$Comments_allowed = $myquery->is_commentable($vdata,'v') }
{$timecomments = get_my_function($tcomments_params)}
<!-- End -->
@ -16,6 +17,13 @@
{$video_editor_enabled = get_my_function($v_editor_params)}
<!-- End -->
{$svg_manager_params = ['function'=>'get_svg_manager']}
{$svg_manager = get_my_function($svg_manager_params)}
{if $svg_manager}
{$svg_manager}
{/if}
<!-- This code is added for instance manager Interactive ads plugin intances-->
{if !$video_editor_enabled }
{$intance_params = ['function'=>'get_slot','videoid'=>$vdata.videoid]}
@ -65,10 +73,13 @@
<script src="{$cb_vjs_player_url}/js/videojs.ads.js"></script>
<script src="{$cb_vjs_player_url}/js/videojs.ima.js"></script>
<script src="{$cb_vjs_player_url}/js/cb_ultimate_ads.js"></script>
<script type="text/javascript" src="{$cb_vjs_player_url}/js/videojs.relatedCarousel.js"></script>
<script src="{$cb_vjs_player_url}/js/videojs.relatedCarousel.js"></script>
<script src="{$cb_vjs_player_url}/js/iphone-inline-video.browser.js"></script>
{$default_quality = get_cbvjs_quality_type($video_files)}
<video id="cb_video_js" class="video-js vjs-default-skin" height="{$height}" width="{$width}" poster="{getThumb vdetails=$vdata size=768x432}" >
<video playsinline id="cb_video_js" class="video-js vjs-default-skin" height="{$height}" width="{$width}" poster="{getThumb vdetails=$vdata size=768x432}" >
{foreach $video_files as $file}
{$quality = get_cbvjs_quality($file)}
@ -83,6 +94,7 @@
</video>
<script type="text/javascript">
var vid_id = "{$vdata.videoid}";
var videotitle = "{$vdata.title|escape_quotes}";
@ -112,6 +124,7 @@
var user_id = "{userid()}";
var username = "{username()}";
var user_profile = "{$userquery->avatar('','m',userid())}";
var allow_comments = "{$Comments_allowed}";
}
var play_ad = "{$play_ad}"; // Ad settings starts to pass on to player
@ -173,6 +186,7 @@
userid : user_id,
userprofile : user_profile,
username : username,
allowComments : allow_comments,
forceShow : true
}
cb_vjs.timecomments(comments_options);
@ -226,7 +240,6 @@
}
},100);
}
//Initializing
var cb_player = videojs('cb_video_js', cb_player_setup , cb_vjs_callback);

View file

@ -79,7 +79,12 @@ if (!function_exists('cb_video_js'))
*/
function get_cbvjs_quality_type($video_files){
if ($video_files){
$one_file = get_cbvjs_quality($video_files[0]);
if (!empty($video_files[240])){
$video_file = $video_files[240];
}else{
$video_file = $video_files[0];
}
$one_file = get_cbvjs_quality($video_file);
if (is_numeric($one_file)){
$cb_combo_res = True;
}else{
@ -166,6 +171,14 @@ if (!function_exists('cb_video_js'))
return false;
}
}
case 'get_svg_manager':{
if ( IA_ADS_INSTALLED == 'installed' ){
$svg_manager = svg_manager();
return $svg_manager;
}else{
return false;
}
}
case 'get_slot':{
if ( IA_ADS_INSTALLED == 'installed' ){
global $ia_ads;

View file

@ -0,0 +1,3 @@
/*! npm.im/iphone-inline-video */
var makeVideoPlayableInline=function(){"use strict";/*! npm.im/intervalometer */
function e(e,r,n,i){function t(n){d=r(t,i),e(n-(a||n)),a=n}var d,a;return{start:function(){d||t(0)},stop:function(){n(d),d=null,a=0}}}function r(r){return e(r,requestAnimationFrame,cancelAnimationFrame)}function n(e,r,n,i){function t(r){Boolean(e[n])===Boolean(i)&&r.stopImmediatePropagation(),delete e[n]}return e.addEventListener(r,t,!1),t}function i(e,r,n,i){function t(){return n[r]}function d(e){n[r]=e}i&&d(e[r]),Object.defineProperty(e,r,{get:t,set:d})}function t(e,r,n){n.addEventListener(r,function(){return e.dispatchEvent(new Event(r))})}function d(e,r){Promise.resolve().then(function(){e.dispatchEvent(new Event(r))})}function a(e){var r=new Audio;return t(e,"play",r),t(e,"playing",r),t(e,"pause",r),r.crossOrigin=e.crossOrigin,r.src=e.src||e.currentSrc||"data:",r}function o(e,r,n){(m||0)+200<Date.now()&&(e[b]=!0,m=Date.now()),n||(e.currentTime=r),A[++k%3]=100*r|0}function u(e){return e.driver.currentTime>=e.video.duration}function s(e){var r=this;r.video.readyState>=r.video.HAVE_FUTURE_DATA?(r.hasAudio||(r.driver.currentTime=r.video.currentTime+e*r.video.playbackRate/1e3,r.video.loop&&u(r)&&(r.driver.currentTime=0)),o(r.video,r.driver.currentTime)):r.video.networkState!==r.video.NETWORK_IDLE||r.video.buffered.length||r.video.load(),r.video.ended&&(delete r.video[b],r.video.pause(!0))}function c(){var e=this,r=e[h];return e.webkitDisplayingFullscreen?void e[E]():("data:"!==r.driver.src&&r.driver.src!==e.src&&(o(e,0,!0),r.driver.src=e.src),void(e.paused&&(r.paused=!1,e.buffered.length||e.load(),r.driver.play(),r.updater.start(),r.hasAudio||(d(e,"play"),r.video.readyState>=r.video.HAVE_ENOUGH_DATA&&d(e,"playing")))))}function v(e){var r=this,n=r[h];n.driver.pause(),n.updater.stop(),r.webkitDisplayingFullscreen&&r[T](),n.paused&&!e||(n.paused=!0,n.hasAudio||d(r,"pause"),r.ended&&(r[b]=!0,d(r,"ended")))}function p(e,n){var i=e[h]={};i.paused=!0,i.hasAudio=n,i.video=e,i.updater=r(s.bind(i)),n?i.driver=a(e):(e.addEventListener("canplay",function(){e.paused||d(e,"playing")}),i.driver={src:e.src||e.currentSrc||"data:",muted:!0,paused:!0,pause:function(){i.driver.paused=!0},play:function(){i.driver.paused=!1,u(i)&&o(e,0)},get ended(){return u(i)}}),e.addEventListener("emptied",function(){var r=!i.driver.src||"data:"===i.driver.src;i.driver.src&&i.driver.src!==e.src&&(o(e,0,!0),i.driver.src=e.src,r?i.driver.play():i.updater.stop())},!1),e.addEventListener("webkitbeginfullscreen",function(){e.paused?n&&!i.driver.buffered.length&&i.driver.load():(e.pause(),e[E]())}),n&&(e.addEventListener("webkitendfullscreen",function(){i.driver.currentTime=e.currentTime}),e.addEventListener("seeking",function(){A.indexOf(100*e.currentTime|0)<0&&(i.driver.currentTime=e.currentTime)}))}function l(e){var r=e[h];e[E]=e.play,e[T]=e.pause,e.play=c,e.pause=v,i(e,"paused",r.driver),i(e,"muted",r.driver,!0),i(e,"playbackRate",r.driver,!0),i(e,"ended",r.driver),i(e,"loop",r.driver,!0),n(e,"seeking"),n(e,"seeked"),n(e,"timeupdate",b,!1),n(e,"ended",b,!1)}function f(e,r,n){void 0===r&&(r=!0),void 0===n&&(n=!0),n&&!g||e[h]||(p(e,r),l(e),e.classList.add("IIV"),!r&&e.autoplay&&e.play(),/iPhone|iPod|iPad/.test(navigator.platform)||console.warn("iphone-inline-video is not guaranteed to work in emulated environments"))}var m,y="undefined"==typeof Symbol?function(e){return"@"+(e||"@")+Math.random()}:Symbol,g=/iPhone|iPod/i.test(navigator.userAgent)&&!matchMedia("(-webkit-video-playable-inline)").matches,h=y(),b=y(),E=y("nativeplay"),T=y("nativepause"),A=[],k=0;return f.isWhitelisted=g,f}();

View file

@ -18,8 +18,9 @@ TimeComments.prototype.init = function(){
}else{
timecomments.comments = timecomments.GetTimeComments(timecomments.settings.dummy);
}
/*console.log(timecomments.comments);*/
timecomments.AddComment();
if (timecomments.settings.allowComments){
timecomments.AddComment();
}
timecomments.AddControlBArMenu();
timecomments.Structure();
timecomments.playPause();

View file

@ -1,5 +0,0 @@
<div class="container">
{if $smarty.get.valid == 'fail'}
<div class="alert alert-danger" role="alert">Captcha Verification Failed. Kindly Try again.</div>
{/if}
</div>

View file

@ -1,40 +0,0 @@
<?php
/**
* Plugin Name: CB Captcha
* Description: Stop spam signups like a boss with latest Captcha
* ClipBucket: version: 2.7.x
* Plugin: Version: 1.0
* Author: Saqib Razzaq
* @since 9th July, 2015 (ClipBucket 2.7.4)
* @modified: 1st April, 2016 ClipBucket 2.8.1
*/
define('CB_CAPTCHA',basename(dirname(__FILE__)));
// checks user's input
function validate_user_ans() {
if (isset($_POST['signup'])) {
$result = $_POST['g-recaptcha-response'];
if ($result == '') {
header("Location: ".BASEURL."/signup.php?valid=fail");
}
}
}
if (isset($_POST['signup'])) {
validate_user_ans();
}
// displaying the form
function the_form() {
global $db;
$key_check = $db->_select('SELECT the_key FROM '.tbl("the_captcha"));
$the_key = $key_check[0]['the_key'];
$site_key = $the_key;
echo '<div class="g-recaptcha" data-sitekey='.$site_key.'></div>';
}
register_anchor_function("the_form", "the_form");
add_admin_menu("CB Captcha" , "reCaptcha Key" , "cb_captcha_admin.php" , CB_CAPTCHA);
// used for displaying message on failure of captcha
template_files(PLUG_DIR."/cb_captcha/captcha.html");
?>

View file

@ -1,15 +0,0 @@
<table width="50%" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td>
<h2>Re Captcha Key</h2>
<form id="form1" name="form1" method="post" action="">
<input class="form-control" type="text" name="recaptcha_key" id="recaptcha_key" value="{$recaptcha_key}">
<br/>
<br/>
<input type="submit" class="btn btn-primary btn-xs" name="update" value="Update" />
</form></td>
</tr>
</table>

View file

@ -1,48 +0,0 @@
<?php
/**
* @since : 2015
* @author : Saqib Razzaq
*/
// Pages and Sub Pages
if(!defined('MAIN_PAGE')){
define('MAIN_PAGE', 'CB Captcha');
}
if(!defined('SUB_PAGE')){
define('SUB_PAGE', 'reCaptcha Key');
}
require_once '../includes/admin_config.php';
$userquery->admin_login_check();
$userquery->login_check('admin_access');
$pages->page_redir();
if(isset($_POST['update']))
{
$text = mysql_clean($_POST['recaptcha_key']);
function update_recaptcha_key($text)
{
global $db;
$text = $text;
$db->Execute("UPDATE ".tbl("the_captcha")." SET the_key='$text'");
}
update_recaptcha_key($text);
$msg = e("Key has been updated",'m');
}
global $db;
$ann_array = $db->_select('SELECT * FROM '.tbl("the_captcha"));
if(is_array($ann_array))
assign('recaptcha_key', $ann_array[0]['the_key']);
else
assign('an', '');
subtitle("Add Key");
template_files(PLUG_DIR.'/cb_captcha/cb_captcha_admin.html');
?>

View file

@ -1,24 +0,0 @@
<?php
require_once('../includes/common.php');
//Creating Table for anncoument if not exists
function install_cb_captcha()
{
global $db;
$db->Execute(
'CREATE TABLE IF NOT EXISTS '.tbl("the_captcha").' (
`the_key` text NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;;'
);
//inserting new announcment
$db->Execute("INSERT INTO ".tbl('the_captcha')." (the_key) VALUES ('')");
}
//This will first check if plugin is installed or not, if not this function will install the plugin details
install_cb_captcha();
?>

View file

@ -1,12 +0,0 @@
<?php
//Function used to uninstall Plugin
function un_install_cb_captcha()
{
global $db;
$db->Execute(
'DROP TABLE '.tbl("captcha").''
);
}
un_install_cb_captcha();
?>

View file

@ -1,53 +0,0 @@
<?php
/*
Plugin Name: Clipbucket Honeypot
Description: An alternative method, of captcha, for stopping spam. A simple trick will confuse stupid bots but still might get some spam.<br/> If you are using any other captcha plugin, please disable them before installing this
Author: Fawaz Tahir
Author Website: http://clip-bucket.com/
ClipBucket Version: 2
Version: 1.0
*/
define( 'CB_HONEYPOT', this_plugin( __FILE__ ) );
/* DIRECTORIES */
define( 'CB_HONEYPOT_BACKEND', 'backend' );
define( 'CB_HONEYPOT_FRONTEND', 'frontend' );
/* PATHS */
define( 'CB_HONEYPOT_DIR', PLUG_DIR.'/'.CB_HONEYPOT );
define( 'CB_HONEYPOT_URL', PLUG_URL.'/'.CB_HONEYPOT );
define( 'CB_HONEYPOT_BACKEND_DIR', CB_HONEYPOT_DIR.'/'.CB_HONEYPOT_BACKEND );
define( 'CB_HONEYPOT_BACKEND_URL', CB_HONEYPOT_URL.'/'.CB_HONEYPOT_BACKEND );
define( 'CB_HONEYPOT_FRONTEND_DIR', CB_HONEYPOT_DIR.'/'.CB_HONEYPOT_FRONTEND );
define( 'CB_HONEYPOT_FRONTEND_URL', CB_HONEYPOT_URL.'/'.CB_HONEYPOT_FRONTEND );
/* CONSTANTS */
define( 'CB_HONEYPOT_SPAM_SALT', '@!xD:P)}{}!!ONEPIECE[narutodeath]NOTE' );
define( 'CB_HONEYPOT_TIMESTAMP', time() );
define( 'CB_HONEYPOT_NAME_SEPARATOR', '-' );
define( 'CB_HONEYPOT_FORM_SUBMISSION_WINDOW', 5 );
define( 'CB_HONEYPOT_DEFAULT_VALUE', 'Pirate king rocked, Hokage shocked' );
if ( !file_exists( CB_HONEYPOT_BACKEND_DIR ) ) {
@mkdir( CB_HONEYPOT_BACKEND_DIR, 0777, true );
}
if ( !file_exists( CB_HONEYPOT_FRONTEND_DIR ) ) {
@mkdir( CB_HONEYPOT_FRONTEND_DIR, 0777, true );
}
/* GLOBALS */
$CB_HONEYPOT_NAME = array();
/* FUNCTIONS */
include( CB_HONEYPOT_DIR.'/includes/functions.php' );
cb_add_honeypot_name_part( CB_HONEYPOT );
cb_add_honeypot_name_part( $_SERVER[ 'REMOTE_ADDR' ] );
cb_add_honeypot_name_part( CB_HONEYPOT_TIMESTAMP );
cb_add_honeypot_name_part( CB_HONEYPOT_SPAM_SALT );
#cb_register_function( 'cb_honeypot_assignment', 'clipbucket_init_completed' );
register_cb_captcha( 'cb_honeypot_assignment', 'cb_verify_honeypot', false );
$Cbucket->add_header( CB_HONEYPOT_FRONTEND_DIR."/header.html" );

View file

@ -1,13 +0,0 @@
<style type="text/css">
{literal}
.cb_field_container_type_input_style {
display: none;
}
.cb_field_type_input_style {
}
{/literal}
</style>

View file

@ -1,104 +0,0 @@
<?php
/**
* Created by JetBrains PhpStorm.
* User: Fawaz
* Date: 10/11/13
* Time: 3:23 PM
* To change this template use File | Settings | File Templates.
*/
function cb_honeypot_name() {
$name = cb_get_honeypot_name();
if ( count( $name ) == 0 OR empty( $name ) ) {
return false;
}
$field_name = implode( CB_HONEYPOT_NAME_SEPARATOR, $name );
return cb_honeypot_hash( $field_name );
}
function cb_honeypot_hash( $name ) {
return md5( $name );
}
function cb_honeypot_hash_fieldname( $name, $salt ) {
return md5( $name.$salt.CB_HONEYPOT_SPAM_SALT );
}
function cb_add_honeypot_name_part( $name ) {
global $CB_HONEYPOT_NAME;
if ( $name ) {
$CB_HONEYPOT_NAME[] = $name;
}
return $CB_HONEYPOT_NAME;
}
function cb_get_honeypot_name() {
global $CB_HONEYPOT_NAME;
return $CB_HONEYPOT_NAME;
}
function cb_honeypot_assignment() {
$new_salt = cb_honeypot_name();
$timestamp_id = cb_honeypot_hash_fieldname( 'cb_timestamp', $new_salt );
$honeypot_id = cb_honeypot_hash_fieldname( 'cb_honeypot', $new_salt );
$output = '<input type="hidden" value="'.$new_salt.'" id="cb_verifier" name="cb_verifier" />';
$output .= '<input type="hidden" name="'.$timestamp_id.'" id="'.$timestamp_id.'" value="'.CB_HONEYPOT_TIMESTAMP.'" />';
$output .= '<div class="cb_field_container_type_input_style">If you are reading this, please do not touch the next field<br/><input type="text" class="cb_field_type_input_style" placeholder="PLEASE IT AS IT IS" name="'.$honeypot_id.'" id="'.$honeypot_id.'" value="'.CB_HONEYPOT_DEFAULT_VALUE.'" /></div>';
return $output;
}
function cb_verify_honeypot() {
global $eh;
$salt = mysql_clean( post( 'cb_verifier' ) );
if ( $salt ) {
$timestamp_name = cb_honeypot_hash_fieldname( 'cb_timestamp', $salt );
$timestamp = mysql_clean( post( $timestamp_name ) );
if ( $timestamp ) {
$difference = time() - $timestamp;
if ( ( $difference ) < CB_HONEYPOT_FORM_SUBMISSION_WINDOW ) {
e( lang( sprintf( 'Submitting form in %d %s. Are you even a human ?', $difference, ( $difference == 1 ) ? 'second' : 'seconds' ) ) );
return false;
}
$honeypot_name = cb_honeypot_hash_fieldname( 'cb_honeypot', $salt );
$honeypot = mysql_clean( post( $honeypot_name ) );
if( CB_HONEYPOT_DEFAULT_VALUE == '' ) {
if( $honeypot != '' ) {
e( lang( 'Someone is tampering with forms. Can not process further.' ) );
return false;
}
} else {
if ( !$honeypot OR ( $honeypot != CB_HONEYPOT_DEFAULT_VALUE ) ) {
e( lang( 'Someone is tampering with forms. Can not process further.' ) );
return false;
}
}
return true;
} else {
e( lang( 'Unable to locate timestamp. Can not process further.' ) );
}
} else {
e( lang( 'No verification code provided. Can not process further.' ) );
}
return false;
}

View file

View file

@ -99,7 +99,7 @@ subtitle($title);
?>
<item>
<author><?=$video['username']?></author>
<![CDATA[ <title><?=substr($video['title'],0,50)?></title> ]]>
<title><?=substr($video['title'],0,50)?></title>
<link><?=video_link($video)?></link>
<description>
<![CDATA[

View file

@ -110,7 +110,7 @@
</div>
<div class="comment-info">
<strong class="commenter">
{if $comment.anonym_name != ''}
{if $comment.anonym_name != '' && $user.username == ''}
{$comment.anonym_name} (Guest)
{else}
<a href="{$userquery->profile_link($user)}" >

View file

@ -11,7 +11,7 @@
<div class="col-md-6 procolor">
<h4 class="media-heading headcolor">{$user.username}</h4>
<b>{lang code='since:'}</b> ({$user.doj|date_format})
<b>{lang code='last_Login:'}</b> ({$user.last_logged|nicetime})
<b>{lang code='last_Login'}:</b> ({$user.last_logged|nicetime})
</div>
</div>
</div>
@ -51,11 +51,11 @@
<span class="maccountlabels"> <strong>{$video.date_added|niceTime}</strong>
{lang code='views'} : <strong>{$video.views|number_format}</strong></span>
<div class="labels">
{if $video.featured=='yes'}<span class="label label-primary">Featured{else}{/if}</span>
{if $video.featured=='yes'}<span class="label label-primary">{lang code="featured"}{/if}</span>
<span class="label {if $video.active=='yes'}label-success{else}label-warning{/if} mlabel">
{if $video.active=='yes'}Active{else}InActive{/if}</span>
{if $video.active=='yes'}{lang code="active"}{else}{lang code="inactive"}{/if}</span>
<span class="label {if $video.status=='Successful'}label-success{else}label-warning{/if}">
{if $video.status=='Successful'}Successful{else}Processing{/if}</span>
{if $video.status=='Successful'}{lang code="successful"}{else}{lang code="processing"}{/if}</span>
<span class="label label-info">
Viewed {$video.last_viewed|niceTime}</span>
</div>
@ -80,14 +80,14 @@
Actions <i class="caret"></i></button>
<ul class="dropdown-menu pull-right" aria-labelledby="dropdownMenu1" role="menu">
<li><a role="menuitem" tabindex="-1"
href="{$baseurl}/edit_video.php?vid={$video.videoid}" class="">Edit</a></li>
href="{$baseurl}/edit_video.php?vid={$video.videoid}" class="">{lang code="edit_video"}</a></li>
<li><a role="menuitem" tabindex="-1"
href="{$baseurl}/watch_video.php?v={$video.videokey}"target="_blank">Watch</a>
href="{$baseurl}/watch_video.php?v={$video.videokey}"target="_blank">{lang code="Watch"}</a>
<li class="divider"></li>
<li><a role="menuitem" tabindex="-1" href="{$baseurl}/myaccount.php?delete_video={$video.videoid}">Delete</a>
<li><a role="menuitem" tabindex="-1" href="{$baseurl}/myaccount.php?delete_video={$video.videoid}">{lang code="delete"}</a>
</li>
{foreach from=$cbvid->video_manager_links item=links}
{$cbvid->video_manager_link($links,$video)}

View file

@ -10,7 +10,7 @@
<div class="progress-container allProgress hidden">
<div class="row">
<div class="col-md-2" id="uploadedFilesInfo">
<p>{lang code="uploaded"} 0 {lang code="of"} 0</p>
<p>{lang code="Inserted"} 0 {lang code="of"} 0</p>
</div>
<div class="col-md-10">
<div class="progress">
@ -71,7 +71,7 @@
}, 10000);
var totalFiles = 0;
var baseurl = '{$baseurl}';
var config_for_mp4 = '{$config_for_mp4}';
if('{$uploaderDetails.uploadScriptPath}'!=''){
@ -105,7 +105,6 @@
});
uploader.init();
uploader.bind('FilesAdded', function(up, uploadedFiles) {
for(var i = 0; i < uploadedFiles.length; i++){
files.push(uploadedFiles[i]);
}
@ -140,7 +139,7 @@
$("#files").html("");
$("#files").append(ul);
var totalFiles = files.length;
totalFiles = files.length;
var oneFile = false;
@ -156,18 +155,30 @@
}
wrapperDiv.id = "tab"+i;
oneUploadForm.className = "";
$(oneUploadForm).find(".cancel_button").attr('to_cancel',i);
$(oneUploadForm).find("input[name='title']").val(files[i].name.slice(0, -4));
console.log($(oneUploadForm).find("input[name='title']").val(files[0].name.slice(0, -4)));
$(oneUploadForm).find("textarea#desc").val(files[i].name.slice(0, -4));
$(oneUploadForm).find("input[name='category[]']:first").attr('checked', 'checked');
console.log(oneUploadForm);
wrapperDiv.appendChild(oneUploadForm);
uploadForms.push(wrapperDiv);
}
$.each( uploadedFiles, function( key, fileNow ) {
console.log("filenow "+fileNow);
var currentTitle = fileNow.name,
plFileId = fileNow.id;
//<button class="clearfix cancel_button btn btn-danger" style="float:right; margin-top: -20px">Cancel Uploading</button>
// appends progress bar along with title
// this progress bar is later updated on realtime
// via fileprogress event of pluploader
$(".realProgressBars").append('<h5 class="realProgTitle_'+plFileId+'">'+currentTitle+'</h5><button class="clearfix cancel_button btn btn-danger" to_cancel="'+plFileId+'" style="float:right; margin-top: -8px; margin-left:10px;">Cancel Uploading</button><div class="progress"><div class="progress-bar progress-bar_'+plFileId+'" role="progressbar" aria-valuenow="70" aria-valuemin="0" aria-valuemax="100" style="width:0%"><span class="sr-only">70% Complete</span><span class="realProgText_'+plFileId+'">50% completed</span></div></div>');
});
$("#allUploadForms").html("");
$("#allUploadForms").append(uploadForms);
@ -189,6 +200,34 @@
}
});
/*
* Trigger element when "Cancel Uploading" button is clicked
* stops uploading
* hides uploading div
*/
(function() {
$(".cancel_button").on("click",function(e) {
e.preventDefault();
var toCancel = $(this).attr('to_cancel');
var thecount = 0;
$(this).attr('disabled',true);
$(this).text("Canceled");
$.each( uploadedFiles, function( iNow, currentFile ){
if (currentFile.id == toCancel) {
uploader.removeFile(uploadedFiles[thecount]);
$(this).unbind().remove();
$(".progress-bar_"+toCancel).addClass('progress-bar-danger');
$(".realProgText_"+toCancel).text("Canceled");
$('li#'+thecount).fadeOut('slow');
totalFiles = totalFiles - 1;
}
thecount++;
});
});
})();
setTimeout(function(){
$("#uploaderContainer").toggleClass("hidden");
$("#uploadDataContainer").toggleClass("hidden");
@ -206,6 +245,8 @@
$(".progress-container").removeClass("hidden");
});
var totalUploaded = 0;
/*
This is the event handler for UploadProgress,
@ -214,19 +255,6 @@
var filesUploaded = 0;
var totalPercentage = 0;
uploader.bind('UploadProgress', function(up, file) {
// var progressContainer = document.getElementById("fileUploadProgress");
// var progressBar = progressContainer.getElementsByTagName("progress")[0];
// progressBar.style.display = "block";
// var fileName = progressContainer.getElementsByTagName('h5')[0];
// fileName.innerHTML = "Uploading "+file.name;
// var percent = file.percent/100;
// progressBar.value = percent;
$("#progressNumber").text(file.percent + "%");
$("#videoNumber").text(file.name);
});
/*
This is the event handler for FileUploaded,
@ -237,8 +265,8 @@
var theVideoId = '';
uploader.bind('FileUploaded', function(plupload, fileDetails, response){
$("#overallProgress").css("width", ((100/files.length)*(++filesUploaded))+"%");
$("#overallProgress").parents(".row").find("#uploadedFilesInfo").text("Uploaded " + (filesUploaded) + " of " + files.length);
$("#overallProgress").css("width", ((100/totalFiles)*(++filesUploaded))+"%");
$("#overallProgress").parents(".row").find("#uploadedFilesInfo").text("Inserted " + (filesUploaded) + " of " + totalFiles);
var serverResponse = $.parseJSON(response.response);
if(serverResponse.extension == 'mp4' && config_for_mp4 == 'yes' ){
@ -250,21 +278,13 @@
//enabling savedetails button for Current form
var _upload_form_Div_ = $('#tab'+currentFileIndex);
_upload_form_Div_.find('.cancel_button').fadeOut('slow');
_upload_form_Div_.find("#saveVideoDetails").attr("disabled",false);
_upload_form_Div_.find("#saveVideoDetails").attr("id","uploadCompleted");
/*
Insert the video in the database and get the video db id from the
database which will be sent with the final form
*/
var serverUrl = false,
thumbsUrl = false;
if(typeof serverResponse.server_url != 'undefined'){
var serverUrl = serverResponse.server_url,
thumbsUrl = serverResponse.thumbs_url;
}
var fileId = false;
$.ajax({
url : baseurl + "/actions/file_uploader.php",
@ -273,8 +293,6 @@
insertVideo : "yes",
title : fileDetails.name,
file_name : fileName,
serverUrl : serverUrl,
thumbsUrl : thumbsUrl,
}
}).success(function(msg){
@ -314,6 +332,7 @@
$(uploadForm).on({
submit: function(e){
e.preventDefault();
//window.location.href = baseurl+"/?moreMsg="+theVideoId;
var self = this;
//var data = new FormData();
@ -350,6 +369,26 @@
});
// runs on progress of file uplaoder
uploader.bind('UploadProgress', function(up, file) {
// this the unique ID assigned to each file upload
var pluploadFileId = file.id,
filePercentage = file.percent;
// update progress bar widht
$('.progress-bar_'+pluploadFileId).css("width",filePercentage+"%");
//updawte progress bar text to show percentage
$('.realProgText_'+pluploadFileId).text(filePercentage+"% Completed");
// meaning file has completely uploaded
if (filePercentage == 100) {
// remove cancel button
$(".cancel_button[to_cancel='" + pluploadFileId + "']").fadeOut('slow');
// tunr progress bar into green to show success
$('.progress-bar_'+pluploadFileId).addClass('progress-bar-success');
}
});
uploader.bind("UploadComplete", function(plupload, files){
$("#fileUploadProgress").addClass("hidden");

View file

@ -3,12 +3,16 @@
{lang code='channel' assign='object_type'}
{$loadMoreLang ={lang code="load_more"}}
{$uservideos=get_videos(["user"=>$user.userid, "order"=>"date_added DESC","limit" =>9])}
{if $uservideos}
{$first_video = $cbvid->get_video($uservideos.0.videokey)}
{/if}
{$total_videos = $user.total_videos}
{$total_photos = $user.total_photos}
{if $uservideos}
{$mainVideo = userMainVideo($uservideos)}
{$first_video = $cbvid->get_video($mainVideo)}
{/if}
<div id="main" class="container clearfix">
<div class="clearfix">
{include file="$style_dir/blocks/view_channel/channel_header.html"}

View file

@ -7,10 +7,10 @@ function headerFooter()
cont_height = $("#container").height();
headerheight = $("#header").outerHeight();
footerheight = $("#footer").outerHeight();
console.log('headerheight=>'+headerheight+',footerheight=>'+footerheight);
console.log("cont_height"+cont_height)
/*console.log('headerheight=>'+headerheight+',footerheight=>'+footerheight);
console.log("cont_height"+cont_height)*/
cont_height_new = cont_height - (headerheight + footerheight);
console.log("cont_height_new"+cont_height_new)
/*console.log("cont_height_new"+cont_height_new)*/
$("#container").css('padding-top',headerheight+'px');
$("#container").css('padding-bottom',footerheight+'px');

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View file

@ -24,12 +24,13 @@
</div>
<div id="uploadDataContainer" class="uploadDataContainer hidden">
<div class="uploadingProgressContainer">
<div class="alert alert-block alert-info">
<p><b>{lang code="selected_files"} </b>{lang code="upload_in_progress"} <small style="color:white;"><span id="progressNumber">0%</span> {lang code="complete_of_video"} <span id="videoNumber"></span></small></p>
</div>
</div>
<div class="realProgressBars">
</div>
<div class="align-right hidden" id="uploadMore">
<a href="#" class="btn btn-primary uploadMoreVideos" id="uploadMoreVideos">{lang code="upload_more_videos"}</a>
</div>
<div id="files"></div>
<div id="allUploadForms" class="tab-content allUploadForms"></div>

View file

@ -66,14 +66,6 @@ if($udetails)
$profile = $userquery->get_user_profile($udetails['userid']);
Assign('u_control', $profile);
// making sure user can see his private vid tab
//$user_cond = $userquery->userid != $udetails['userid'];
//Assign('u_cond', $user_cond);
$firstVideo = isset($videos[0]) ? $videos[0] : false;
$firstVideo = $cbvid->get_video($firstVideo['videoid']);
//echo "hm";
Assign('firstVideo', $firstVideo);
//Checking Profile permissions
$perms = $p['show_profile'];