';
}
return $error;
}
} else {
return $user;
}
}
function ag_validate_comment($comment) {
$dbcomments = get_option('ag_comments');
$dbfail = get_option('ag_fail');
global $bp;
if($dbcomments == 1) {
// See if the checkbox #login_accept was checked
if ( isset( $_REQUEST['login_accept'] ) && $_REQUEST['login_accept'] == 'on' ) {
// Checkbox on, allow login
return $comment;
} else {
// Did NOT check the box, do not allow login
$error = new WP_Error();
$error->add('did_not_accept', $dbfail);
wp_die( __($dbfail) );
return $error;
}
} else {
return $comment;
}
}
// Add it to the appropriate hooks
add_filter('wp_authenticate_user', 'wp_authenticate_user_acc', 99999, 2);
add_filter('registration_errors', 'wp_authenticate_user_acc', 99999, 2);
add_filter('bp_signup_validate', 'wp_authenticate_user_acc', 99999, 2);
add_action('pre_comment_on_post', 'ag_validate_comment', 99999, 2);
function display_terms_form($type) {
$dbtermm = get_option('ag_termm');
$dburl = get_option('ag_url');
$dblightbox = get_option('ag_lightbox');
$dbcolors = get_option('ag_colors');
if(isset($dburl)) {$terms = get_post($dburl); $terms_content = '
'.$terms->post_title.'
'.apply_filters('the_content', $terms->post_content);}
// Add an element to the login form, which must be checked
$term_link = get_post_permalink($terms);
if($dblightbox == 1) {
agreeable_lightbox();
$term_link = '#terms';
if($dbcolors) {
echo '';
}
}
echo '