function check_rated($post_id) { $postratings_logging_method = intval(get_option('postratings_logging_method')); $rated = false; switch ($postratings_logging_method) { // Do Not Log case 0: $rated = false; break; // Logged By Cookie // Logged By Cookie case 1: $rated = check_rated_cookie($post_id); break; // Logged By IP // Logged By IP case 2: $rated = check_rated_ip($post_id); break; // Logged By Cookie And IP // 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 // Logged By Username case 4: $rated = check_rated_username($post_id); break; } $rated = apply_filters('wp_postratings_check_rated', $rated); return $rated; }
function check_rated($post_id) { global $user_ID; $postratings_logging_method = intval(get_option('postratings_logging_method')); switch ($postratings_logging_method) { // Do Not Log case 0: return false; break; // Logged By Cookie // Logged By Cookie case 1: return check_rated_cookie($post_id); break; // Logged By IP // Logged By IP case 2: return check_rated_ip($post_id); break; // Logged By Cookie And IP // Logged By Cookie And IP case 3: $rated_cookie = check_rated_cookie($post_id); if ($rated_cookie > 0) { return true; } else { return check_rated_ip($post_id); } break; // Logged By Username // Logged By Username case 4: return check_rated_username($post_id); break; } return false; }