Changeset 593452
- Timestamp:
- 09/01/2012 04:44:12 PM (14 years ago)
- Location:
- rockhoist-ratings/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (4 diffs)
-
rh-ratings.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
rockhoist-ratings/trunk/readme.txt
r469932 r593452 2 2 Contributors: esserq 3 3 Tags: rating, thumbs, up, down, post, ajax 4 Requires at least: 3. 15 Tested up to: 3. 2.16 Stable tag: 1. 1.34 Requires at least: 3.4 5 Tested up to: 3.4.1 6 Stable tag: 1.2 7 7 8 8 Rockhoist Ratings is a thumbs up/ thumbs down style rating widget for posts. … … 25 25 1. Unpack `rh-ratings.zip` to the `/wp-content/plugins/` directory 26 26 1. Activate the plugin through the 'Plugins' menu in WordPress 27 1. Put the following code in your loop:28 29 `rhr_the_rating();`30 27 31 28 == Screenshots == … … 35 32 == Changelog == 36 33 37 = 1. 1.3=38 * Added rating widget to bottom of posts by default.34 = 1.2 = 35 * Fixed compatibility issue with content filter. 39 36 40 37 = 1.1.2 = … … 58 55 59 56 * Star ratings are not supported. 57 -
rockhoist-ratings/trunk/rh-ratings.php
r469932 r593452 2 2 /* 3 3 Plugin Name: Rockhoist Ratings 4 Version: 1. 1.24 Version: 1.2 5 5 Plugin URI: http://blarrr.com/wordpress-ratings-plugin/ 6 6 Description: A YouTube style rating widget for posts. … … 159 159 } 160 160 161 function rhr_the_rating( ) {161 function rhr_the_rating( $content ) { 162 162 163 163 global $post; … … 181 181 $downClass = ( $userRatingCountDown == 1 ) ? 'rating-down-active' : 'rating-down-inactive'; 182 182 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 189 195 } 190 196 … … 194 200 $ratingCountDown = rhb_count_ratings( array( 'post_ID' => $post->ID, 195 201 '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; 203 217 } 204 218 … … 264 278 exit; 265 279 } 280
Note: See TracChangeset
for help on using the changeset viewer.