I spent a great deal of time figuring these out, so I thought I'd share these.
Number of thumbs up / down:
1. Make a copy of wp-postratings.php in case something goes wrong.
2. Open wp-postratings.php with your editor of your choice.
3. Search $value = str_replace("%RATINGS_USERS%"
4. Insert the following below that line:
$value = str_replace("%RATINGS_UP%", ($post_ratings_users + $post_ratings_score) / 2, $value);
$value = str_replace("%RATINGS_DOWN%", ($post_ratings_users - $post_ratings_score) / 2, $value);5. Save your changes and upload the file.
Now you can use %RATINGS_UP% and %RATINGS_DOWN% at the templates to display the number of ups and downs.
Note that you must have two choices, with values set for +1 and -1 (or vice versa) for this to work, otherwise it might produce funny numbers.
Number of ups and downs between the voting icons:
1. Do the steps written above
2. Search for function get_ratings_images_vote
3. Insert the following above it (separated from both that and the code above):
function get_ratings_images_vote_thumbs($post_id, $ratings_custom, $ratings_max, $post_rating, $ratings_image, $image_alt, $insert_half, $ratings_texts) {
global $text_direction;
$ratings_images = '';
if('rtl' == $text_direction && file_exists(WP_PLUGIN_DIR.'/wp-postratings/images/'.$ratings_image.'/rating_start-rtl.'.RATINGS_IMG_EXT)) {
$ratings_images .= '<img src="'.plugins_url('/wp-postratings/images/'.$ratings_image.'/rating_start-rtl.'.RATINGS_IMG_EXT).'" alt="" class="post-ratings-image" />';
} elseif(file_exists(WP_PLUGIN_DIR.'/wp-postratings/images/'.$ratings_image.'/rating_start.'.RATINGS_IMG_EXT)) {
$ratings_images .= '<img src="'.plugins_url('/wp-postratings/images/'.$ratings_image.'/rating_start.'.RATINGS_IMG_EXT).'" alt="" class="post-ratings-image" />';
}
if($ratings_custom) {
for($i=1; $i <= $ratings_max; $i++) {
if ('rtl' == $text_direction && file_exists(WP_PLUGIN_DIR.'/wp-postratings/images/'.$ratings_image.'/rating_'.$i.'half-rtl.'.RATINGS_IMG_EXT)) {
$use_half_rtl = 1;
} else {
$use_half_rtl = 0;
}
$ratings_text = stripslashes($ratings_texts[$i-1]);
if($i <= $post_rating) {
$ratings_images .= '<img id="rating_'.$post_id.'_'.$i.'" src="'.plugins_url('/wp-postratings/images/'.$ratings_image.'/rating_'.$i.'_on.'.RATINGS_IMG_EXT).'" alt="'.$ratings_text.'" title="'.$ratings_text.'" onmouseover="current_rating('.$post_id.', '.$i.', \''.$ratings_text.'\');" onmouseout="ratings_off('.$post_rating.', '.$insert_half.', '.$use_half_rtl.');" onclick="rate_post();" onkeypress="rate_post();" style="cursor: pointer; border: 0px;" />';
} elseif($i == $insert_half) {
if ($use_half_rtl) {
$ratings_images .= '<img id="rating_'.$post_id.'_'.$i.'" src="'.plugins_url('/wp-postratings/images/'.$ratings_image.'/rating_'.$i.'_half-rtl.'.RATINGS_IMG_EXT).'" alt="'.$ratings_text.'" title="'.$ratings_text.'" onmouseover="current_rating('.$post_id.', '.$i.', \''.$ratings_text.'\');" onmouseout="ratings_off('.$post_rating.', '.$insert_half.', '.$use_half_rtl.');" onclick="rate_post();" onkeypress="rate_post();" style="cursor: pointer; border: 0px;" />';
} else {
$ratings_images .= '<img id="rating_'.$post_id.'_'.$i.'" src="'.plugins_url('/wp-postratings/images/'.$ratings_image.'/rating_'.$i.'_half.'.RATINGS_IMG_EXT).'" alt="'.$ratings_text.'" title="'.$ratings_text.'" onmouseover="current_rating('.$post_id.', '.$i.', \''.$ratings_text.'\');" onmouseout="ratings_off('.$post_rating.', '.$insert_half.', '.$use_half_rtl.');" onclick="rate_post();" onkeypress="rate_post();" style="cursor: pointer; border: 0px;" />';
}
} else {
$ratings_images .= '<img id="rating_'.$post_id.'_'.$i.'" src="'.plugins_url('/wp-postratings/images/'.$ratings_image.'/rating_'.$i.'_off.'.RATINGS_IMG_EXT).'" alt="'.$ratings_text.'" title="'.$ratings_text.'" onmouseover="current_rating('.$post_id.', '.$i.', \''.$ratings_text.'\');" onmouseout="ratings_off('.$post_rating.', '.$insert_half.', '.$use_half_rtl.');" onclick="rate_post();" onkeypress="rate_post();" style="cursor: pointer; border: 0px;" />';
}
if ($i == 1) {
$ratings_images .= '%RATINGS_DOWN%';
} else {
$ratings_images .= '%RATINGS_UP%';
}
}
} else {
if ('rtl' == $text_direction && file_exists(WP_PLUGIN_DIR.'/wp-postratings/images/'.$ratings_image.'/rating_half-rtl.'.RATINGS_IMG_EXT)) {
$use_half_rtl = 1;
} else {
$use_half_rtl = 0;
}
for($i=1; $i <= $ratings_max; $i++) {
$ratings_text = stripslashes($ratings_texts[$i-1]);
if($i <= $post_rating) {
$ratings_images .= '<img id="rating_'.$post_id.'_'.$i.'" src="'.plugins_url('/wp-postratings/images/'.$ratings_image.'/rating_on.'.RATINGS_IMG_EXT).'" alt="'.$ratings_text.'" title="'.$ratings_text.'" onmouseover="current_rating('.$post_id.', '.$i.', \''.$ratings_text.'\');" onmouseout="ratings_off('.$post_rating.', '.$insert_half.', '.$use_half_rtl.');" onclick="rate_post();" onkeypress="rate_post();" style="cursor: pointer; border: 0px;" />';
} elseif($i == $insert_half) {
if ($use_half_rtl) {
$ratings_images .= '<img id="rating_'.$post_id.'_'.$i.'" src="'.plugins_url('/wp-postratings/images/'.$ratings_image.'/rating_half-rtl.'.RATINGS_IMG_EXT).'" alt="'.$ratings_text.'" title="'.$ratings_text.'" onmouseover="current_rating('.$post_id.', '.$i.', \''.$ratings_text.'\');" onmouseout="ratings_off('.$post_rating.', '.$insert_half.', '.$use_half_rtl.');" onclick="rate_post();" onkeypress="rate_post();" style="cursor: pointer; border: 0px;" />';
} else {
$ratings_images .= '<img id="rating_'.$post_id.'_'.$i.'" src="'.plugins_url('/wp-postratings/images/'.$ratings_image.'/rating_half.'.RATINGS_IMG_EXT).'" alt="'.$ratings_text.'" title="'.$ratings_text.'" onmouseover="current_rating('.$post_id.', '.$i.', \''.$ratings_text.'\');" onmouseout="ratings_off('.$post_rating.', '.$insert_half.', '.$use_half_rtl.');" onclick="rate_post();" onkeypress="rate_post();" style="cursor: pointer; border: 0px;" />';
}
} else {
$ratings_images .= '<img id="rating_'.$post_id.'_'.$i.'" src="'.plugins_url('/wp-postratings/images/'.$ratings_image.'/rating_off.'.RATINGS_IMG_EXT).'" alt="'.$ratings_text.'" title="'.$ratings_text.'" onmouseover="current_rating('.$post_id.', '.$i.', \''.$ratings_text.'\');" onmouseout="ratings_off('.$post_rating.', '.$insert_half.', '.$use_half_rtl.');" onclick="rate_post();" onkeypress="rate_post();" style="cursor: pointer; border: 0px;" />';
}
}
}
if('rtl' == $text_direction && file_exists(WP_PLUGIN_DIR.'/wp-postratings/images/'.$ratings_image.'/rating_end-rtl.'.RATINGS_IMG_EXT)) {
$ratings_images .= '<img src="'.plugins_url('/wp-postratings/images/'.$ratings_image.'/rating_end-rtl.'.RATINGS_IMG_EXT).'" alt="" class="post-ratings-image" />';
} elseif(file_exists(WP_PLUGIN_DIR.'/wp-postratings/images/'.$ratings_image.'/rating_end.'.RATINGS_IMG_EXT)) {
$ratings_images .= '<img src="'.plugins_url('/wp-postratings/images/'.$ratings_image.'/rating_end.'.RATINGS_IMG_EXT).'" alt="" class="post-ratings-image" />';
}
return $ratings_images;
}
(In other words, I copied the get_ratings_images_vote function, renamed it to get_ratings_images_vote_thumbs and added
if ($i == 1) {
$ratings_images .= '%RATINGS_DOWN%';
} else {
$ratings_images .= '%RATINGS_UP%';
}
before the end of the first 'for' loop where $ratings_custom is true.)
4. Search for $value = str_replace("%RATINGS_ALT_TEXT%"
5. Insert the following code above that line:
if (strpos($template, '%RATINGS_IMAGES_VOTE_THUMBS%') !== false) {
$ratings_texts = get_option('postratings_ratingstext');
$post_ratings_images = get_ratings_images_vote_thumbs($post_id, $ratings_custom, $ratings_max, $post_ratings, $ratings_image, $post_ratings_alt_text, $insert_half, $ratings_texts);
$value = str_replace("%RATINGS_IMAGES_VOTE_THUMBS%", $post_ratings_images, $value);
}
6. Save your changes and upload the file.
Now you can use %RATINGS_IMAGES_VOTE_THUMBS% to display Vote down icon → number of downs → vote up icon → number of ups. To display the number of ups first, search for if ($i == 1) { and replace %RATINGS_DOWN% with %RATINGS_UP% below and vice versa.
Note that you must have two choices (with values set for +1 and -1 (or vice versa)) for this to work, otherwise it might have funny outcomes.
Hope I could help, have a nice day!