From 3e76f346b4f144afd5d93bb15ec8071bafda9647 Mon Sep 17 00:00:00 2001 From: Arslan Hassan Date: Mon, 26 Apr 2010 15:17:37 +0000 Subject: [PATCH] Added : Comments Captcha Added : New HD FLV Player (Working) --- sql/2.0.6~2.0.7.txt | 4 +- upload/admin_area/main.php | 5 +- upload/admin_area/manage_players.php | 3 ++ .../admin_area/styles/cbv2/layout/main.html | 20 ++++++++ .../styles/cbv2/layout/manage_players.html | 48 +++++++++++++++---- upload/includes/classes/ClipBucket.class.php | 3 +- upload/includes/classes/my_queries.class.php | 2 + upload/js/functions.js | 11 ++++- .../layout/blocks/comments/add_comment.html | 18 +++++++ .../styles/cbv2new/layout/global_header.html | 8 +++- 10 files changed, 107 insertions(+), 15 deletions(-) diff --git a/sql/2.0.6~2.0.7.txt b/sql/2.0.6~2.0.7.txt index c70e8f66..4f21c927 100644 --- a/sql/2.0.6~2.0.7.txt +++ b/sql/2.0.6~2.0.7.txt @@ -1 +1,3 @@ -INSERT INTO `clipbucket_svn`.`cb_config` (`configid`, `name`, `value`) VALUES (NULL, 'allow_username_spaces', 'yes'); \ No newline at end of file +INSERT INTO `cb_config` (`configid`, `name`, `value`) VALUES (NULL, 'allow_username_spaces', 'yes'); +INSERT INTO `cb_config` (`configid`, `name`, `value`) VALUES (NULL, 'use_playlist', 'yes'); +INSERT INTO `cb_config` (`configid`, `name`, `value`) VALUES (NULL, 'comments_captcha', 'all'); \ No newline at end of file diff --git a/upload/admin_area/main.php b/upload/admin_area/main.php index c14c3df6..abe4f0ed 100644 --- a/upload/admin_area/main.php +++ b/upload/admin_area/main.php @@ -38,7 +38,7 @@ if(isset($_POST['update'])){ 'big_thumb_width', 'big_thumb_height', - 'closed' , + 'closed', 'closed_msg', 'channel_comments', 'anonym_comments', @@ -46,7 +46,8 @@ if(isset($_POST['update'])){ 'channels_list_per_tab', 'captcha_type', 'con_modules_type', - 'comment_rating' , + 'comments_captcha', + 'comment_rating', 'date_format', 'description', diff --git a/upload/admin_area/manage_players.php b/upload/admin_area/manage_players.php index 4c28c85a..a8c07076 100644 --- a/upload/admin_area/manage_players.php +++ b/upload/admin_area/manage_players.php @@ -12,12 +12,15 @@ $userquery->admin_login_check(); $pages->page_redir(); $userquery->login_check('admin_access'); +//Set Mode +assign('mode',$_GET['mode']); if(isset($_POST['update'])){ $configs = $Cbucket->configs; $rows = array( 'autoplay_video', + 'use_playlist', ); foreach($rows as $field) diff --git a/upload/admin_area/styles/cbv2/layout/main.html b/upload/admin_area/styles/cbv2/layout/main.html index 53ec4138..b9456605 100644 --- a/upload/admin_area/styles/cbv2/layout/main.html +++ b/upload/admin_area/styles/cbv2/layout/main.html @@ -200,6 +200,26 @@ $(document).ready(function(){ Allow comments rating + + Comments Captcha +

+ + + + + +
+

+     diff --git a/upload/admin_area/styles/cbv2/layout/manage_players.html b/upload/admin_area/styles/cbv2/layout/manage_players.html index ce7bea2a..b19497de 100644 --- a/upload/admin_area/styles/cbv2/layout/manage_players.html +++ b/upload/admin_area/styles/cbv2/layout/manage_players.html @@ -1,22 +1,43 @@ +{if $mode =='show_settings'} - +
ClipBucket Website Player Settings - click here to edit setting
ClipBucket Website Player Settings  
-
-
+
+
- - + + + + + + + + + + + + +
+
Use Playlist
+
By turning this on, player will turn on playlists feature in player (if available)
+
  
  
@@ -81,6 +102,9 @@ {/literal} +
+In order to change player size, resize the box given below.. +
@@ -91,7 +115,7 @@
-
+

Original Size of your Main Website Player

@@ -100,6 +124,9 @@
+ +
+
Main Website Player - click here to main website player
@@ -108,7 +135,7 @@
Channel Player Settings - click here to edit channel player settings
-
+

Original Size of your Main Website Player

@@ -120,6 +147,9 @@
+{else} + +

Selected Player

@@ -161,4 +191,6 @@ Website : {$curplayer.website}
{/if} {/foreach} -
\ No newline at end of file +
+ +{/if} \ No newline at end of file diff --git a/upload/includes/classes/ClipBucket.class.php b/upload/includes/classes/ClipBucket.class.php index c295ebfe..1d65a459 100644 --- a/upload/includes/classes/ClipBucket.class.php +++ b/upload/includes/classes/ClipBucket.class.php @@ -291,7 +291,8 @@ class ClipBucket array( 'Templates Manager'=>'templates.php', 'Templates Editor'=>'template_editor.php', - 'Players Manager' => 'manage_players.php' + 'Players Manager' => 'manage_players.php', + 'Player Settings' => 'manage_players.php?mode=show_settings' ), //Plugin Manager diff --git a/upload/includes/classes/my_queries.class.php b/upload/includes/classes/my_queries.class.php index 1f26bb67..5fc07782 100644 --- a/upload/includes/classes/my_queries.class.php +++ b/upload/includes/classes/my_queries.class.php @@ -422,6 +422,8 @@ class myquery { if(strlen($comment) > MAX_COMMENT_CHR) e(sprintf("'%d' characters allowed for comment",MAX_COMMENT_CHR)); } + if(!verify_captcha()) + e(lang('usr_ccode_err')); if(empty($comment)) e(lang("pelase_enter_something_for_comment")); diff --git a/upload/js/functions.js b/upload/js/functions.js index 0164e60b..bd0466db 100644 --- a/upload/js/functions.js +++ b/upload/js/functions.js @@ -415,7 +415,8 @@ var loading = loading_img+" Loading..."; $("#add_comment_result").css("display","block"); $("#add_comment_result").html(loading); $("#add_comment_button").attr("disabled","disabled"); - + + var captcha_enabled = $("#"+form_id+" input:#cb_captcha_enabled").val(); $.post(page, { mode : 'add_comment', @@ -424,7 +425,9 @@ var loading = loading_img+" Loading..."; comment : $("#"+form_id+" textarea:#comment_box").val(), obj_id : $("#"+form_id+" input:#obj_id").val(), reply_to : $("#"+form_id+" input:#reply_to").val(), - type : type + type : type, + cb_captcha_enabled: $("#"+form_id+" input:#cb_captcha_enabled").val(), + cb_captcha: $("#"+form_id+" input:#captcha").val() }, function(data) { @@ -432,11 +435,15 @@ var loading = loading_img+" Loading..."; alert("No data"); else { + $("#add_comment_button").attr("disabled",""); $("#add_comment_result").css("display","block"); if(data.err!='') + { + captcha_enabled $("#add_comment_result").html(data.err); + } if(data.msg!='') $("#add_comment_result").html(data.msg); diff --git a/upload/styles/cbv2new/layout/blocks/comments/add_comment.html b/upload/styles/cbv2new/layout/blocks/comments/add_comment.html index 52b02eee..c9a20017 100644 --- a/upload/styles/cbv2new/layout/blocks/comments/add_comment.html +++ b/upload/styles/cbv2new/layout/blocks/comments/add_comment.html @@ -16,6 +16,24 @@ Name : {$userquery->username}
{/if}
+ + {if config('comments_captcha')=='all' || ( config('comments_captcha')=='guests' && !$userquery->login_check('',true) )} + {assign var=captcha value=func->get_captcha()} + {if $captcha} + {if $captcha.show_field} +
+ {load_captcha captcha=$captcha load=field field_params = ' id="captcha" class="input'} +
+ {/if} + +
+ {load_captcha captcha=$captcha load=function} +
+
+ {/if} + {/if} + + {ANCHOR place='before_compose_box'} diff --git a/upload/styles/cbv2new/layout/global_header.html b/upload/styles/cbv2new/layout/global_header.html index 553d89c6..13b6651d 100644 --- a/upload/styles/cbv2new/layout/global_header.html +++ b/upload/styles/cbv2new/layout/global_header.html @@ -217,7 +217,13 @@ $(document).ready(function() { {/literal} - +{literal} + +{/literal}