structure.sql : added two columns 'extras' && 'video_version' in "video" table.

upgrade_2.7.0.2.sql : added two columns 'extras' && 'video_version' in "video" table.
functions_video.php : added condition of video_version in get_video_files()
collections.html : design updated 
edit_video.html : getName() getExt() method issue for server thumb 
user.class.php : warning issue, update_user_voted() 
video.class.php : show_video_rating() calculate percentage issue 
user.html : total_subscriptions issue 
photo_upload.html : collection id issue
This commit is contained in:
Fahad Abbas 2014-12-18 10:26:29 +00:00
parent d9e240bfaa
commit 91e2b0e7ac
9 changed files with 68 additions and 32 deletions

View file

@ -264,7 +264,7 @@
<li style="display: inline">
<img src="{$vid_thumb}" width="100" height="100">
<div class="tools">
<input type="radio" value="{$vid_thumb|getname}.{$vid_thumb|getext}" id="{$vid_thumb|getname}" name="default_thumb" {if $data.default_thumb==$vid_thumb|get_thumb_num} checked="checked"{/if} />
<input type="radio" value="{GetName($vid_thumb)}.{GetExt($vid_thumb)}" id="{$vid_thumb|getname}" name="default_thumb" {if $data.default_thumb==$vid_thumb|get_thumb_num} checked="checked"{/if} />
{if $vid_thumb|getname!='processing'}
<a href="?video={$data.videoid}&delete={$vid_thumb|getname}.{$vid_thumb|getext}">
<i class="icon-remove red"></i></a>

View file

@ -940,10 +940,7 @@ CREATE TABLE IF NOT EXISTS `{tbl_prefix}video` (
`uploader_ip` varchar(20) NOT NULL,
`mass_embed_status` enum('no','pending','approved') NOT NULL DEFAULT 'no',
`is_hd` enum('yes','no') NOT NULL DEFAULT 'no',
`ebay_epn_keywords` varchar(255) NOT NULL,
`ebay_pre_desc` text NOT NULL,
`unique_embed_code` varchar(50) NOT NULL,
`mature_content` enum('yes','no') NOT NULL DEFAULT 'no',
`remote_play_url` text NOT NULL,
`server_ip` varchar(20) NOT NULL,
`file_server_path` text NOT NULL,
@ -954,6 +951,9 @@ CREATE TABLE IF NOT EXISTS `{tbl_prefix}video` (
`filegrp_size` varchar(30) NOT NULL,
`process_status` bigint(30) NOT NULL DEFAULT '0',
`has_hd` enum('yes','no') NOT NULL DEFAULT 'no',
`has_hd` enum('yes','no') NOT NULL DEFAULT 'no',
`video_version` varchar(30) NOT NULL DEFAULT '2.7',
`extras` varchar(225) NOT NULL DEFAULT ,
PRIMARY KEY (`videoid`),
FULLTEXT KEY `description` (`description`,`title`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=960 ;
@ -1178,3 +1178,4 @@ CREATE TABLE IF NOT EXISTS `{tbl_prefix}admin_todo` (
ALTER TABLE `{tbl_prefix}action_log` DROP `action_link`;
ALTER TABLE `{tbl_prefix}video` ADD `file_directory` VARCHAR( 10 ) NOT NULL AFTER `file_server_path`

View file

@ -0,0 +1,4 @@
-- Adding extras column for future
-- Adding video version column for clipbucket versions
ALTER TABLE `{tbl_prefix}video` ADD `video_version` varchar(30) NOT NULL DEFAULT "2.6";
ALTER TABLE `{tbl_prefix}video` ADD `extras` varchar(225) NOT NULL;

View file

@ -5531,8 +5531,7 @@ function getSubscriptionsUploadsWeek($uid,$limit=20,$uploadsType="both",$uploads
else
$voted = json_decode($votedDetails[0]['voted'],TRUE);
//$votedArray = $voted;
$voted[] = $array;
if(!empty($js))
$votedEncode = $js->json_encode($voted);

View file

@ -1502,6 +1502,7 @@ class CBvideo extends CBCategory
if($total<=10)
$total = 10;
$perc = $rating*100/$total;
$perc = round($perc);
$disperc = 100 - $perc;
if($ratings <= 0 && $disperc == 100)
$disperc = 0;

View file

@ -1219,6 +1219,8 @@ function get_video_files($vdetails,$return_default=true,$with_path=true,$multi=f
global $Cbucket;
# checking if there is any other functions
# available
define('VIDEO_VERSION',$vdetails['video_version']);
if(is_array($Cbucket->custom_video_file_funcs))
foreach($Cbucket->custom_video_file_funcs as $func)
if(function_exists($func))
@ -1235,9 +1237,18 @@ function get_video_files($vdetails,$return_default=true,$with_path=true,$multi=f
}
//dump($vdetails['file_name']);
#Now there is no function so lets continue as
if(isset($vdetails['file_name']))
if(isset($vdetails['file_name'])){
if(VIDEO_VERSION == '2.7'){
$vid_files = glob(VIDEOS_DIR."/".$fileDirectory . $vdetails['file_name']."*");
}
else{
$vid_files = glob(VIDEOS_DIR."/".$vdetails['file_name']."*");
}
}
// if($hq){
// var_dump(glob(VIDEOS_DIR."/".$fileDirectory . $vdetails['file_name']."*"));
// }
@ -1253,8 +1264,12 @@ function get_video_files($vdetails,$return_default=true,$with_path=true,$multi=f
$files_part = explode('/',$file);
$video_file = $files_part[count($files_part)-1];
if($with_path)
if($with_path){
if(VIDEO_VERSION == '2.7')
$files[] = VIDEOS_URL.'/' . $fileDirectory. $video_file ;
else if(VIDEO_VERSION == '2.6')
$files[] = VIDEOS_URL.'/' . $video_file ;
}
else
$files[] = $video_file;
}

View file

@ -43,7 +43,7 @@
</div>
<div class="clearfix">
<div class="pull-left small"><span class="bg-photos"></span>&nbsp;<span>{$user.total_photos|number_format} {lang code="photos"}</span></div>
<div class="pull-right btn btn-xs btn-primary"><span>{$user.subscribers|number_format} {lang code="subscribers"}</span></div>
<div class="pull-right btn btn-xs btn-primary"><span>{$user.total_subscriptions|number_format} {lang code="subscribers"}</span></div>
</div>
<!--<ul class="list-unstyled ">
{if isSectionEnabled('videos')}

View file

@ -99,8 +99,32 @@
<a class="btn btn-primary pull-right" href="{$baseurl}/manage_collections.php?mode=add_new">{lang code='add_new_collection'}</a>
</div>
</div><!-- end of page heading -->
<div class="clearfix">
<!-- <ul class="list-unstyled row collections">
<div class="col-md-12">
<ul class="list-unstyled row collections">
{section name=c_list loop=$collections}
{include file="$style_dir/blocks/collection.html" collection=$collections[c_list]}
{sectionelse}
{lang code='no_results_found'}
{/section}
</ul>
</div>
<!--Pagination-->
<div align="center">
{include file="$style_dir/blocks/pagination.html"}
</div>
<!-- Pagination-->
{*include file="$style_dir/blocks/pagination.html"*}
</div>
</div>
</div>
<div style="height:20px"> </div>
<!-- <div class="clearfix">
<ul class="list-unstyled row collections">
{*{section name=c_list loop=$collections}
{include file="$style_dir/blocks/collection.html" collection=$collections[c_list]}
@ -108,7 +132,7 @@
{sectionelse}
{lang code='no_results_found'}
{/section}*}
</ul> -->
</ul>
{$collections = $cbcollection->get_collections(['limit'=>12, 'active'=>'yes'])}
@ -121,8 +145,8 @@
<div class="col-sm-6 clearfix">{$collection.collection_name}</div>
<div class="col-sm-6 clearfix"><span class="total-obj">{$collection.total_objects}</span></div>
<!-- {*{$collection.type}*} -->
<!-- <div class="col-sm-6 clearfix"><span class="total-obj">{$limit}</span></div> -->
{*{$collection.type}*}
<div class="col-sm-6 clearfix"><span class="total-obj">{$limit}</span></div>
</div>
<div class="collection-grid clearfix">
{$items = $cbphoto->collection->get_collection_items_with_details($collection.collection_id,0,$limit,false)}
@ -148,13 +172,3 @@
</div>
</div>
<!--Pagination-->
<div align="center">
{include file="$style_dir/blocks/pagination.html"}
</div>
<!-- Pagination-->
{*include file="$style_dir/blocks/pagination.html"*}
</div>
</div>
</div>
<div style="height:20px"> </div>

View file

@ -300,6 +300,7 @@
*/
var fileId = false;
var collectionId = $("#SelectionDIV select").val();
var stored_cid = collectionId;
$.ajax({
url : baseurl + "/actions/photo_uploader.php",
type : "post",
@ -344,8 +345,9 @@
}
var self = $(this).parents("form");
var data = $(self).serialize();
//data += "&collection_id="+collectionId;
data += "&collection_id="+stored_cid;
data += "&server_url=undefined&folder=undefined&updatePhoto=yes";
$.ajax({
url : baseurl + "/actions/photo_uploader.php",
type : "post",