diff --git a/sql/2.0.7~2.0.8.txt b/sql/2.0.7~2.0.8.txt
new file mode 100644
index 00000000..07a0e4f8
--- /dev/null
+++ b/sql/2.0.7~2.0.8.txt
@@ -0,0 +1,8 @@
+INSERT INTO `clipbucket_svn`.`cb_config` (
+`configid` ,
+`name` ,
+`value`
+)
+VALUES (
+NULL , 'use_ffmpeg_vf', 'no'
+);
\ No newline at end of file
diff --git a/upload/admin_area/main.php b/upload/admin_area/main.php
index 12f1dba3..87781dcd 100644
--- a/upload/admin_area/main.php
+++ b/upload/admin_area/main.php
@@ -128,6 +128,7 @@ if(isset($_POST['update'])){
'thumb_width',
'thumb_height',
+ 'use_ffmpeg_vf',
'user_comment_own',
'user_rate_opt1' ,
'users_items_subscriptions',
diff --git a/upload/admin_area/reindex_cb.php b/upload/admin_area/reindex_cb.php
index d9c63d3a..8e996e6d 100644
--- a/upload/admin_area/reindex_cb.php
+++ b/upload/admin_area/reindex_cb.php
@@ -27,64 +27,131 @@ function p_r($array)
echo "";
}
+$start_index = $_GET['start_index'] ? $_GET['start_index'] : 0;
+$loop_size = $_GET['loop_size'];
+$loop_size = $loop_size ? $loop_size : 5;
+assign('loop_size',$loop_size);
+$next_index = $start_index+$loop_size;
+assign('next_index',$next_index);
+
//Reindex Videos
-if(isset($_POST['index_vids'])) {
- $videos = get_videos(array("active"=>"yes","status"=>"Successful"));
+if(isset($_GET['index_vids']))
+{
+ $videos = get_videos(array("active"=>"yes","status"=>"Successful","limit"=>$start_index.",".$loop_size));
$total_videos = get_videos(array("count_only"=>true,"active"=>"yes","status"=>"Successful"));
$percent = number_format(50 * $total_videos / 100);
$i = 0;
- while($i < $total_videos) {
+ assign('total',$total_videos);
+ assign('from',$start_index+1);
+ $to = $start_index+$loop_size;
+ if($to>$total_videos)
+ {
+ $to = $total_videos;
+ e($total_videos." videos have been reindexed successfully.","m");
+ assign("stop_loop","yes");
+ }
+ assign('to',$to);
+
+
+
+ while($i < $total_videos)
+ {
+ if($videos[$i]['videoid'])
+ {
$params = array("video_id"=>$videos[$i]['videoid'],"video_comments"=>true,"favs_count"=>true,"playlist_count"=>true);
$indexes = $cbindex->count_index("vid",$params);
$fields = $cbindex->extract_fields("vid",$params);
-
- $cbindex->update_index("vid",array("fields"=>$fields,"values"=>$indexes,"video_id"=>$videos[$i]['videoid']));
-
+ $msg[] = $videos[$i]['video'].": Updating ".$videos[$i]['title']." ";
+ $cbindex->update_index("vid",array("fields"=>$fields,"values"=>$indexes,"video_id"=>$videos[$i]['videoid']));
+ }
$i++;
}
-
- e($total_videos." videos have been reindexed successfully.","m");
+ e($start_index+1 ." - ".$to." videos have been reindexed successfully.","m");
+ assign("index_msgs",$msg);
+ assign("indexing","yes");
+ assign('mode','index_vids');
}
//Reindex Users
-if(isset($_POST['index_usrs'])) {
- $users = get_users(array("usr_status"=>"Ok"));
+if(isset($_GET['index_usrs'])) {
+ $msg = array();
+ $users = get_users(array("usr_status"=>"Ok","limit"=>$start_index.",".$loop_size));
+
$total_users = get_users(array("count_only"=>true,"usr_status"=>"Ok"));
$percent = $cbindex->percent(50,$total_users);
$i = 0;
- while($i < $total_users) {
- $params = array("user"=>$users[$i]['userid'],"comment_added"=>true,"subscriptions_count"=>true,"subscribers_count"=>true,
- "video_count"=>true,"groups_count"=>true);
- $indexes = $cbindex->count_index("user",$params);
- $fields = $cbindex->extract_fields("user",$params);
-
- $cbindex->update_index("user",array("fields"=>$fields,"values"=>$indexes,"user"=>$users[$i]['userid']));
-
- $i++;
- }
- e($total_users." users have been reindexed successfully.","m");
+ assign('total',$total_users);
+ assign('from',$start_index+1);
+ $to = $start_index+$loop_size;
+ if($to>$total_users)
+ {
+ $to = $total_users;
+ e($total_users." users have been reindexed successfully.","m");
+ assign("stop_loop","yes");
+ }
+ assign('to',$to);
+
+
+ while($i < $total_users)
+ {
+ if($users[$i]['userid'])
+ {
+ $params = array("user"=>$users[$i]['userid'],"comment_added"=>true,"subscriptions_count"=>true,"subscribers_count"=>true,
+ "video_count"=>true,"groups_count"=>true,"comment_received"=>true);
+ $indexes = $cbindex->count_index("user",$params);
+ $fields = $cbindex->extract_fields("user",$params);
+ $msg[] = $users[$i]['userid'].": Updating ".$users[$i]['username']." ";
+ $cbindex->update_index("user",array("fields"=>$fields,"values"=>$indexes,"user"=>$users[$i]['userid']));
+
+ }
+ $i++;
+
+ }
+ e($start_index+1 ." - ".$to." users have been reindexed successfully.","m");
+ assign("index_msgs",$msg);
+ assign("indexing","yes");
+ assign('mode','index_usrs');
+
}
//Reindex Grous
-if(isset($_POST['index_gps'])) {
+if(isset($_GET['index_gps'])) {
$groups = get_groups(array("active"=>"yes"));
$total_groups = get_groups(array("count_only"=>true,"active"=>"yes"));
$percent = $cbindex->percent(50,$total_groups);
$i = 0;
+
+ assign('total',$total_groups);
+ assign('from',$start_index+1);
+ $to = $start_index+$loop_size;
+ if($to>$total_groups)
+ {
+ $to = $total_groups;
+ e($total_groups." groups have been reindexed successfully.","m");
+ assign("stop_loop","yes");
+ }
+ assign('to',$to);
- while ($i < $total_groups) {
+ while ($i < $total_groups)
+ {
+ if($groups[$i]['group_id'])
+ {
$params = array("group_id"=>$groups[$i]['group_id'],"group_videos"=>true,"group_topics"=>true,"group_members"=>true);
$indexes = $cbindex->count_index("group",$params);
$fields = $cbindex->extract_fields("group",$params);
-
+ $msg[] = $groups[$i]['group_id'].": Updating ".$groups[$i]['group_name']." ";
$cbindex->update_index("group",array("fields"=>$fields,"values"=>$indexes,"group_id"=>$groups[$i]['group_id']));
-
+ }
$i++;
}
- e($total_groups." groups have been reindexed successfully.","m");
+
+ e($start_index+1 ." - ".$to." groups have been reindexed successfully.","m");
+ assign("index_msgs",$msg);
+ assign("indexing","yes");
+ assign('mode','index_gps');
}
subtitle("Re-index Clipbucket");
diff --git a/upload/admin_area/styles/cbv2/layout/global_header.html b/upload/admin_area/styles/cbv2/layout/global_header.html
index fbe20e91..102ea338 100644
--- a/upload/admin_area/styles/cbv2/layout/global_header.html
+++ b/upload/admin_area/styles/cbv2/layout/global_header.html
@@ -21,6 +21,8 @@ var imageurl = "{$imageurl}";
+
+
diff --git a/upload/admin_area/styles/cbv2/layout/main.html b/upload/admin_area/styles/cbv2/layout/main.html
index 8d636583..22f6eaaa 100644
--- a/upload/admin_area/styles/cbv2/layout/main.html
+++ b/upload/admin_area/styles/cbv2/layout/main.html
@@ -297,7 +297,15 @@ $(document).ready(function(){
FFMPEG Binary Path
-
+
+ Turn on VF
+
+
+ Yes
+
+
+ No
+
PHP Binary Path
diff --git a/upload/admin_area/styles/cbv2/layout/reindex_cb.html b/upload/admin_area/styles/cbv2/layout/reindex_cb.html
index 0999afb7..72d87788 100644
--- a/upload/admin_area/styles/cbv2/layout/reindex_cb.html
+++ b/upload/admin_area/styles/cbv2/layout/reindex_cb.html
@@ -4,28 +4,64 @@ Here you can re-index your videos, users or groups statistics. From below select
-
+
+
+{if $indexing}
+{$from} - {$to} of {$total}
+
+ {foreach from=$index_msgs item=themsg}
+ {$themsg}
+ {/foreach}
+
+{if $stop_loop!='yes'}
+
+redirecting....do not close this window
+{else}
+ Indexing has been completed.
+{/if}
+{/if}
diff --git a/upload/admin_area/styles/cbv2/layout/view_user.html b/upload/admin_area/styles/cbv2/layout/view_user.html
index a5668357..bfd702ca 100644
--- a/upload/admin_area/styles/cbv2/layout/view_user.html
+++ b/upload/admin_area/styles/cbv2/layout/view_user.html
@@ -203,9 +203,13 @@
- Total Profile Comments
+ Comments Made
+
+ Profile Comments
+
+
Profile Rating
diff --git a/upload/admin_area/styles/cbv2/theme/main.css b/upload/admin_area/styles/cbv2/theme/main.css
index 0621710d..87b70459 100644
--- a/upload/admin_area/styles/cbv2/theme/main.css
+++ b/upload/admin_area/styles/cbv2/theme/main.css
@@ -81,6 +81,7 @@ a[rel=sponsors]:hover { background:#555; border:1px solid #232323; }
h2,.page_title{font-size:18px; margin:5px 0px 5px 0px; display:inline; font-weight:normal}
h2,.page_title a{font-size:18px; }
+h4{margin:2px 0px}
/**
* Forms
@@ -280,4 +281,7 @@ margin-top: 0;
.cb_div{border:1px solid #CCC; padding:10px; margin:10px; margin-left:0px }
.cb_div td{border-bottom:1px solid #CCC}
.cb_div .heading{background-color:#F2F2F2; font-weight:bold}
-.cb_div input[type=submit]{padding:5px}
\ No newline at end of file
+.cb_div input[type=submit]{padding:5px}
+
+.reindex_tbl .button {width:130px}
+.reindex_tbl td{height:60px}
\ No newline at end of file
diff --git a/upload/includes/classes/ClipBucket.class.php b/upload/includes/classes/ClipBucket.class.php
index 2ea56a38..9ce7310c 100644
--- a/upload/includes/classes/ClipBucket.class.php
+++ b/upload/includes/classes/ClipBucket.class.php
@@ -308,6 +308,7 @@ class ClipBucket
'PHP Info' => 'phpinfo.php',
'Server Modules Info' => 'cb_mod_check.php',
'Conversion Queue Manager' => 'cb_conversion_queue.php',
+ 'ReIndexer' => 'reindex_cb.php',
//'View Encoding Status'=>'',
),
diff --git a/upload/includes/classes/conversion/ffmpeg.class.php b/upload/includes/classes/conversion/ffmpeg.class.php
index 451a7b00..2fb3da90 100644
--- a/upload/includes/classes/conversion/ffmpeg.class.php
+++ b/upload/includes/classes/conversion/ffmpeg.class.php
@@ -150,8 +150,17 @@ class ffmpeg
# video size, aspect and padding
+
$this->calculate_size_padding( $p, $i, $width, $height, $ratio, $pad_top, $pad_bottom, $pad_left, $pad_right );
+ $use_vf = config('use_ffmpeg_vf');
+ if($use_vf=='no')
+ {
$opt_av .= " -s {$width}x{$height} -aspect $ratio -padcolor 000000 -padtop $pad_top -padbottom $pad_bottom -padleft $pad_left -padright $pad_right ";
+ }else
+ {
+ $opt_av .= "-s {$width}x{$height} -aspect $ratio -vf 'pad=0:0:0:0:black'";
+ }
+
# audio codec, rate and bitrate
if($p['use_audio_codec'])
diff --git a/upload/includes/classes/user.class.php b/upload/includes/classes/user.class.php
index 24882eae..67bd36f5 100644
--- a/upload/includes/classes/user.class.php
+++ b/upload/includes/classes/user.class.php
@@ -2591,6 +2591,8 @@ class userquery extends CBCategory{
$uquery_val[] = $array['total_comments'];
$uquery_field[] = 'subscribers';
$uquery_val[] = $array['subscribers'];
+ $uquery_field[] = 'comments_count';
+ $uquery_val[] = $array['comments_count'];
$uquery_field[] = 'rating';
$rating = $array['rating'];
diff --git a/upload/includes/functions.php b/upload/includes/functions.php
index 3d9cc80f..696053bd 100644
--- a/upload/includes/functions.php
+++ b/upload/includes/functions.php
@@ -2353,11 +2353,23 @@
else
return true;
}elseif($vdo['broadcast']=='private'
- && !$userquery->is_confirmed_friend($vdo['userid'],userid()) && !has_access('video_moderation',true) && $vdo['userid']!=$uid){
+ && !$userquery->is_confirmed_friend($vdo['userid'],userid())
+ && !has_access('video_moderation',true)
+ && $vdo['userid']!=$uid){
e(lang('private_video_error'));
return false;
}else
+ {
+ $funcs = cb_get_functions('watch_video');
+ if($funcs)
+ foreach($funcs as $func)
+ {
+ $data = $func['func']($vdo);
+ if($data)
+ return $data;
+ }
return true;
+ }
}
diff --git a/upload/index.php b/upload/index.php
index 50c7be4b..7c32e4db 100644
--- a/upload/index.php
+++ b/upload/index.php
@@ -1,25 +1,25 @@
-page_redir();
-
-if(is_installed('editorspick'))
-{
- assign('editor_picks',get_ep_videos());
-}
-
-//i love coding :)
-
-//Displaying The Template
-template_files('index.html');
-display_it();
-
+page_redir();
+
+if(is_installed('editorspick'))
+{
+ assign('editor_picks',get_ep_videos());
+}
+
+//i love coding :)
+
+//Displaying The Template
+template_files('index.html');
+display_it();
+
?>
\ No newline at end of file
diff --git a/upload/js/jquery_plugs/timer.js b/upload/js/jquery_plugs/timer.js
new file mode 100644
index 00000000..859ce473
--- /dev/null
+++ b/upload/js/jquery_plugs/timer.js
@@ -0,0 +1,138 @@
+/**
+ * jQuery.timers - Timer abstractions for jQuery
+ * Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com)
+ * Licensed under the WTFPL (http://sam.zoy.org/wtfpl/).
+ * Date: 2009/10/16
+ *
+ * @author Blair Mitchelmore
+ * @version 1.2
+ *
+ **/
+
+jQuery.fn.extend({
+ everyTime: function(interval, label, fn, times) {
+ return this.each(function() {
+ jQuery.timer.add(this, interval, label, fn, times);
+ });
+ },
+ oneTime: function(interval, label, fn) {
+ return this.each(function() {
+ jQuery.timer.add(this, interval, label, fn, 1);
+ });
+ },
+ stopTime: function(label, fn) {
+ return this.each(function() {
+ jQuery.timer.remove(this, label, fn);
+ });
+ }
+});
+
+jQuery.extend({
+ timer: {
+ global: [],
+ guid: 1,
+ dataKey: "jQuery.timer",
+ regex: /^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/,
+ powers: {
+ // Yeah this is major overkill...
+ 'ms': 1,
+ 'cs': 10,
+ 'ds': 100,
+ 's': 1000,
+ 'das': 10000,
+ 'hs': 100000,
+ 'ks': 1000000
+ },
+ timeParse: function(value) {
+ if (value == undefined || value == null)
+ return null;
+ var result = this.regex.exec(jQuery.trim(value.toString()));
+ if (result[2]) {
+ var num = parseFloat(result[1]);
+ var mult = this.powers[result[2]] || 1;
+ return num * mult;
+ } else {
+ return value;
+ }
+ },
+ add: function(element, interval, label, fn, times) {
+ var counter = 0;
+
+ if (jQuery.isFunction(label)) {
+ if (!times)
+ times = fn;
+ fn = label;
+ label = interval;
+ }
+
+ interval = jQuery.timer.timeParse(interval);
+
+ if (typeof interval != 'number' || isNaN(interval) || interval < 0)
+ return;
+
+ if (typeof times != 'number' || isNaN(times) || times < 0)
+ times = 0;
+
+ times = times || 0;
+
+ var timers = jQuery.data(element, this.dataKey) || jQuery.data(element, this.dataKey, {});
+
+ if (!timers[label])
+ timers[label] = {};
+
+ fn.timerID = fn.timerID || this.guid++;
+
+ var handler = function() {
+ if ((++counter > times && times !== 0) || fn.call(element, counter) === false)
+ jQuery.timer.remove(element, label, fn);
+ };
+
+ handler.timerID = fn.timerID;
+
+ if (!timers[label][fn.timerID])
+ timers[label][fn.timerID] = window.setInterval(handler,interval);
+
+ this.global.push( element );
+
+ },
+ remove: function(element, label, fn) {
+ var timers = jQuery.data(element, this.dataKey), ret;
+
+ if ( timers ) {
+
+ if (!label) {
+ for ( label in timers )
+ this.remove(element, label, fn);
+ } else if ( timers[label] ) {
+ if ( fn ) {
+ if ( fn.timerID ) {
+ window.clearInterval(timers[label][fn.timerID]);
+ delete timers[label][fn.timerID];
+ }
+ } else {
+ for ( var fn in timers[label] ) {
+ window.clearInterval(timers[label][fn]);
+ delete timers[label][fn];
+ }
+ }
+
+ for ( ret in timers[label] ) break;
+ if ( !ret ) {
+ ret = null;
+ delete timers[label];
+ }
+ }
+
+ for ( ret in timers ) break;
+ if ( !ret )
+ jQuery.removeData(element, this.dataKey);
+ }
+ }
+ }
+});
+
+jQuery(window).bind("unload", function() {
+ jQuery.each(jQuery.timer.global, function(index, item) {
+ jQuery.timer.remove(item);
+ });
+});
\ No newline at end of file
diff --git a/upload/player/pak_player/pak_player.php b/upload/player/pak_player/pak_player.php
index e76f9668..0907d5bf 100644
--- a/upload/player/pak_player/pak_player.php
+++ b/upload/player/pak_player/pak_player.php
@@ -63,6 +63,8 @@ if(!function_exists("pak_player"))
preg_match("/\?v\=(.*)/",$ref,$srcs);
$srcs = explode("&",$srcs[1]);
+ $srcs = $srcs[0];
+ $srcs = explode("?",$srcs);
$ytcode = $srcs[0];
assign('youtube',true);
assign('ytcode',$ytcode);
diff --git a/upload/player/pak_player/player.html b/upload/player/pak_player/player.html
index ac7c8465..5ae64460 100644
--- a/upload/player/pak_player/player.html
+++ b/upload/player/pak_player/player.html
@@ -65,7 +65,7 @@ flowplayer("the_Video_Player", "{$pak_player_url}/pak_player.swf", {literal}{
youtube :
{literal}
{
- url:pakplayer_path+'/flowplayer.youtube-3.2.swf',
+ url:pakplayer_path+'/pak_player.youtube.swf',
enableGdata: true,
}
{/literal}