Plugin Directory

Changeset 593452


Ignore:
Timestamp:
09/01/2012 04:44:12 PM (14 years ago)
Author:
esserq
Message:

Fixed compatibility issue with content filter.

Location:
rockhoist-ratings/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • rockhoist-ratings/trunk/readme.txt

    r469932 r593452  
    22Contributors: esserq
    33Tags: rating, thumbs, up, down, post, ajax
    4 Requires at least: 3.1
    5 Tested up to: 3.2.1
    6 Stable tag: 1.1.3
     4Requires at least: 3.4
     5Tested up to: 3.4.1
     6Stable tag: 1.2
    77
    88Rockhoist Ratings is a thumbs up/ thumbs down style rating widget for posts.
     
    25251. Unpack `rh-ratings.zip` to the `/wp-content/plugins/` directory
    26261. Activate the plugin through the 'Plugins' menu in WordPress
    27 1. Put the following code in your loop:
    28 
    29 `rhr_the_rating();`
    3027
    3128== Screenshots ==
     
    3532== Changelog ==
    3633
    37 = 1.1.3 =
    38 * Added rating widget to bottom of posts by default.
     34= 1.2 =
     35* Fixed compatibility issue with content filter.
    3936
    4037= 1.1.2 =
     
    5855
    5956* Star ratings are not supported.
     57
  • rockhoist-ratings/trunk/rh-ratings.php

    r469932 r593452  
    22/*
    33Plugin Name: Rockhoist Ratings
    4 Version: 1.1.2
     4Version: 1.2
    55Plugin URI: http://blarrr.com/wordpress-ratings-plugin/
    66Description: A YouTube style rating widget for posts.
     
    159159}
    160160
    161 function rhr_the_rating() {
     161function rhr_the_rating( $content ) {
    162162
    163163    global $post;
     
    181181        $downClass = ( $userRatingCountDown == 1 ) ? 'rating-down-active' : 'rating-down-inactive';
    182182
    183         ?>
    184         <div class="rating-widget">
    185             <a id="rate-up-<?php echo $post->ID; ?>" class="rating-icon <?php echo $upClass; ?>"></a>
    186             <a id="rate-down-<?php echo $post->ID; ?>" class="rating-icon <?php echo $downClass; ?>"></a>
    187         </div> <!-- /rating-widget -->
    188         <?php
     183        $content = sprintf('%s
     184            <div class="rating-widget">
     185                <a id="rate-up-%s" class="rating-icon %s"></a>
     186                <a id="rate-down-%s" class="rating-icon %s"></a>
     187            </div> <!-- /rating-widget -->',
     188            $content,
     189            $post->ID,
     190            $upClass,
     191            $post->ID,
     192            $downClass
     193        );
     194
    189195    }
    190196
     
    194200    $ratingCountDown = rhb_count_ratings( array( 'post_ID' => $post->ID,
    195201        'rating' => 'down' ) );
    196     ?>
    197    
    198     <div class="rating-count">
    199         Up votes: <span id="rating-count-up-<?php echo $post->ID; ?>" class="rating-count-up"><?php echo $ratingCountUp; ?></span>
    200         Down votes: <span id="rating-count-down-<?php echo $post->ID; ?>" class="rating-count-down"><?php echo $ratingCountDown; ?></span>
    201     </div>
    202     <?php
     202
     203
     204    $content = sprintf('%s
     205        <div class="rating-count">
     206        Up votes: <span id="rating-count-up-%s" class="rating-count-up">%s</span>
     207        Down votes: <span id="rating-count-down-%s" class="rating-count-down">%s</span>
     208        </div>',
     209        $content,
     210        $post->ID,
     211        $ratingCountUp,
     212        $post->ID,
     213        $ratingCountDown
     214    );
     215
     216    return $content;
    203217}
    204218
     
    264278    exit;
    265279}
     280
Note: See TracChangeset for help on using the changeset viewer.