• Resolved mrtslyn

    (@mrtslyn)


    Hi,

    We are very pleased to use this plugin. It meets all our needs in sharing ideas.
    I am curious of which db table holds the users’ ratings.

    I can see the result data in a ideas type post editor page in the admin panel, but I can not find it in the database.

    Regards

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Mathieu Viet

    (@imath)

    Hi,

    Ratings are not stored in a specific DB table. They are stored as Post Meta Data in a serialized array for each post. In your $GLOBALS['wpdb']->postmeta table you’ll find them under the meta_key _ideastream_rates.

    As a result when an idea is deleted, the corresponding ratings are also deleted.

    • This reply was modified 7 years, 8 months ago by Mathieu Viet.
    Thread Starter mrtslyn

    (@mrtslyn)

    Thanks. I found it now. But, the value is not clear for me.

    Is there any guide to understand the syntax of the meta_key?

    How do I know how many points given to the idea by which users? The reason to learn the syntax is that we have used another system to review and evaluate the ideas. Now, we are trying to move past ideas and ratings to the new environment.

    a:0:{}
    a:1:{i:5;a:1:{s:8:”user_ids”;a:1:{s:3:”u-4″;i:4;}}}

    Plugin Author Mathieu Viet

    (@imath)

    You can use this function :
    wp_idea_stream_add_rate( $idea = 0, $user_id = 0, $rate = 0 )

    where $idea is the ID of the idea, and $rate the number of stars.

    You can also do var_dump( get_post_meta( $idea_ID, '_ideastream_rates', true ) ); to see the structure of the array.

    It’s a multidimensional array having number of stars as keys and the array of user ids as values for each key (star).

    Thread Starter mrtslyn

    (@mrtslyn)

    Thanks a lot. I can modify the current ratings.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Rating Table’ is closed to new replies.