How to remove message output for the WP-PostRatings Plugin?

Just comment out (or change) the following line: // printf(__(‘You Had Already Rated This Post. Post ID #%s.’, ‘wp-postratings’), $post_id); If you just want to not have the $post_id, change the line to the following: _e(‘You Had Already Rated This Post. Post ID #%s.’, ‘wp-postratings’); Btw: If you change a plugin and then make an … Read more

Undefined index: ratings_score …/wp-postratings.php on line 994

when ever you expect something to be an array, it’s good practice to check to see if it is first before proceeding. so the new code might read like this: if(is_null($post_ratings_data)) { $post_ratings_data = get_post_custom($post_id); if ( is_array( $post_ratings_data[‘ratings_users’] ) ) { $post_ratings_users = intval($post_ratings_data[‘ratings_users’][0]); $post_ratings_score = intval($post_ratings_data[‘ratings_score’][0]); $post_ratings_average = floatval($post_ratings_data[‘ratings_average’][0]); } }

WP-PostRatings: list current user’s rated posts

Plugin questions are best asked on the plugin’s support forum. But this code is wrong: $result = $wpdb->get_results($sql) or die(mysql_error()); foreach( $results as $result ) { echo $result->name; } The foreach is backwards. Go for this (corrected $result to $results in the first line – added ‘s’): $results = $wpdb->get_results($sql) or die(mysql_error()); foreach( $results as … Read more

How to create a page which lists all categories with its ratings [closed]

Copy the entire function to the page that you want to have your average ratings: <?php // Lets get the id of every existing category $output_categories = array(); $categories = get_categories($args); //We loop through every category to calculate the average rating score of it’s posts foreach($categories as $category) { $post_ids = get_posts(array( ‘numberposts’ => -1, … Read more