Changeset 857357
- Timestamp:
- 02/13/2014 05:29:34 PM (12 years ago)
- Location:
- agreeable
- Files:
-
- 1 added
- 3 edited
- 3 copied
-
tags/0.2 (added)
-
tags/0.2/agreeable-options.php (copied) (copied from agreeable/trunk/agreeable-options.php) (5 diffs)
-
tags/0.2/agreeable.php (copied) (copied from agreeable/trunk/agreeable.php) (4 diffs)
-
tags/0.2/readme.txt (copied) (copied from agreeable/trunk/readme.txt) (3 diffs)
-
trunk/agreeable-options.php (modified) (5 diffs)
-
trunk/agreeable.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
agreeable/tags/0.2/agreeable-options.php
r856577 r857357 1 1 <?php 2 if( $_POST['ag_hidden'] == 'Y') {2 if(isset($_POST['ag_hidden']) && $_POST['ag_hidden'] == 'Y') { 3 3 //Form data sent 4 4 5 $dbfail = $_POST['ag_fail']; 5 $dbfail = $_POST['ag_fail']; 6 6 7 $dbfail = stripslashes($dbfail); 7 8 update_option('ag_fail', $dbfail); 8 9 9 10 $dbtermm = $_POST['ag_termm']; 10 $dbtermm = stripslashes($dbtermm); 11 update_option('ag_termm', $dbtermm); 11 12 $dbtermm = stripslashes($dbtermm); 13 update_option('ag_termm', $dbtermm); 12 14 13 15 $dburl = $_POST['ag_url']; … … 19 21 $dbregister = $_POST['ag_register']; 20 22 update_option('ag_register', $dbregister); 21 22 23 ?> 23 24 … … 58 59 #feedback-form input[type="email"], #feedback-form textarea {width: 100%; display: block;} 59 60 #feedback-form textarea {min-height: 100px;} 61 .checkboxes {padding-bottom: 1em;} 60 62 </style> 63 64 <?php $pages = get_pages('status=publish&numberposts=-1&posts_per_page=-1'); ?> 65 61 66 <div class="wrap"> 62 67 … … 74 79 <p><label for="ag_fail"><?php _e("Failed to agree error message: " ); ?></label><input type="text" name="ag_fail" value="<?php echo $dbfail; ?>" size="20"></br><?php _e("<span class='mes'>This is what shows up if they don't check the box</span>" ); ?></p> 75 80 76 <p><label for="ag_url"><?php _e("URL for Terms: " ); ?></label><input type="text" name="ag_url" value="<?php echo $dburl; ?>" size="20"></br><?php _e("<span class='mes'>This is the URL where the user can read your terms</span>" ); ?></p> 81 <p> 82 <?php _e("<span class='mes'>This is the URL where the user can read your terms</span>" ); ?> 83 <label for="ag_url">Select your terms page</label> 84 <select name="ag_url"> 85 <?php foreach ($pages as $p) { ?> 86 <option value="<?php echo $p->ID; ?>" <?php echo $dburl == $p->ID ? 'selected="selected"' : ''; ?>><?php echo $p->post_title; ?></option> 87 <?php } ?> 88 </select> 89 </p> 77 90 78 91 <p><label for="ag_termm"><?php _e("Message: " ); ?></label><input type="text" name="ag_termm" size="40" value="<?php echo $dbtermm; ?>"><br><?php _e("<span class='mes'>This is the text that goes right after the checkbox</span>" ); ?></p> … … 82 95 <p> 83 96 <h3><?php _e("Where should it be displayed? " ); ?></h3> 84 <input type="checkbox" id="ag_login" name="ag_login" value="1" <?php if($dblogin == 1) {echo 'checked';} ?> /> <label for="ag_login"> Login form</label><br>97 <input type="checkbox" id="ag_login" name="ag_login" value="1" <?php if($dblogin == 1) {echo 'checked';} ?> /> <label for="ag_login"> Login form</label><br> 85 98 <input type="checkbox" id="ag_register" name="ag_register" value="1" <?php if($dbregister == 1) {echo 'checked';} ?> /> <label for="ag_register">Registration form</label> 86 99 </p> 87 </div> 100 </div> 88 101 89 102 <p class="submit"> -
agreeable/tags/0.2/agreeable.php
r856577 r857357 4 4 Plugin URI: http://wordpress.org/extend/plugins/agreeable 5 5 Description: Add a required "Agree to terms" checkbox to login and/or register forms. Based on the I-Agree plugin by Michael Stursberg. 6 Version: 0. 1.2.17 Author: buildcreate , thesturs6 Version: 0.2 7 Author: buildcreate 8 8 Author URI: http://buildcreate.com 9 9 */ 10 10 11 function wp_authenticate_user_acc($user , $password) {11 function wp_authenticate_user_acc($user) { 12 12 13 13 $dblogin = get_option('ag_login'); 14 14 $dbregister = get_option('ag_register'); 15 $dbfail = get_option('ag_fail'); 16 $body_class = get_body_class(); 17 $login_page = get_option('ag_login_page'); 18 $register_page = get_option('ag_register_page'); 15 19 16 if($GLOBALS['pagenow'] == 'wp-login.php' && $dblogin == 1 || in_array('login', $body_class) && $dblogin == 1 || $GLOBALS['pagenow'] == 'wp-register.php' && $dbregister == 1 || in_array('register', $body_class) && $dbregister == 1 ) { 17 18 $dbfail = get_option('ag_fail'); 20 global $bp, $post; 21 isset($post) ? $pid = $post->ID : $pid = NULL; 19 22 20 23 // See if the checkbox #login_accept was checked … … 24 27 } else { 25 28 // Did NOT check the box, do not allow login 29 26 30 $error = new WP_Error(); 27 31 $error->add('did_not_accept', $dbfail); 32 33 if(isset($bp->signup)) { 34 $bp->signup->errors['login_accept'] = '<div class="error">'.$dbfail.'</div>'; 35 } 36 28 37 return $error; 29 38 } 30 } else { 31 return $user; 32 } 39 40 } 41 42 // Add it to the appropriate hooks 43 add_filter('wp_authenticate_user', 'wp_authenticate_user_acc', 99999, 2); 44 add_filter('registration_errors', 'wp_authenticate_user_acc', 99999, 2); 45 add_filter('bp_signup_validate', 'wp_authenticate_user_acc', 99999, 2); 46 47 function display_terms_form() { 48 $dbtermm = get_option('ag_termm'); 49 $dburl = get_option('ag_url'); 50 51 global $post; 52 isset($post) ? $pid = $post->ID : $pid = NULL; 53 $body_class = get_body_class(); 54 55 global $bp; 56 57 if(isset($dburl)) {$terms = get_post($dburl); $terms = apply_filters('the_content', $terms->post_content);} 58 59 // Add an element to the login form, which must be checked 60 61 agreeable_thickbox(); 62 63 echo '<style>#terms{display: none} #TB_ajaxContent p {font-weight: 200; line-height: 1.5em;}</style>'; 64 echo '<div style="clear: both; padding: .25em 0;" id="terms-accept" class="terms-form">'; 65 if(isset($bp)){do_action( 'bp_login_accept_errors' );} 66 echo '<label style="text-align: left;"><input type="checkbox" name="login_accept" id="login_accept" /> <a title="'.get_post($dburl)->post_title.'" class="thickbox" target="_BLANK" href="#TB_inline?width=600&height=550&inlineId=terms">'.$dbtermm.'</a></label></div>'; 67 68 echo '<div id="terms"><div>'.$terms.'</div></div>'; 69 } 70 71 function login_terms_accept(){ 72 $dblogin = get_option('ag_login'); 73 74 if($dblogin == 1) { 75 display_terms_form(); 76 } 77 } 78 79 function register_terms_accept() { 80 81 $dbregister = get_option('ag_register'); 82 83 if($dbregister == 1) { 84 display_terms_form(); 85 } 33 86 } 34 87 35 88 // As part of WP login form construction, call our function 36 add_filter ( 'login_form', ' terms_accept' );37 add_filter ( 'register_form', ' terms_accept' );38 add_action('bp_before_registration_submit_buttons', ' terms_accept');89 add_filter ( 'login_form', 'login_terms_accept' ); 90 add_filter ( 'register_form', 'register_terms_accept' ); 91 add_action('bp_before_registration_submit_buttons', 'register_terms_accept'); 39 92 40 function terms_accept(){ 41 $dbtermm = get_option('ag_termm'); 42 $dburl = get_option('ag_url'); 93 94 function ag_widget_terms_accept() { 95 43 96 $dblogin = get_option('ag_login'); 44 $dbregister = get_option('ag_register');45 global $post;46 $body_class = get_body_class();47 97 48 if($GLOBALS['pagenow'] == 'wp-login.php' && $dblogin == 1 || in_array('login', $body_class) && $dblogin == 1 || $GLOBALS['pagenow'] == 'wp-register.php' && $dbregister == 1 || in_array('register', $body_class) && $dbregister == 1 ) { 98 if($dblogin == 1) { 99 display_terms_form(); 100 } 101 102 echo '<script>'; 103 echo ' 104 jQuery(document).ready(function($){ 105 $("#terms-accept").insertBefore("#bp-login-widget-rememberme"); 106 $("#bp-login-widget-form").nextAll(".terms-form").hide(); 107 }); 108 '; 109 echo '</script>'; 110 111 } 49 112 50 51 // Add an element to the login form, which must be checked 52 echo '<div id="terms-accept"><label><input type="checkbox" name="login_accept" id="login_accept" /> <a target="_BLANK" href="'.$dburl.'">'.$dbtermm.'</a></label></div><br>'; 53 } 113 add_action('bp_after_login_widget_loggedout', 'ag_widget_terms_accept'); 114 115 function agreeable_thickbox() { 116 if (! is_admin()) { 117 wp_enqueue_script('thickbox', null, array('jquery')); 118 wp_enqueue_style('thickbox.css', '/'.WPINC.'/js/thickbox/thickbox.css', null, '1.0'); 119 } 54 120 } 55 121 … … 65 131 add_action('admin_menu', 'agreeable_options'); 66 132 67 // Add it to the appropriate hooks68 add_filter('wp_authenticate_user', 'wp_authenticate_user_acc', 99999, 2);69 add_filter('registration_errors', 'wp_authenticate_user_acc', 99999, 2);70 add_filter('bp_signup_validate', 'wp_authenticate_user_acc', 9999, 2);71 72 133 73 134 /* Plugin feedback form */ … … 75 136 function feedback_form() { 76 137 77 if(! $_POST['feedback_email'] && !$_POST['feedback_content']) {138 if(!isset($_POST['feedback_email']) && !isset($_POST['feedback_content'])) { 78 139 79 140 $output = '<h3>We want your feedback.</h3> -
agreeable/tags/0.2/readme.txt
r856579 r857357 1 1 === Agreeable === 2 Contributors: buildcreate 3 Tags: agree, terms, conditions, require, terms, login, log in, admin, login page, admin, buddy press, page, policy, privacy 2 Contributors: buildcreate, thesturs 3 Tags: agree, terms, conditions, require, terms, login, log in, admin, login page, admin, buddy press, page, policy, privacy, bbpress, theme my login, signup, register, widgets 4 4 Requires at least: 3.5 5 5 Tested up to: 3.8.1 6 6 Stable tag: trunk 7 7 License:GPLv2 or later 8 Add an "Agree to terms" check box on login and/or registration pages. Works with BuddyPress .8 Add an "Agree to terms" check box on login and/or registration pages. Works with BuddyPress and bbPress 9 9 10 10 == Description == … … 12 12 13 13 Use the form in the plugin settings page to contact us with feature requests, comments, or concerns. 14 15 = New Features = 16 * Now you select your terms page from a dropdown 17 * Terms now open in a lightbox 18 * Tested with WP, BuddyPress, and bbPress login widgets 19 * Updated error display for BuddyPress 20 * Works with custom Login/Registration pages (like Theme My Login) 14 21 15 22 = Rated 4 stars by the WP Plugins A to Z podcast! = … … 25 32 26 33 == Changelog == 34 35 = 0.2 = 36 * Resolved a few warnings and notices that were cropping up 37 * Now you select your terms page from a dropdown 38 * Terms now open in a lightbox 39 * Tested with WP, BuddyPress, and bbPress login widgets 40 * Updated error display for BuddyPress 41 * Works with custom Login/Registration pages (like Theme My Login) 27 42 28 43 = 0.1.2.1 = -
agreeable/trunk/agreeable-options.php
r856577 r857357 1 1 <?php 2 if( $_POST['ag_hidden'] == 'Y') {2 if(isset($_POST['ag_hidden']) && $_POST['ag_hidden'] == 'Y') { 3 3 //Form data sent 4 4 5 $dbfail = $_POST['ag_fail']; 5 $dbfail = $_POST['ag_fail']; 6 6 7 $dbfail = stripslashes($dbfail); 7 8 update_option('ag_fail', $dbfail); 8 9 9 10 $dbtermm = $_POST['ag_termm']; 10 $dbtermm = stripslashes($dbtermm); 11 update_option('ag_termm', $dbtermm); 11 12 $dbtermm = stripslashes($dbtermm); 13 update_option('ag_termm', $dbtermm); 12 14 13 15 $dburl = $_POST['ag_url']; … … 19 21 $dbregister = $_POST['ag_register']; 20 22 update_option('ag_register', $dbregister); 21 22 23 ?> 23 24 … … 58 59 #feedback-form input[type="email"], #feedback-form textarea {width: 100%; display: block;} 59 60 #feedback-form textarea {min-height: 100px;} 61 .checkboxes {padding-bottom: 1em;} 60 62 </style> 63 64 <?php $pages = get_pages('status=publish&numberposts=-1&posts_per_page=-1'); ?> 65 61 66 <div class="wrap"> 62 67 … … 74 79 <p><label for="ag_fail"><?php _e("Failed to agree error message: " ); ?></label><input type="text" name="ag_fail" value="<?php echo $dbfail; ?>" size="20"></br><?php _e("<span class='mes'>This is what shows up if they don't check the box</span>" ); ?></p> 75 80 76 <p><label for="ag_url"><?php _e("URL for Terms: " ); ?></label><input type="text" name="ag_url" value="<?php echo $dburl; ?>" size="20"></br><?php _e("<span class='mes'>This is the URL where the user can read your terms</span>" ); ?></p> 81 <p> 82 <?php _e("<span class='mes'>This is the URL where the user can read your terms</span>" ); ?> 83 <label for="ag_url">Select your terms page</label> 84 <select name="ag_url"> 85 <?php foreach ($pages as $p) { ?> 86 <option value="<?php echo $p->ID; ?>" <?php echo $dburl == $p->ID ? 'selected="selected"' : ''; ?>><?php echo $p->post_title; ?></option> 87 <?php } ?> 88 </select> 89 </p> 77 90 78 91 <p><label for="ag_termm"><?php _e("Message: " ); ?></label><input type="text" name="ag_termm" size="40" value="<?php echo $dbtermm; ?>"><br><?php _e("<span class='mes'>This is the text that goes right after the checkbox</span>" ); ?></p> … … 82 95 <p> 83 96 <h3><?php _e("Where should it be displayed? " ); ?></h3> 84 <input type="checkbox" id="ag_login" name="ag_login" value="1" <?php if($dblogin == 1) {echo 'checked';} ?> /> <label for="ag_login"> Login form</label><br>97 <input type="checkbox" id="ag_login" name="ag_login" value="1" <?php if($dblogin == 1) {echo 'checked';} ?> /> <label for="ag_login"> Login form</label><br> 85 98 <input type="checkbox" id="ag_register" name="ag_register" value="1" <?php if($dbregister == 1) {echo 'checked';} ?> /> <label for="ag_register">Registration form</label> 86 99 </p> 87 </div> 100 </div> 88 101 89 102 <p class="submit"> -
agreeable/trunk/agreeable.php
r856577 r857357 4 4 Plugin URI: http://wordpress.org/extend/plugins/agreeable 5 5 Description: Add a required "Agree to terms" checkbox to login and/or register forms. Based on the I-Agree plugin by Michael Stursberg. 6 Version: 0. 1.2.17 Author: buildcreate , thesturs6 Version: 0.2 7 Author: buildcreate 8 8 Author URI: http://buildcreate.com 9 9 */ 10 10 11 function wp_authenticate_user_acc($user , $password) {11 function wp_authenticate_user_acc($user) { 12 12 13 13 $dblogin = get_option('ag_login'); 14 14 $dbregister = get_option('ag_register'); 15 $dbfail = get_option('ag_fail'); 16 $body_class = get_body_class(); 17 $login_page = get_option('ag_login_page'); 18 $register_page = get_option('ag_register_page'); 15 19 16 if($GLOBALS['pagenow'] == 'wp-login.php' && $dblogin == 1 || in_array('login', $body_class) && $dblogin == 1 || $GLOBALS['pagenow'] == 'wp-register.php' && $dbregister == 1 || in_array('register', $body_class) && $dbregister == 1 ) { 17 18 $dbfail = get_option('ag_fail'); 20 global $bp, $post; 21 isset($post) ? $pid = $post->ID : $pid = NULL; 19 22 20 23 // See if the checkbox #login_accept was checked … … 24 27 } else { 25 28 // Did NOT check the box, do not allow login 29 26 30 $error = new WP_Error(); 27 31 $error->add('did_not_accept', $dbfail); 32 33 if(isset($bp->signup)) { 34 $bp->signup->errors['login_accept'] = '<div class="error">'.$dbfail.'</div>'; 35 } 36 28 37 return $error; 29 38 } 30 } else { 31 return $user; 32 } 39 40 } 41 42 // Add it to the appropriate hooks 43 add_filter('wp_authenticate_user', 'wp_authenticate_user_acc', 99999, 2); 44 add_filter('registration_errors', 'wp_authenticate_user_acc', 99999, 2); 45 add_filter('bp_signup_validate', 'wp_authenticate_user_acc', 99999, 2); 46 47 function display_terms_form() { 48 $dbtermm = get_option('ag_termm'); 49 $dburl = get_option('ag_url'); 50 51 global $post; 52 isset($post) ? $pid = $post->ID : $pid = NULL; 53 $body_class = get_body_class(); 54 55 global $bp; 56 57 if(isset($dburl)) {$terms = get_post($dburl); $terms = apply_filters('the_content', $terms->post_content);} 58 59 // Add an element to the login form, which must be checked 60 61 agreeable_thickbox(); 62 63 echo '<style>#terms{display: none} #TB_ajaxContent p {font-weight: 200; line-height: 1.5em;}</style>'; 64 echo '<div style="clear: both; padding: .25em 0;" id="terms-accept" class="terms-form">'; 65 if(isset($bp)){do_action( 'bp_login_accept_errors' );} 66 echo '<label style="text-align: left;"><input type="checkbox" name="login_accept" id="login_accept" /> <a title="'.get_post($dburl)->post_title.'" class="thickbox" target="_BLANK" href="#TB_inline?width=600&height=550&inlineId=terms">'.$dbtermm.'</a></label></div>'; 67 68 echo '<div id="terms"><div>'.$terms.'</div></div>'; 69 } 70 71 function login_terms_accept(){ 72 $dblogin = get_option('ag_login'); 73 74 if($dblogin == 1) { 75 display_terms_form(); 76 } 77 } 78 79 function register_terms_accept() { 80 81 $dbregister = get_option('ag_register'); 82 83 if($dbregister == 1) { 84 display_terms_form(); 85 } 33 86 } 34 87 35 88 // As part of WP login form construction, call our function 36 add_filter ( 'login_form', ' terms_accept' );37 add_filter ( 'register_form', ' terms_accept' );38 add_action('bp_before_registration_submit_buttons', ' terms_accept');89 add_filter ( 'login_form', 'login_terms_accept' ); 90 add_filter ( 'register_form', 'register_terms_accept' ); 91 add_action('bp_before_registration_submit_buttons', 'register_terms_accept'); 39 92 40 function terms_accept(){ 41 $dbtermm = get_option('ag_termm'); 42 $dburl = get_option('ag_url'); 93 94 function ag_widget_terms_accept() { 95 43 96 $dblogin = get_option('ag_login'); 44 $dbregister = get_option('ag_register');45 global $post;46 $body_class = get_body_class();47 97 48 if($GLOBALS['pagenow'] == 'wp-login.php' && $dblogin == 1 || in_array('login', $body_class) && $dblogin == 1 || $GLOBALS['pagenow'] == 'wp-register.php' && $dbregister == 1 || in_array('register', $body_class) && $dbregister == 1 ) { 98 if($dblogin == 1) { 99 display_terms_form(); 100 } 101 102 echo '<script>'; 103 echo ' 104 jQuery(document).ready(function($){ 105 $("#terms-accept").insertBefore("#bp-login-widget-rememberme"); 106 $("#bp-login-widget-form").nextAll(".terms-form").hide(); 107 }); 108 '; 109 echo '</script>'; 110 111 } 49 112 50 51 // Add an element to the login form, which must be checked 52 echo '<div id="terms-accept"><label><input type="checkbox" name="login_accept" id="login_accept" /> <a target="_BLANK" href="'.$dburl.'">'.$dbtermm.'</a></label></div><br>'; 53 } 113 add_action('bp_after_login_widget_loggedout', 'ag_widget_terms_accept'); 114 115 function agreeable_thickbox() { 116 if (! is_admin()) { 117 wp_enqueue_script('thickbox', null, array('jquery')); 118 wp_enqueue_style('thickbox.css', '/'.WPINC.'/js/thickbox/thickbox.css', null, '1.0'); 119 } 54 120 } 55 121 … … 65 131 add_action('admin_menu', 'agreeable_options'); 66 132 67 // Add it to the appropriate hooks68 add_filter('wp_authenticate_user', 'wp_authenticate_user_acc', 99999, 2);69 add_filter('registration_errors', 'wp_authenticate_user_acc', 99999, 2);70 add_filter('bp_signup_validate', 'wp_authenticate_user_acc', 9999, 2);71 72 133 73 134 /* Plugin feedback form */ … … 75 136 function feedback_form() { 76 137 77 if(! $_POST['feedback_email'] && !$_POST['feedback_content']) {138 if(!isset($_POST['feedback_email']) && !isset($_POST['feedback_content'])) { 78 139 79 140 $output = '<h3>We want your feedback.</h3> -
agreeable/trunk/readme.txt
r856579 r857357 1 1 === Agreeable === 2 Contributors: buildcreate 3 Tags: agree, terms, conditions, require, terms, login, log in, admin, login page, admin, buddy press, page, policy, privacy 2 Contributors: buildcreate, thesturs 3 Tags: agree, terms, conditions, require, terms, login, log in, admin, login page, admin, buddy press, page, policy, privacy, bbpress, theme my login, signup, register, widgets 4 4 Requires at least: 3.5 5 5 Tested up to: 3.8.1 6 6 Stable tag: trunk 7 7 License:GPLv2 or later 8 Add an "Agree to terms" check box on login and/or registration pages. Works with BuddyPress .8 Add an "Agree to terms" check box on login and/or registration pages. Works with BuddyPress and bbPress 9 9 10 10 == Description == … … 12 12 13 13 Use the form in the plugin settings page to contact us with feature requests, comments, or concerns. 14 15 = New Features = 16 * Now you select your terms page from a dropdown 17 * Terms now open in a lightbox 18 * Tested with WP, BuddyPress, and bbPress login widgets 19 * Updated error display for BuddyPress 20 * Works with custom Login/Registration pages (like Theme My Login) 14 21 15 22 = Rated 4 stars by the WP Plugins A to Z podcast! = … … 25 32 26 33 == Changelog == 34 35 = 0.2 = 36 * Resolved a few warnings and notices that were cropping up 37 * Now you select your terms page from a dropdown 38 * Terms now open in a lightbox 39 * Tested with WP, BuddyPress, and bbPress login widgets 40 * Updated error display for BuddyPress 41 * Works with custom Login/Registration pages (like Theme My Login) 27 42 28 43 = 0.1.2.1 =
Note: See TracChangeset
for help on using the changeset viewer.