From 3a9315201979d6c5ba3bf65d1fefa67f78d7058f Mon Sep 17 00:00:00 2001 From: Arslan Hassan Date: Tue, 27 Sep 2011 10:54:39 +0000 Subject: [PATCH] Added : Mass Email Update : Update cb stats Update : FFMPEG codecs check --- upload/actions/update_cb_stats.php | 3 ++- upload/admin_area/charts/groups_activity.php | 6 +++--- upload/admin_area/charts/users_activity.php | 6 +++--- upload/admin_area/charts/videos_activity.php | 8 ++++---- .../styles/cbv2/layout/cb_mod_check.html | 19 +++++-------------- upload/cb_install/sql/structure.sql | 17 +++++++++++++++++ upload/cb_install/sql/upgrade_2.6.sql | 17 +++++++++++++++++ upload/includes/classes/video.class.php | 2 ++ upload/includes/functions.php | 15 +++++++++++---- 9 files changed, 64 insertions(+), 29 deletions(-) diff --git a/upload/actions/update_cb_stats.php b/upload/actions/update_cb_stats.php index d41d3b67..1d4a7e15 100644 --- a/upload/actions/update_cb_stats.php +++ b/upload/actions/update_cb_stats.php @@ -31,7 +31,8 @@ $videos['comments'] = $vid_comments[0]['total_comments']; /** * Testing * * PASSED - */echo json_encode($videos); + */ + echo json_encode($videos); //Users diff --git a/upload/admin_area/charts/groups_activity.php b/upload/admin_area/charts/groups_activity.php index 20a959f0..5629a978 100644 --- a/upload/admin_area/charts/groups_activity.php +++ b/upload/admin_area/charts/groups_activity.php @@ -32,9 +32,9 @@ for($i=0;$i<$days;$i++) for($i=0;$i<$days;$i++) { - $day[$i]['video'] = json_decode($datas[$i]['video_stats']); - $day[$i]['users'] = json_decode($datas[$i]['user_stats']); - $day[$i]['groups'] = json_decode($datas[$i]['group_stats']); + $day[$i]['video'] = json_decode($datas[$i]['video_stats'],true); + $day[$i]['users'] = json_decode($datas[$i]['user_stats'],true); + $day[$i]['groups'] = json_decode($datas[$i]['group_stats'],true); } $max = 1; diff --git a/upload/admin_area/charts/users_activity.php b/upload/admin_area/charts/users_activity.php index 871da28c..43869ac6 100644 --- a/upload/admin_area/charts/users_activity.php +++ b/upload/admin_area/charts/users_activity.php @@ -32,9 +32,9 @@ for($i=0;$i<$days;$i++) for($i=0;$i<$days;$i++) { - $day[$i]['video'] = json_decode($datas[$i]['video_stats']); - $day[$i]['users'] = json_decode($datas[$i]['user_stats']); - $day[$i]['groups'] = json_decode($datas[$i]['group_stats']); + $day[$i]['video'] = json_decode($datas[$i]['video_stats'],true); + $day[$i]['users'] = json_decode($datas[$i]['user_stats'],true); + $day[$i]['groups'] = json_decode($datas[$i]['group_stats'],true); } $max = 1; diff --git a/upload/admin_area/charts/videos_activity.php b/upload/admin_area/charts/videos_activity.php index 2c01fdce..58c4881d 100644 --- a/upload/admin_area/charts/videos_activity.php +++ b/upload/admin_area/charts/videos_activity.php @@ -32,9 +32,9 @@ for($i=0;$i<$days;$i++) for($i=0;$i<$days;$i++) { - $day[$i]['video'] = json_decode($datas[$i]['video_stats']); - $day[$i]['users'] = json_decode($datas[$i]['user_stats']); - $day[$i]['groups'] = json_decode($datas[$i]['group_stats']); + $day[$i]['video'] = json_decode($datas[$i]['video_stats'],true); + $day[$i]['users'] = json_decode($datas[$i]['user_stats'],true); + $day[$i]['groups'] = json_decode($datas[$i]['group_stats'],true); } $max = 1; @@ -43,7 +43,7 @@ for($i=0;$i<$days;$i++) if($i==$days-1) { $uploads[] = $cbvid->get_videos(array("count_only"=>true,"date_span"=>"today"))+0; - $active[] = $cbvid->get_videos(array("count_only"=>true,"date_span"=>"today","active"=>'yes'))+0; + $active[] = $cbvid->get_videos(array("count_only"=>true,"date_span"=>"today","active"=>'yes',"status"=>'Successful'))+0; $processing[] = $cbvid->get_videos(array("count_only"=>true,"date_span"=>"today","status"=>'Processing'))+0; }else{ $uploads[] =$day[$i]['video']->uploads+0; diff --git a/upload/admin_area/styles/cbv2/layout/cb_mod_check.html b/upload/admin_area/styles/cbv2/layout/cb_mod_check.html index fc03e8be..f2803d46 100644 --- a/upload/admin_area/styles/cbv2/layout/cb_mod_check.html +++ b/upload/admin_area/styles/cbv2/layout/cb_mod_check.html @@ -63,27 +63,24 @@

MODULES VERSION

- +
-
  Module
Installed Version
Required Version
Status
 
- +
- + - - - + @@ -92,8 +89,6 @@ - - @@ -103,8 +98,6 @@ - - @@ -114,8 +107,6 @@ - - @@ -124,7 +115,7 @@
-

CHECKING FFMPEG CODECS

+

CHECKING FFMPEG CODECS

{assign var=ffmpeg value=func->get_ffmpeg_codecs()}
  FFMPEG r{$ffmpeg_status.version}{$ffmpeg_status.version} r19000 or greater  
{$php_status.version} 5.2.1 or greater  
{$flvtool2_status.version} 1.0.6 or greater  
{$mp4box_status.version} 0.4.5 or greater  
diff --git a/upload/cb_install/sql/structure.sql b/upload/cb_install/sql/structure.sql index fa72a45c..ff59b6f5 100644 --- a/upload/cb_install/sql/structure.sql +++ b/upload/cb_install/sql/structure.sql @@ -1081,3 +1081,20 @@ ADD `collection_moderation` ENUM( 'yes', 'no' ) NOT NULL DEFAULT 'no' AFTER `pho ADD `plugins_moderation` ENUM( 'yes', 'no' ) NOT NULL DEFAULT 'no' AFTER `collection_moderation` , ADD `tool_box` ENUM( 'yes', 'no' ) NOT NULL DEFAULT 'no' AFTER `plugins_moderation` , ADD `plugins_perms` TEXT NOT NULL AFTER `tool_box` ; + +CREATE TABLE IF NOT EXISTS `{tbl_prefix}mass_emails` ( + `id` int(255) NOT NULL AUTO_INCREMENT, + `email_subj` varchar(255) NOT NULL, + `email_from` varchar(255) NOT NULL, + `email_msg` text NOT NULL, + `configs` text NOT NULL, + `sent` bigint(255) NOT NULL, + `total` bigint(20) NOT NULL, + `users` text NOT NULL, + `start_index` bigint(255) NOT NULL, + `method` enum('browser','background') NOT NULL, + `status` enum('completed','pending','sending') NOT NULL, + `date_added` datetime NOT NULL, + `last_update` datetime NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; \ No newline at end of file diff --git a/upload/cb_install/sql/upgrade_2.6.sql b/upload/cb_install/sql/upgrade_2.6.sql index 2df25cc0..a3b0915b 100644 --- a/upload/cb_install/sql/upgrade_2.6.sql +++ b/upload/cb_install/sql/upgrade_2.6.sql @@ -42,6 +42,23 @@ UPDATE `{tbl_prefix}user_levels_permissions` SET `photos_moderation` = 'yes', `plugins_moderation` = 'yes', `tool_box` = 'yes' WHERE `cb_user_levels_permissions`.`user_level_permission_id` =1; +UPDATE {tbl_prefix}video SET rating='10' WHERE rating>10; +CREATE TABLE IF NOT EXISTS `{tbl_prefix}mass_emails` ( + `id` int(255) NOT NULL AUTO_INCREMENT, + `email_subj` varchar(255) NOT NULL, + `email_from` varchar(255) NOT NULL, + `email_msg` text NOT NULL, + `configs` text NOT NULL, + `sent` bigint(255) NOT NULL, + `total` bigint(20) NOT NULL, + `users` text NOT NULL, + `start_index` bigint(255) NOT NULL, + `method` enum('browser','background') NOT NULL, + `status` enum('completed','pending','sending') NOT NULL, + `date_added` datetime NOT NULL, + `last_update` datetime NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; ALTER TABLE `{tbl_prefix}photos` ADD `photo_details` TEXT NOT NULL AFTER `photo_tags`; \ No newline at end of file diff --git a/upload/includes/classes/video.class.php b/upload/includes/classes/video.class.php index ae5996b8..59f4c7c8 100644 --- a/upload/includes/classes/video.class.php +++ b/upload/includes/classes/video.class.php @@ -1347,6 +1347,8 @@ class CBvideo extends CBCategory $new_by = $total_voters; $newrate = ($t + $rating) / $new_by; + if($newrate>10) + $newrate = 10; $db->update(tbl($this->dbtbl['video']),array("rating","rated_by","voter_ids"),array($newrate,$new_by,"|no_mc|$voters")," videoid='$id'"); $userDetails = array( "object_id" => $id, diff --git a/upload/includes/functions.php b/upload/includes/functions.php index 0fe13166..0cae130e 100644 --- a/upload/includes/functions.php +++ b/upload/includes/functions.php @@ -4565,7 +4565,7 @@ /** * Function used to check weather FFMPEG has Required Modules installed or not */ - function get_ffmpeg_codecs() + function get_ffmpeg_codecs($data=false) { $req_codecs = array ('libxvid' => 'Required for DIVX AVI files', @@ -4576,7 +4576,11 @@ 'libtheora' => 'Theora is an open video codec being developed by the Xiph.org', 'libvorbis' => 'Ogg Vorbis is a new audio compression format', ); - $version = shell_output( get_binaries('ffmpeg').' -i xxx -acodec copy -vcodec copy -f null /dev/null 2>&1' ); + + if($data) + $version = $data; + else + $version = shell_output( get_binaries('ffmpeg').' -i xxx -acodec copy -vcodec copy -f null /dev/null 2>&1' ); preg_match_all("/enable\-(.*) /Ui",$version,$matches); $installed = $matches[1]; @@ -4654,9 +4658,12 @@ //pr($matches); if(is_numeric(floatval($matches[1]))) { return $matches[1]; - } else { - return false; } + preg_match("/FFmpeg version ([0-9.]+),/i",strtolower($ffmpegData),$matches); + if(is_numeric(floatval($matches[1]))) { + return $matches[1]; + } + } break; case 'php':