ratings = $wpdb->prefix . 'ratings'; /** * Load plugin files * Require the plugin files in an alphabetical order. */ require_once 'includes/postratings-activation.php'; require_once 'includes/postratings-admin.php'; require_once 'includes/postratings-i18n.php'; require_once 'includes/postratings-mutex.php'; require_once 'includes/postratings-scripts.php'; require_once 'includes/postratings-shortcodes.php'; require_once 'includes/postratings-stats.php'; require_once 'includes/postratings-widgets.php'; /** * Register plugin activation hook */ register_activation_hook( __FILE__, 'ratings_activation' ); ### Define Image Extension add_action( 'init', 'postratings_init' ); function postratings_init() { if ( ! defined( 'RATINGS_IMG_EXT' ) ) { define( 'RATINGS_IMG_EXT', apply_filters( 'wp_postratings_image_extension', 'gif' ) ); } } ### Function: Display The Rating For The Post function the_ratings($start_tag = 'div', $custom_id = 0, $display = true) { global $id; // Allow Custom ID if ( (int) $custom_id > 0 ) { $ratings_id = $custom_id; } else { // If Global $id is 0, Get The Loop Post ID if ( $id === 0 ) { $ratings_id = get_the_ID(); } elseif ( null === $id ) { global $post; $ratings_id = $post->ID; } else { $ratings_id = $id; } } $ratings_id = (int) $ratings_id; // Loading Style $postratings_ajax_style = get_option('postratings_ajax_style'); if ( (int) $postratings_ajax_style['loading'] === 1 ) { $loading_alt = apply_filters('wp_postratings_loading_alt', ''); $loading_alt_html = ! empty( $loading_alt ) ? ' alt="' . esc_attr( $loading_alt ) . '"' : ''; $loading = '<' . $start_tag . ' id="post-ratings-' . $ratings_id . '-loading" class="post-ratings-loading">' . esc_html__( 'Loading...', 'wp-postratings' ) . '' . $start_tag . '>'; } else { $loading = ''; } // Check To See Whether User Has Voted $user_voted = check_rated($ratings_id); // HTML Attributes $ratings_options = get_option('postratings_options'); $ratings_options['richsnippet'] = isset( $ratings_options['richsnippet'] ) ? $ratings_options['richsnippet'] : 1; $disable_richsnippet = apply_filters( 'wp_postratings_disable_richsnippet', false ); if( ! $disable_richsnippet && is_singular() && $ratings_options['richsnippet'] ) { $itemtype = apply_filters('wp_postratings_schema_itemtype', 'itemscope itemtype="https://schema.org/Article"'); $attributes = 'id="post-ratings-'.$ratings_id.'" class="post-ratings" '.$itemtype; } else { $attributes = 'id="post-ratings-'.$ratings_id.'" class="post-ratings"'; } // If User Voted Or Is Not Allowed To Rate if($user_voted) { if(!$display) { return "<$start_tag $attributes>".the_ratings_results($ratings_id).''.$start_tag.'>'.$loading; } else { echo "<$start_tag $attributes>".the_ratings_results($ratings_id).''.$start_tag.'>'.$loading; } // If User Is Not Allowed To Rate } else if(!check_allowtorate()) { if(!$display) { return "<$start_tag $attributes>".the_ratings_results($ratings_id, 0, 0, 0, 1).''.$start_tag.'>'.$loading; } else { echo "<$start_tag $attributes>".the_ratings_results($ratings_id, 0, 0, 0, 1).''.$start_tag.'>'.$loading; } // If User Has Not Voted } else { if(!$display) { return "<$start_tag $attributes data-nonce=\"".wp_create_nonce('postratings_'.$ratings_id.'-nonce')."\">".the_ratings_vote($ratings_id).''.$start_tag.'>'.$loading; } else { echo "<$start_tag $attributes data-nonce=\"".wp_create_nonce('postratings_'.$ratings_id.'-nonce')."\">".the_ratings_vote($ratings_id).''.$start_tag.'>'.$loading; } } } ### Function: Display Ratings Results function the_ratings_results( $post_id, $new_user = 0, $new_score = 0, $new_average = 0, $type = 0 ) { if( $new_user === 0 && $new_score === 0 && $new_average === 0 ) { $post_ratings_data = null; } else { $post_ratings_data = new stdClass(); $post_ratings_data->ratings_users = $new_user; $post_ratings_data->ratings_score = $new_score; $post_ratings_data->ratings_average = $new_average; } // Display The Contents if( $type === 1 ) { $template_postratings_text = stripslashes( get_option( 'postratings_template_permission' ) ); } else { $template_postratings_text = stripslashes( get_option( 'postratings_template_text' ) ); } // Return Post Ratings Template return expand_ratings_template( $template_postratings_text, $post_id, $post_ratings_data ); } ### Function: Display Ratings Vote function the_ratings_vote($post_id, $new_user = 0, $new_score = 0, $new_average = 0) { if($new_user === 0 && $new_score === 0 && $new_average === 0) { $post_ratings_data = null; } else { $post_ratings_data = new stdClass(); $post_ratings_data->ratings_users = $new_user; $post_ratings_data->ratings_score = $new_score; $post_ratings_data->ratings_average = $new_average; } // If No Ratings, Return No Ratings template if( (int) get_post_meta( $post_id, 'ratings_users', true ) === 0 ) { $template_postratings_none = stripslashes(get_option('postratings_template_none')); // Return Post Ratings Template return expand_ratings_template($template_postratings_none, $post_id, $post_ratings_data); } else { // Display The Contents $template_postratings_vote = stripslashes(get_option('postratings_template_vote')); // Return Post Ratings Voting Template return expand_ratings_template($template_postratings_vote, $post_id, $post_ratings_data); } } ### Function: Check Who Is Allow To Rate function check_allowtorate() { $allow_to_vote = (int) get_option( 'postratings_allowtorate' ); switch($allow_to_vote) { // Guests Only case 0: return ! is_user_logged_in(); break; // Logged-in users only case 1: return is_user_logged_in(); break; // Users registered on blog (for multisite) case 3: return is_user_member_of_blog(); break; // Registered Users And Guests case 2: default: return true; } } ### Function: Check Whether User Have Rated For The Post function check_rated( $post_id ) { $postratings_logging_method = (int) get_option( 'postratings_logging_method' ); $rated = false; switch( $postratings_logging_method ) { // Do Not Log case 0: $rated = false; break; // Logged By Cookie case 1: $rated = check_rated_cookie( $post_id ); break; // Logged By IP case 2: $rated = check_rated_ip( $post_id ); break; // Logged By Cookie And IP case 3: $rated_cookie = check_rated_cookie( $post_id ); if( $rated_cookie > 0 ) { $rated = true; } else { $rated = check_rated_ip( $post_id ); } break; // Logged By Username case 4: $rated = check_rated_username( $post_id ); break; } $rated = apply_filters( 'wp_postratings_check_rated', $rated, $post_id ); return $rated; } ### Function: Check Rated By Cookie function check_rated_cookie( $post_id ) { if ( isset( $_COOKIE["rated_$post_id"] ) ) { return true; } return false; } ### Function: Check Rated By IP function check_rated_ip($post_id) { global $wpdb; // Check IP From IP Logging Database $get_rated = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM {$wpdb->ratings} WHERE rating_postid = %d AND rating_ip = %s", $post_id, ratings_get_ipaddress() ) ); // 0: False | > 0: True return (int) $get_rated; } ### Function: Check Rated By Username function check_rated_username($post_id) { global $wpdb, $user_ID; if ( !is_user_logged_in() ) { return 0; } // Check User ID From IP Logging Database $get_rated = $wpdb->get_var( $wpdb->prepare( "SELECT rating_userid FROM {$wpdb->ratings} WHERE rating_postid = %d AND rating_userid = %d", $post_id, $user_ID ) ); // 0: False | > 0: True return (int) $get_rated; } ### Function: Get Comment Authors Ratings add_action ('loop_start', 'get_comment_authors_ratings' ); function get_comment_authors_ratings() { global $wpdb, $post, $comment_authors_ratings; $comment_authors_ratings_results = null; if ( ! is_feed() && ! is_admin() ) { $comment_authors_ratings = array(); if ( ! empty( $post ) && ! empty( $post->ID ) ) { $comment_authors_ratings_results = $wpdb->get_results( $wpdb->prepare( "SELECT rating_username, rating_rating, rating_ip FROM {$wpdb->ratings} WHERE rating_postid = %d", $post->ID ) ); } if ( ! empty( $comment_authors_ratings_results ) && is_array( $comment_authors_ratings_results ) ) { foreach ( $comment_authors_ratings_results as $comment_authors_ratings_result ) { $comment_author = stripslashes( $comment_authors_ratings_result->rating_username ); $comment_authors_ratings[ $comment_author ] = $comment_authors_ratings_result->rating_rating; $comment_authors_ratings[ $comment_authors_ratings_result->rating_ip ] = $comment_authors_ratings_result->rating_rating; } } } } ### Function: Comment Author Ratings function comment_author_ratings( $comment_author_specific = '', $display = true ) { global $comment_authors_ratings; if ( get_comment_type() === 'comment' ) { $post_ratings_images = ''; $ratings_image = get_option( 'postratings_image' ); $ratings_max = (int) get_option( 'postratings_max' ); $ratings_custom = (int) get_option( 'postratings_customrating' ); $postratings_logging_method = (int) get_option( 'postratings_logging_method' ); $comment_author = $comment_author_specific; if ( empty( $comment_author ) ) { $comment_author = get_comment_author(); } $comment_author_rating = (int) $comment_authors_ratings[ $comment_author ]; // If we logged by username, we don't want to use IP at all. if ( $postratings_logging_method !== 4 && $comment_author_rating === 0 ) { $comment_author_rating = (int) $comment_authors_ratings[ get_comment_author_IP() ]; } if ( $comment_author_rating !== 0 ) { // Display Rated Images if ( $ratings_custom && $ratings_max === 2 ) { if ( $comment_author_rating > 0 ) { $comment_author_rating = '+' . $comment_author_rating; } } $image_alt = sprintf( __( '%s gives a rating of %s', 'wp-postratings' ), $comment_author, $comment_author_rating ); $post_ratings_images = get_ratings_images_comment_author( $ratings_custom, $ratings_max, $comment_author_rating, $ratings_image, $image_alt ); } if($display) { return $post_ratings_images; } return $post_ratings_images; } } ### Function: Display Comment Author Ratings add_filter( 'comment_text', 'comment_author_ratings_filter' ); function comment_author_ratings_filter( $comment_text ) { global $comment, $comment_authors_ratings; $output = ''; $display_comment_author_ratings = apply_filters( 'wp_postratings_display_comment_author_ratings', false ); if ( $display_comment_author_ratings ) { if ( !is_feed() && !is_admin() ) { if ( ! empty( $comment ) && get_comment_type() === 'comment' ) { $post_ratings_images = ''; $ratings_image = get_option( 'postratings_image' ); $ratings_max = (int) get_option( 'postratings_max' ); $ratings_custom = (int) get_option( 'postratings_customrating' ); $postratings_logging_method = (int) get_option( 'postratings_logging_method' ); $comment_author = get_comment_author(); $comment_author_rating = (int) $comment_authors_ratings[ $comment_author ]; // If we logged by username, we don't want to use IP at all. if ( $postratings_logging_method !== 4 && $comment_author_rating === 0 ) { $comment_author_rating = (int) $comment_authors_ratings[ get_comment_author_IP() ]; } if ( $comment_author_rating !== 0 ) { // Display Rated Images if ( $ratings_custom && $ratings_max === 2 ) { if ( $comment_author_rating > 0 ) { $comment_author_rating = '+' . $comment_author_rating; } } $image_alt = sprintf( __( '%s gives a rating of %s', 'wp-postratings' ), $comment_author, $comment_author_rating ); $post_ratings_images = get_ratings_images_comment_author( $ratings_custom, $ratings_max, $comment_author_rating, $ratings_image, $image_alt ); } $output .= '
'; } } } return $comment_text.$output; } ### Function: Get IP Address function ratings_get_raw_ipaddress() { $ip = esc_attr( $_SERVER['REMOTE_ADDR'] ); $postratings_options = get_option( 'postratings_options' ); if ( ! empty( $postratings_options ) && ! empty( $postratings_options['ip_header'] ) && ! empty( $_SERVER[ $postratings_options['ip_header'] ] ) ) { $ip = esc_attr( $_SERVER[ $postratings_options['ip_header'] ] ); } return $ip; } function ratings_get_ipaddress() { return apply_filters( 'wp_postratings_ipaddress', wp_hash( ratings_get_raw_ipaddress() ) ); } function ratings_get_hostname() { $ip = ratings_get_raw_ipaddress(); $hostname = gethostbyaddr( $ip ); if ( $hostname === $ip ) { $hostname = wp_privacy_anonymize_ip( $ip ); } if ( false !== $hostname ) { $hostname = substr( $hostname, strpos( $hostname, '.' ) + 1 ); } return apply_filters( 'wp_postratings_hostname', $hostname ); } ### Function: Return All Images From A Rating Image Folder function ratings_images_folder($folder_name) { $normal_images = array('rating_over.'.RATINGS_IMG_EXT, 'rating_on.'.RATINGS_IMG_EXT, 'rating_half.'.RATINGS_IMG_EXT, 'rating_off.'.RATINGS_IMG_EXT); $postratings_path = WP_PLUGIN_DIR.'/wp-postratings/images/'.$folder_name; $count = 0; $rating['max'] = 0; $rating['custom'] = 0; $rating['images'] = array(); if(is_dir($postratings_path)) { if($handle = @opendir($postratings_path)) { while (false !== ($filename = readdir($handle))) { if ($filename !== '.' && $filename !== '..' && substr($filename, -8) !== '-rtl.'.RATINGS_IMG_EXT && strpos($filename, '.') !== 0) { if ( in_array( $filename, $normal_images, true ) ) { $count++; } elseif( (int) substr( $filename,7, -7 ) > $rating['max'] ) { $rating['max'] = (int) substr( $filename,7, -7 ); } $rating['images'][] = $filename; } } closedir($handle); } } if ( $count !== count($normal_images ) ) { $rating['custom'] = 1; } if ( $rating['max'] === 0 ) { $rating['max'] = (int) get_option( 'postratings_max' ); } return $rating; } ### Function: Add PostRatings To Content Automatically //add_action('the_content', 'add_ratings_to_content'); function add_ratings_to_content($content) { if (!is_feed()) { $content .= the_ratings('div', 0, false); } return $content; } ### Function: Snippet Text if(!function_exists('snippet_text')) { function snippet_text($text, $length = 0) { if (defined('MB_OVERLOAD_STRING')) { $text = @html_entity_decode($text, ENT_QUOTES, get_option('blog_charset')); if (mb_strlen($text) > $length) { return htmlentities(mb_substr($text,0,$length), ENT_COMPAT, get_option('blog_charset')).'...'; } else { return htmlentities($text, ENT_COMPAT, get_option('blog_charset')); } } else { $text = @html_entity_decode($text, ENT_QUOTES, get_option('blog_charset')); if (strlen($text) > $length) { return htmlentities(substr($text,0,$length), ENT_COMPAT, get_option('blog_charset')).'...'; } else { return htmlentities($text, ENT_COMPAT, get_option('blog_charset')); } } } } ### Function: Process Post Excerpt, For Some Reasons, The Default get_post_excerpt() Does Not Work As Expected function ratings_post_excerpt($post_id, $post_excerpt, $post_content) { if( post_password_required( $post_id ) ) { return esc_html__( 'There is no excerpt because this is a protected post.', 'wp-postratings' ); } if(empty($post_excerpt)) { return snippet_text( strip_tags( strip_shortcodes( $post_content ) ), 200 ); } else { return strip_shortcodes( $post_excerpt ); } } ### Function: Add Rating Custom Fields add_action('publish_post', 'add_ratings_fields'); add_action('publish_page', 'add_ratings_fields'); function add_ratings_fields($post_ID) { global $wpdb; if(!wp_is_post_revision($post_ID)) { add_post_meta($post_ID, 'ratings_users', 0, true); add_post_meta($post_ID, 'ratings_score', 0, true); add_post_meta($post_ID, 'ratings_average', 0, true); } } ### Function:Delete Rating Custom Fields add_action('delete_post', 'delete_ratings_fields'); function delete_ratings_fields($post_ID) { global $wpdb; if(!wp_is_post_revision($post_ID)) { delete_post_meta($post_ID, 'ratings_users'); delete_post_meta($post_ID, 'ratings_score'); delete_post_meta($post_ID, 'ratings_average'); } } ### Function: Process Ratings add_action('wp_ajax_postratings', 'process_ratings'); add_action('wp_ajax_nopriv_postratings', 'process_ratings'); function process_ratings() { global $wpdb, $user_identity, $user_ID; if(isset($_REQUEST['action']) && $_REQUEST['action'] == 'postratings') { $rate = isset( $_REQUEST['rate'] ) ? (int) $_REQUEST['rate'] : 0; $post_id = isset( $_REQUEST['pid'] ) ? (int) $_REQUEST['pid'] : 0; // Verify Referer if(!check_ajax_referer('postratings_'.$post_id.'-nonce', 'postratings_'.$post_id.'_nonce', false)) { esc_html_e('Failed To Verify Referrer', 'wp-postratings'); exit(); } if($rate > 0 && $post_id > 0 && check_allowtorate()) { // Check For Bot $bots_useragent = array('googlebot', 'google', 'msnbot', 'ia_archiver', 'lycos', 'jeeves', 'scooter', 'fast-webcrawler', 'slurp@inktomi', 'turnitinbot', 'technorati', 'yahoo', 'findexa', 'findlinks', 'gaisbo', 'zyborg', 'surveybot', 'bloglines', 'blogsearch', 'ubsub', 'syndic8', 'userland', 'gigabot', 'become.com'); $useragent = $_SERVER['HTTP_USER_AGENT']; foreach ($bots_useragent as $bot) { if (stristr($useragent, $bot) !== false) { return; } } header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) ); // Acquire lock $fp_lock = ratings_acquire_lock( $post_id ); if ( $fp_lock === false ) { esc_html_e( 'Unable to obtain lock', 'wp-postratings' ); exit(); } $rated = check_rated( $post_id ); // Check Whether Post Has Been Rated By User if(!$rated) { // Check Whether Is There A Valid Post $post = get_post($post_id); // If Valid Post Then We Rate It if($post && !wp_is_post_revision($post)) { $ratings_max = (int) get_option( 'postratings_max' ); $ratings_custom = (int) get_option( 'postratings_customrating' ); $ratings_value = get_option('postratings_ratingsvalue'); $post_title = addslashes($post->post_title); $post_ratings = get_post_custom($post_id); $post_ratings_users = ! empty( $post_ratings['ratings_users'] ) ? (int) $post_ratings['ratings_users'][0] : 0; $post_ratings_score = ! empty( $post_ratings['ratings_score'] ) ? (int) $post_ratings['ratings_score'][0] : 0; // Check For Ratings Lesser Than 1 And Greater Than $ratings_max if($rate < 1 || $rate > $ratings_max) { $rate = 0; } ++$post_ratings_users; $post_ratings_score += (int) $ratings_value[ $rate - 1 ]; $post_ratings_average = round($post_ratings_score/$post_ratings_users, 2); update_post_meta($post_id, 'ratings_users', $post_ratings_users); update_post_meta($post_id, 'ratings_score', $post_ratings_score); update_post_meta($post_id, 'ratings_average', $post_ratings_average); // Add Log if(!empty($user_identity)) { $rate_user = addslashes($user_identity); } elseif(!empty($_COOKIE['comment_author_'.COOKIEHASH])) { $rate_user = addslashes($_COOKIE['comment_author_'.COOKIEHASH]); } else { $rate_user = __('Guest', 'wp-postratings'); } $rate_user = apply_filters( 'wp_postratings_process_ratings_user', $rate_user ); $rate_userid = apply_filters( 'wp_postratings_process_ratings_userid', $user_ID ); // Only Create Cookie If User Choose Logging Method 1 Or 3 $postratings_logging_method = (int) get_option( 'postratings_logging_method' ); if ( $postratings_logging_method === 1 || $postratings_logging_method === 3 ) { setcookie( 'rated_' . $post_id, $ratings_value[ $rate - 1 ], apply_filters( 'wp_postratings_cookie_expiration', time() + 30000000 ), apply_filters( 'wp_postratings_cookiepath', SITECOOKIEPATH ) ); } // Log Ratings In DB If User Choose Logging Method 2, 3 or 4 if ( $postratings_logging_method > 1 || apply_filters( 'wp_postratings_always_log', false ) ) { $wpdb->query($wpdb->prepare("INSERT INTO {$wpdb->ratings} VALUES (%d, %d, %s, %d, %d, %s, %s, %s, %d )", 0, $post_id, $post_title, $ratings_value[$rate - 1], current_time('timestamp'), ratings_get_ipaddress(), ratings_get_hostname(), $rate_user, $rate_userid)); } // Allow Other Plugins To Hook When A Post Is Rated do_action('rate_post', $rate_userid, $post_id, $ratings_value[$rate-1]); // Output AJAX Result echo the_ratings_results($post_id, $post_ratings_users, $post_ratings_score, $post_ratings_average); exit(); } else { printf(esc_html__('Invalid Post ID (#%s).', 'wp-postratings'), $post_id); exit(); } // End if($post) } else { printf( esc_html__( 'You Had Already Rated This Post. Post ID #%s.', 'wp-postratings' ), $post_id ); exit(); }// End if(!$rated) // Release lock ratings_release_lock( $fp_lock, $post_id ); } // End if($rate && $post_id && check_allowtorate()) } // End if(isset($_REQUEST['action']) && $_REQUEST['action'] == 'postratings') } ### Function: Process Ratings add_action('wp_ajax_postratings-admin', 'manage_ratings'); function manage_ratings() { ### Form Processing if(isset($_GET['action']) && $_GET['action'] === 'postratings-admin') { check_ajax_referer('wp-postratings_option_update_individual_rating'); //Variables $postratings_url = plugins_url('wp-postratings/images'); $postratings_path = WP_PLUGIN_DIR.'/wp-postratings/images'; $postratings_ratingstext = get_option('postratings_ratingstext'); $postratings_ratingsvalue = get_option('postratings_ratingsvalue'); // Form Processing $postratings_customrating = isset( $_GET['custom'] ) ? (int) $_GET['custom'] : 0; $postratings_image = isset( $_GET['image'] ) ? esc_attr( trim( $_GET['image'] ) ) : ''; $postratings_max = isset( $_GET['max'] ) ? (int) $_GET['max'] : 0; // If It Is A Up/Down Rating if($postratings_customrating && $postratings_max === 2) { $postratings_ratingsvalue[0] = -1; $postratings_ratingsvalue[1] = 1; $postratings_ratingstext[0] = __('Vote Down', 'wp-postratings'); $postratings_ratingstext[1] = __('Vote Up', 'wp-postratings'); } else { for($i = 0; $i < $postratings_max; $i++) { if($i > 0) { $postratings_ratingstext[$i] = sprintf(esc_html__('%s Stars', 'wp-postratings'), number_format_i18n($i+1)); } else { $postratings_ratingstext[$i] = sprintf(esc_html__('%s Star', 'wp-postratings'), number_format_i18n($i+1)); } $postratings_ratingsvalue[$i] = $i+1; } } ?>'."\n"; if(is_rtl() && file_exists($postratings_path.'/'.$postratings_image.'/rating_start-rtl.'.RATINGS_IMG_EXT)) { echo ''; } elseif(file_exists($postratings_path.'/'.$postratings_image.'/rating_start.'.RATINGS_IMG_EXT)) { echo ''; } if($postratings_customrating) { if($postratings_max == 2) { echo ''; } else { for($j = 1; $j < ($i+1); $j++) { echo ''; } } } else { for($j = 1; $j < ($i+1); $j++) { echo ''; } } if(is_rtl() && file_exists($postratings_path.'/'.$postratings_image.'/rating_end-rtl.'.RATINGS_IMG_EXT)) { echo ''; } elseif(file_exists($postratings_path.'/'.$postratings_image.'/rating_end.'.RATINGS_IMG_EXT)) { echo ''; } echo ' | '."\n"; echo ''."\n"; echo ''."\n"; echo ' | '."\n"; echo ''."\n"; echo ''."\n"; echo ' | '."\n"; echo '
'.esc_html__('WP-PostRatings', 'wp-postratings').'
'."\n"; $content .= ''.sprintf(_n('%s Highest Rated Post', '%s Highest Rated Posts', $stats_mostlimit, 'wp-postratings'), number_format_i18n($stats_mostlimit)).'
'."\n"; $content .= ''.sprintf(_n('%s Highest Rated Page', '%s Highest Rated Pages', $stats_mostlimit, 'wp-postratings'), number_format_i18n($stats_mostlimit)).'
'."\n"; $content .= ''.sprintf(_n('%s Most Rated Post', '%s Most Rated Posts', $stats_mostlimit, 'wp-postratings'), number_format_i18n($stats_mostlimit)).'
'."\n"; $content .= ''.sprintf(_n('%s Most Rated Page', '%s Most Rated Pages', $stats_mostlimit, 'wp-postratings'), number_format_i18n($stats_mostlimit)).'
'."\n"; $content .= '