user_id;
}
}
function is_user_comment() {
global $comment;
return $comment->user_id;
}
function noprereq_users_only($comment_id){
global $wpdb, $approved, $user_ID;
get_currentuserinfo();
if (!$user_ID) {
$wpdb->query("UPDATE $wpdb->comments SET comment_approved = '0' WHERE comment_ID='$comment_id'");
$approved=0;
} else {
$wpdb->query("UPDATE $wpdb->comments SET comment_approved = '1' WHERE comment_ID='$comment_id'");
$wpdb->query("UPDATE $wpdb->comments SET user_id = $user_ID WHERE comment_ID='$comment_id'");
$approved=1;
}
}
function noprereq_users_only_form($buffer){
global $user_nickname, $user_email, $user_url;
get_currentuserinfo();
if ($user_nickname){
$comment_author = isset($_COOKIE['comment_author_'.COOKIEHASH]) ? trim(stripslashes($_COOKIE['comment_author_'.COOKIEHASH])) : '';
$comment_author_email = isset($_COOKIE['comment_author_email_'.COOKIEHASH]) ? trim(stripslashes($_COOKIE['comment_author_email_'.COOKIEHASH])) : '';
$comment_author_url = isset($_COOKIE['comment_author_url_'.COOKIEHASH]) ? trim(stripslashes($_COOKIE['comment_author_url_'.COOKIEHASH])) : '';
$old_author_field = '';
$new_author_field = '';
$old_email_field = '';
$new_email_field = '';
$old_url_field = '';
$new_url_field = '';
$buffer = str_replace($old_author_field,$new_author_field,$buffer);
$buffer = str_replace($old_email_field,$new_email_field,$buffer);
$buffer = str_replace($old_url_field,$new_url_field,$buffer);
}
return $buffer;
}
function noprereq_users_only_cache(){
if ( is_single() || is_page() || $withcomments ){
ob_start("noprereq_users_only_form");
}
}
function noprereq_users_only_output(){
if ( is_single() || is_page() || $withcomments ){
ob_end_flush();
//echo "working.";
}
}
?>