diff -r 0d9a58d2c515 -r 0d28b7c10758 web/wp-content/themes/selecta/ocmx/ocmx-comment-options.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/wp-content/themes/selecta/ocmx/ocmx-comment-options.php Fri Mar 12 13:29:04 2010 +0000 @@ -0,0 +1,228 @@ +prefix . "ocmx_comment_meta"; + $count_subscribers = $wpdb->get_results("SELECT * FROM $comment_table"); + $fetch_subscribers = $wpdb->get_results( + "SELECT $wpdb->comments.*, $comment_table.* + FROM $wpdb->comments INNER JOIN $comment_table + ON $wpdb->comments.comment_ID = $comment_table.commentId + ORDER BY $wpdb->comments.comment_post_ID ASC, $wpdb->comments.comment_author ASC, $wpdb->comments.comment_author_email ASC, $comment_table.twitter ASC, $comment_table.email_subscribe DESC + LIMIT $startrow, $endrow"); + + if(isset($_POST["comment_changes"])) : + $users_deleted = 0; + $users_blocked = 0; + $users_subs = 0; + wp_cache_flush(); + foreach($fetch_subscribers as $subscriber_details) : + $delete_key = "delete_comment-".$subscriber_details->commentId; + $block_key = "block_comment-".$subscriber_details->commentId; + $subs_key = "mail_comment-".$subscriber_details->commentId; + if(isset($_POST[$delete_key])) : + $main_sql = "DELETE FROM $wpdb->comments WHERE comment_ID = ".$subscriber_details->commentId; + $meta_sql = "DELETE FROM $comment_table WHERE commentId = '".$subscriber_details->commentId."'"; + $check_post = get_post($subscriber_details->comment_post_ID); + if($wpdb->query($main_sql) == "1" && $wpdb->query($meta_sql) == "1") : + if($check_post->comment_count !== 0): + $update_posts = "UPDATE $wpdb->posts SET comment_count = ".($check_post->comment_count - 1)." WHERE `ID` = ".$subscriber_details->comment_post_ID; + $wpdb->query($update_posts); + endif; + $users_deleted += 1; + endif; + else : + if(isset($_POST[$block_key])): $block_user = 1; else: $block_user = 0; endif; + if(isset($_POST[$subs_key])): $subs_user = 1; else: $subs_user = 0; endif; + $update_sql = "UPDATE $comment_table + SET block_user = ".$block_user.", + email_subscribe = ".$subs_user." + WHERE commentId = ".$subscriber_details->commentId; + $wpdb->query($update_sql); + + if(isset($_POST[$block_key])) : + $users_blocked += 1; + endif; + if(isset($_POST[$subs_key])) : + $users_subs += 1; + endif; + endif; + endforeach; + $fetch_subscribers = $wpdb->get_results( + "SELECT $wpdb->comments.*, $comment_table.* + FROM $wpdb->comments INNER JOIN $comment_table + ON $wpdb->comments.comment_ID = $comment_table.commentId + ORDER BY $wpdb->comments.comment_post_ID ASC, $wpdb->comments.comment_author ASC, $wpdb->comments.comment_author_email ASC, $comment_table.twitter ASC, $comment_table.email_subscribe DESC + LIMIT $startrow, $endrow"); + endif; + + ocmx_header(); + ?> + +
Your changes were not successful.
"; + endif; + endif; ?> + + + + + \ No newline at end of file