Changeset 11277
- Timestamp:
- 04/18/2007 02:55:30 AM (20 years ago)
- Location:
- openid/trunk
- Files:
-
- 2 edited
-
openid-registration.php (modified) (2 diffs)
-
user-interface.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
openid/trunk/openid-registration.php
r11274 r11277 6 6 Author: Will Norris 7 7 Author URI: http://willnorris.com/ 8 Version: $Rev: 15$8 Version: $Rev: 27 $ 9 9 Licence: Modified BSD, http://www.fsf.org/licensing/licenses/index_html#ModifiedBSD 10 10 */ 11 11 12 12 define ( 'OPENIDIMAGE', get_option('siteurl') . '/wp-content/plugins/wpopenid/images/openid.gif' ); 13 define ( 'WPOPENID_PLUGIN_VERSION', (int)str_replace( '$Rev ', '', '$Rev: 15$') );13 define ( 'WPOPENID_PLUGIN_VERSION', (int)str_replace( '$Rev ', '', '$Rev: 27 $') ); 14 14 15 15 /* Turn on logging of process via error_log() facility in PHP. … … 849 849 } 850 850 851 852 /** 853 * Wordpress only displays comments that are awaiting moderation if the 854 * name and email address stored in the user's cookies match those on 855 * the comment. This is a problem since if the user logged in with 856 * OpenID, they may never have filled out the name and email input 857 * fields but there comment _will_ have values resulting in them never 858 * seeing their comment. 859 * 860 * This filter performs an additional query if the current user is 861 * logged in, and grabs any comments awaiting moderation that they 862 * posted. 863 * 864 * @bug-filed http://trac.wordpress.org/ticket/4108/ 865 */ 866 function comments_awaiting_moderation(&$comments, $post_id) { 867 global $wpdb, $user_ID; 868 869 if ($user_ID) { 870 871 $commenter = wp_get_current_commenter(); 872 extract($commenter); 873 874 $additional = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$post_id' AND " . 875 "user_id = '$user_ID' AND comment_author != '$author_db' AND comment_author_email != '$email_db' AND ". 876 "comment_approved = '0' ORDER BY comment_date"); 877 878 if ($additional) { 879 $comments = array_merge($comments, $additional); 880 usort($comments, create_function('$a,$b', 'return strcmp($a->comment_date_gmt, $b->comment_date_gmt);')); 881 } 882 } 883 884 return $comments; 885 } 886 851 887 } // end class definition 852 888 } // end if-class-exists test -
openid/trunk/user-interface.php
r11275 r11277 55 55 add_filter( 'comment_notification_subject', array( $wordpressOpenIDRegistrationUI->oid, 'openid_comment_notification_subject'), 10, 2 ); 56 56 add_filter( 'comment_notification_text', array( $wordpressOpenIDRegistrationUI->oid, 'openid_comment_notification_text'), 10, 2 ); 57 add_filter( 'comments_array', array( $wordpressOpenIDRegistrationUI->oid, 'comments_awaiting_moderation'), 10, 2); 57 58 58 59 add_action( 'delete_user', array( $wordpressOpenIDRegistrationUI->oid, 'drop_all_identities_for_user' ) ); // If user is dropped from database, remove their identities too.
Note:
See TracChangeset
for help on using the changeset viewer.