WordPress.org

Ready to get started?Download WordPress

Forums

WP-PostRatings Cheater
Fix for error when database prefix is not wp_ (3 posts)

  1. mlloret
    Member
    Posted 5 months ago #

    Hi there,

    We just installed your plugin on one site to test it. This site has another database prefix (not wp_) and your plugin shows no results.

    In order to make it work, we have made following changes in wp-postratings-cheater-settings.php.

    We would be very happy you could include them in your next release:

    Original code in wp-postratings-cheater-settings.php - Lines 83-86:
    $sql = "select a.meta_id, a.post_id, a.meta_key, a.meta_value, b.post_title ".
    "from wp_postmeta as a join wp_posts as b on a.post_id = b.id ".
    "where a.meta_key = 'ratings_score' ".
    "order by a.post_id;";

    Changed code in wp-postratings-cheater-settings.php - Lines 83-86 + 1 additional code line:

    $dbprefix = $wpdb->base_prefix;
    $sql = "select a.meta_id, a.post_id, a.meta_key, a.meta_value, b.post_title ".
    "from " . $dbprefix . "postmeta as a join " . $dbprefix . "posts as b on a.post_id = b.id ".
    "where a.meta_key = 'ratings_score' ".
    "order by a.post_id;";

    Hope you find it interesting and include it in your plugin code.

    https://wordpress.org/plugins/wp-postratings-cheater/

  2. queeez
    Member
    Plugin Author

    Posted 4 months ago #

    Thanks, will implement your code!

  3. utnalove
    Member
    Posted 3 months ago #

    The same issue here :/
    Empty results on wp-admin/admin.php?page=wp-postratings-cheater/wp-postratings-cheater-settings.php

Reply

You must log in to post.

About this Plugin

About this Topic