diff -r 0d9a58d2c515 -r 0d28b7c10758 web/wp-content/themes/selecta/functions/ocmx_comment_post.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/wp-content/themes/selecta/functions/ocmx_comment_post.php Fri Mar 12 13:29:04 2010 +0000 @@ -0,0 +1,187 @@ +get_row( $wpdb->prepare("SELECT post_status, comment_status FROM $wpdb->posts WHERE ID = %d", $comment_post_ID) ); +if ( empty($status->comment_status) ) : +?> +
+
+
+
+

Comment I.D. not found.

+
+
+
+ + +
+
+
+
+

Sorry, comments are closed for this item.

+
+
+
+ +post_status, array('draft', 'pending') ) ) : +?> +
+
+
+
+

Comment on Draft

+
+
+
+ +prefix . "ocmx_comment_meta"; + +$check_blocked = $wpdb->get_row( $wpdb->prepare("SELECT $wpdb->comments.*, $comment_meta_table.* FROM $wpdb->comments INNER JOIN $comment_meta_table ON $wpdb->comments.comment_ID = $comment_meta_table.commentId WHERE $wpdb->comments.comment_author_email = %s AND $comment_meta_table.block_user = 1", $comment_author_email) ); + +if(count($check_blocked) !== 0) : +?> +
+
+
+
+

Your email address has been blocked from commenting on this blog.

+
+
+
+ +ID ) { + if ( empty( $user->display_name ) ) + $user->display_name=$user->user_login; + $comment_author = $wpdb->escape($user->display_name); + $comment_author_email = $wpdb->escape($user->user_email); + $comment_author_url = $wpdb->escape($user->user_url); + if ( current_user_can('unfiltered_html') ) { + if ( wp_create_nonce('unfiltered-html-comment_' . $comment_post_ID) != $_POST['_wp_unfiltered_html_comment'] ) { + kses_remove_filters(); // start with a clean slate + kses_init_filters(); // set up the filters + } + } +} else { + if ( get_option('comment_registration') ) + wp_die( __('Sorry, you must be logged in to post a comment.') ); +} + +$comment_type = ''; + +if ( get_option('require_name_email') && !$user->ID ) { + if ( 6 > strlen($comment_author_email) || '' == $comment_author ) + wp_die( __('Error: please fill the required fields (name, email).') ); + elseif ( !is_email($comment_author_email)) + wp_die( __('Error: please enter a valid email address.') ); +} + +if ( '' == $comment_content ) + wp_die( __('Error: please type a comment.') ); + +$comment_parent = isset($_POST['comment_parent']) ? absint($_POST['comment_parent']) : 0; + +$commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'comment_parent', 'user_ID'); + +$comment_id = wp_new_comment( $commentdata ); +/* $ocmx_add_comment_meta($comment_id, $comment_post_ID) */ + +$comment = get_comment($comment_id); +if ( !$user->ID ) { + setcookie('comment_author_' . COOKIEHASH, $comment->comment_author, time() + 30000000, COOKIEPATH, COOKIE_DOMAIN); + setcookie('comment_author_email_' . COOKIEHASH, $comment->comment_author_email, time() + 30000000, COOKIEPATH, COOKIE_DOMAIN); + setcookie('comment_author_url_' . COOKIEHASH, clean_url($comment->comment_author_url), time() + 30000000, COOKIEPATH, COOKIE_DOMAIN); +} +// Adjust the classes according to whether or not we're replying to another comment +global $header_class, $main_class, $footer_class; +$comment_table = $wpdb->prefix . "ocmx_comment_meta"; +$comment_meta_sql = "SELECT * FROM $comment_table WHERE commentId = ".$comment->comment_ID." LIMIT 1"; +$comment_count = $wpdb->get_row( $wpdb->prepare("SELECT comment_count FROM $wpdb->posts WHERE ID = %d", $comment_post_ID) ); +$comment_meta = $wpdb->get_row($comment_meta_sql); + +?> + +
+
+ + +

comment_count; ?> Comments

+ +
+ + +
+
+ +
+
+
+
+

+ comment_author_url !== "http://" && $comment->comment_author_url !== "") : ?> + comment_author; ?> + + comment_author; ?> + + twitter !== "") : ?> + comment_date)); ?> comment_date)); ?> +

+ comment_approved == '0') : ?> +

Comment is awaiting moderation.

+ comment_content); + $use_comment = str_replace("\n", "
", $use_comment); + echo "

".$use_comment."

"; + endif; ?> +
+ +
+
+ +
+
+ +
+ + + +