root/afridex/plugins/get-recent-comments 2/patch-2.0.1-2.0.2 @ 22

Revision 21, 2.1 kB (checked in by admin, 18 years ago)
Line 
1--- ../tags/2.0.1/get-recent-comments.php       2007-09-25 21:57:50.000000000 +0200
2+++ get-recent-comments.php     2007-09-25 22:18:38.000000000 +0200
3@@ -1,7 +1,7 @@
4 <?php
5 /*
6 Plugin Name: Get Recent Comments
7-Version: 2.0.1
8+Version: 2.0.2
9 Plugin URI: http://blog.jodies.de/archiv/2004/11/13/recent-comments/
10 Author: Krischan Jodies
11 Author URI: http://blog.jodies.de
12@@ -127,8 +127,12 @@
13 function kjgrc_subpage_exclude_cat()
14 {
15        global $wpdb;
16-       // $categories = $wpdb->get_results("SELECT * FROM $wpdb->categories ORDER BY cat_name");
17-       $categories = get_categories('&hide_empty=0');
18+       if (function_exists("get_categories")) {
19+               $categories = get_categories('&hide_empty=0');
20+       } else {
21+               // be still compatible to 2.0.11
22+               $categories = $wpdb->get_results("SELECT * FROM $wpdb->categories ORDER BY cat_name");
23+       }
24        $exclude_cat = kjgrc_get_exclude_cat();
25 ?>
26 <form method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>?page=get-recent-comments.php&amp;subpage=4&amp;updated=true">
27@@ -997,12 +1001,28 @@
28        return array($comment_author,$trackback_title);
29 }
30 
31+// original function from wordpress 2.3 for backwards compatibility to wordpress 2.0.11
32+function kjgrc_get_users_of_blog( $id = '' ) {
33+        global $wpdb, $blog_id;
34+        if ( empty($id) )
35+                $id = (int) $blog_id;
36+        $users = $wpdb->get_results( "SELECT user_id, user_login, display_name, user_email, meta_value FROM $wpdb->users, $wpdb->usermeta WHERE " . $wpdb->users .
37+".ID = " . $wpdb->usermeta . ".user_id AND meta_key = '" . $wpdb->prefix . "capabilities' ORDER BY {$wpdb->usermeta}.user_id" );
38+        return $users;
39+}
40+
41+
42 /* This function is dedicated to Mike */
43 function kjgrc_is_wordpress_user($comment)
44 {
45        global $kjgrc_wordpress_users;
46        if ($kjgrc_wordpress_users == NULL) {
47-               $kjgrc_wordpress_users = get_users_of_blog();
48+               // be still compatible to wordpress 2.0.11
49+               if (function_exists("get_users_of_blog")) {
50+                       $kjgrc_wordpress_users = get_users_of_blog();
51+               } else {
52+                       $kjgrc_wordpress_users = kjgrc_get_users_of_blog();
53+               }
54        }
55        foreach ($kjgrc_wordpress_users as $user) {
56                if (strcasecmp($comment->comment_author_email,$user->user_email) == 0 ) {
Note: See TracBrowser for help on using the browser.