Support » Plugin: Latest edits » [Plugin: Latest edits] appears to be broken

  • Resolved madivad


    I was looking forward to this one, but when i go to inspect the widget I have this error:

    SELECT DISTINCT p.ID, p.post_title, p.post_author, u.display_name, p.post_modified, p.post_type FROM wp_1_posts p INNER JOIN wp_1_users u ON u.ID = p.post_author WHERE (p.post_type = ‘post’ OR p.post_type = ‘page’) ORDER BY p.post_modified DESC LIMIT 0, 10

    Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/abc/public_html/xyz/wp-content/plugins/latest-edits/latest-edits.php on line 38

    BTW, I echo’d out the SQL just to see if something jumped out at me… it didn’t!

Viewing 1 replies (of 1 total)
  • and then there it is. Today I have done a lot of work on the database and learned much about it’s structure. The mistake lies in the user table declaration/definition as it occurs for MU. The code below will work for WordPress (single install) and WordPressMU.

    Where the plugin declares the tables after this comment:

    // Define DB table names
    	$table_name = $wpdb->prefix . "posts";
    	$user_table_name = $wpdb->prefix . "users";

    Change to

    // Define DB table names for both MU and single DB
    	$table_name = $wpdb->posts;
    	$user_table_name = $wpdb->users;

    All is then good. Tried, tested, and it works

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Latest edits] appears to be broken’ is closed to new replies.