Changeset 661474
- Timestamp:
- 01/31/2013 02:09:49 AM (13 years ago)
- Location:
- rich-reviews/trunk
- Files:
-
- 3 edited
-
readme.txt (modified) (2 diffs)
-
rich-reviews.css (modified) (5 diffs)
-
rich-reviews.php (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
rich-reviews/trunk/readme.txt
r658498 r661474 3 3 Donate link: http://www.foxytechnology.com 4 4 Tags: reviews, review, testimonials, testimonial, hreview, rating, ratings, google, rich snippets, review widget, seo, shortcode, plugin, snippet, snippets 5 Requires at least: 3. 0.15 Requires at least: 3.4 6 6 Tested up to: 3.5 7 Stable tag: 1. 07 Stable tag: 1.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 50 50 == Changelog == 51 51 52 = 1.1 = 53 * Altered CSS to make the reviews and the review form more pretty (Thanks, Andrew!) 54 * New, altered CSS allows reviews to properly be displayed and stacked vertically (for example, in a sidebar) 55 * Integrated/fixed support for non-English characters (Thanks, IvicaD!) 56 * Split menu up into three parts: instructions, pending reviews, and approved reviews 57 * New "Approved Reviews" admin menu allows you to view every review you have ever previously approved, and change its status (to pending, or mark it for deletion) at will 58 52 59 = 1.0 = 53 60 * Initial release 61 62 == Upgrade Notice == 63 64 = 1.1 = 65 This version pretties up the reviews and the form, and fixes the CSS to allow vertical stacking of reviews in, say, a sidebar. Also implements an "approved reviews" menu to view and change the status of previously-approved reviews. 66 67 = 1.0 = 68 Initial release -
rich-reviews/trunk/rich-reviews.css
r658488 r661474 1 1 .testimonial { 2 2 width:31%; 3 min-width: 150px; 3 4 height:auto; 4 5 float: left; 5 6 margin-right: 3.5%; 7 margin-bottom: 5%; 6 8 } 7 9 .testimonial:last-child { … … 21 23 float:none; 22 24 clear:both; 23 }24 25 .testimonial .stars {26 float:left !important;27 font-size:20px;28 25 } 29 26 … … 88 85 border-collapse: collapse; 89 86 } 87 .reviewform { 88 display: block; 89 } 90 90 .rr_action { 91 91 min-width: 80px; … … 105 105 vertical-align: text-top; 106 106 } 107 .rr_review_text { 108 } 109 .rr_all_review_text { 110 } 107 111 108 .rr_star{ 112 109 color: #ffaf00; … … 114 111 .rr_small_input { 115 112 width: 250px; 116 height: 20px; 113 height: 1.1em; 114 margin-bottom: 9px; 117 115 } 118 116 .rr_large_input { 119 117 width: 250px; 120 height: 160px;118 height: 6em; 121 119 vertical-align: top; 120 margin-bottom: 12px; 122 121 } 123 122 .rr_title { 124 font-size: 1 20%;123 font-size: 130%; 125 124 font-weight: bold; 125 line-height: 1em !important; 126 text-transform: uppercase; 127 margin-top: 3%; 128 display: block; 126 129 } 127 .rr_hr { 128 border: 0; 129 width: 80%; 130 .stars { 131 float:left !important; 132 font-size: 150%; 133 display: block; 134 margin-top: 5%; 135 margin-bottom: 5%; 136 line-height: 1em !important; 130 137 } 138 .rr_review_name { 139 line-height: 1em !important; 140 font-style: italic; 141 margin-top: 3%; 142 display: block; 143 float: right; 144 margin-right: 20px !important; 145 font-size: 100%; 146 font-weight: 500; 147 } 148 .rr_review_text { 149 line-height: 1em !important; 150 color: #777; 151 line-height: 1em !important; 152 } 153 .rr_all_review_text { 154 } 155 156 .rr_form_heading { 157 letter-spacing: .1em; 158 font-weight: 100; 159 } 160 .rr_input_stars { 161 font-size: 150%; 162 } -
rich-reviews/trunk/rich-reviews.php
r658488 r661474 4 4 Plugin URI: http://www.foxytechnology.com/rich-reviews-wordpress-plugin/ 5 5 Description: Rich Reviews empowers you to easily capture user reviews and display them on your wordpress page or post and in Google Search Results as a Google Rich Snippet. 6 Version: 1. 06 Version: 1.1 7 7 Author: Foxy Technology 8 8 Author URI: http://www.foxytechnology.com … … 28 28 class FPRichReviews { 29 29 var $sqltable = 'richreviews'; 30 var $fp_admin_options = 'rr_admin_options'; 30 31 31 32 function FPRichReviews() { … … 35 36 add_action('init', array(&$this, 'fp_init')); 36 37 add_action('admin_menu', array(&$this, 'fp_init_admin_menu')); 38 add_action('wp_enqueue_scripts', array(&$this, 'fp_load_scripts_styles'), 100); 39 add_action( 'admin_enqueue_scripts', array(&$this, 'fp_load_admin_scripts_styles'), 100); 37 40 add_shortcode('RICH_REVIEWS_FORM', array(&$this, 'fp_shortcode_reviews_form')); 38 41 add_shortcode('RICH_REVIEWS_SHOW', array(&$this, 'fp_shortcode_reviews_show')); … … 49 52 $this->fp_update_database(); 50 53 } 54 $this->fp_process_plugin_updates(); 55 } 56 57 function fp_init_admin_menu() { 58 global $wpdb; 59 $pendingReviewsCount = $wpdb->get_var("SELECT COUNT(*) FROM $this->sqltable WHERE review_status=\"0\""); 60 $pendingReviewsText = ''; 61 $menuTitle = ''; 62 if ($pendingReviewsCount != 0) { 63 $pendingReviewsText = ' (' . $pendingReviewsCount . ')'; 64 } 65 add_menu_page( 66 'Rich Reviews Settings', 67 'Rich Reviews' . $pendingReviewsText, 68 'administrator', 69 'rich_reviews_settings_main', 70 array(&$this, 'fp_render_settings_main_page'), 71 plugin_dir_url( __FILE__ ) . 'fox_logo_16x16.png', 72 '25.11111111' 73 ); 74 add_submenu_page( 75 'rich_reviews_settings_main', // ID of menu with which to register this submenu 76 'Rich Reviews - Settings', //text to display in browser when selected 77 'Instructions', // the text for this item 78 'administrator', // which type of users can see this menu 79 'rich_reviews_settings_main', // unique ID (the slug) for this menu item 80 array(&$this, 'fp_render_settings_main_page') // callback function 81 ); 82 add_submenu_page( 83 'rich_reviews_settings_main', // ID of menu with which to register this submenu 84 'Rich Reviews - Pending Reviews', //text to display in browser when selected 85 'Pending Reviews' . $pendingReviewsText, // the text for this item 86 'administrator', // which type of users can see this menu 87 'fp_admin_pending_reviews_page', // unique ID (the slug) for this menu item 88 array(&$this, 'fp_render_pending_reviews_page') // callback function 89 ); 90 add_submenu_page( 91 'rich_reviews_settings_main', // ID of menu with which to register this submenu 92 'Rich Reviews - Approved Reviews', //text to display in browser when selected 93 'Approved Reviews', // the text for this item 94 'administrator', // which type of users can see this menu 95 'fp_admin_reviews_page', // unique ID (the slug) for this menu item 96 array(&$this, 'fp_render_all_reviews_page') // callback function 97 ); 98 } 99 100 function fp_process_plugin_updates() { 101 global $wpdb; 102 require_once( ABSPATH . 'wp-admin/includes/plugin.php'); 103 $plugin_data = get_plugin_data( __FILE__ ); 104 $newest_version = $plugin_data['Version']; 105 $options = get_option($this->fp_admin_options); 106 if (isset($options['version'])) { 107 $current_version = $options['version']; 108 } else { //we were in version 1.0, now we updated 109 $current_version = '1.0'; 110 } 111 112 if ($current_version == '1.0') { 113 $wpdb->query("ALTER TABLE $this->sqltable CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci"); 114 } 115 116 if (($newest_version != $current_version) || ($newest_version == '1.0')) { 117 update_option($this->fp_admin_options, array('version' => $newest_version)); 118 } 119 } 120 121 function fp_load_scripts_styles() { 51 122 $pluginDirectory = trailingslashit(plugins_url(basename(dirname(__FILE__)))); 123 wp_register_script('rich-reviews', $pluginDirectory . 'rich-reviews.js', array('jquery')); 124 wp_enqueue_script('rich-reviews'); 52 125 wp_register_style('rich-reviews', $pluginDirectory . 'rich-reviews.css'); 126 wp_enqueue_style('rich-reviews'); 127 } 128 129 function fp_load_admin_scripts_styles() { 130 $pluginDirectory = trailingslashit(plugins_url(basename(dirname(__FILE__)))); 53 131 wp_register_script('rich-reviews', $pluginDirectory . 'rich-reviews.js', array('jquery')); 132 wp_enqueue_script('rich-reviews'); 133 wp_register_style('rich-reviews', $pluginDirectory . 'rich-reviews.css'); 54 134 wp_enqueue_style('rich-reviews'); 55 wp_enqueue_script('rich-reviews');56 135 } 57 136 … … 75 154 review_status tinyint(1) DEFAULT '0', 76 155 reviewer_ip varchar(15) DEFAULT NULL, 77 PRIMARY KEY (id) 156 PRIMARY KEY (id) CHARACTER SET utf8 COLLATE utf8_general_ci 78 157 );"; 79 158 dbDelta($sql); 80 159 } 81 160 82 function fp_init_admin_menu() { 83 global $wpdb; 84 $pendingReviewsCount = $wpdb->get_var("SELECT COUNT(*) FROM $this->sqltable WHERE review_status=\"0\""); 85 $menuTitle = 'Rich Reviews'; 86 if ($pendingReviewsCount != 0) { 87 $menuTitle .= ' (' . $pendingReviewsCount . ')'; 88 } 89 add_menu_page( 90 'Rich Reviews Settings', 91 $menuTitle, 92 'administrator', 93 'rich_reviews_settings', 94 array(&$this, 'fp_render_settings_page'), 95 plugin_dir_url( __FILE__ ) . 'fox_logo_16x16.png', 96 '25.11111111' 97 ); 98 } 99 100 function fp_render_settings_page() { 101 global $wpdb; 102 echo '<div class="wrap"><h2><img src="' . plugin_dir_url( __FILE__ ) . 'fox_logo_32x32.png" /> Rich Reviews</h2></div>'; 103 echo '<p>Thank you for using Rich Reviews by <a href="http://www.foxytechnology.com">Foxy Technology</a>!</p><p>This plugin is built around shortcodes.<br />[RICH_REVIEWS_FORM] will display a form with which your users may submit reviews. These reviews are not accepted automatically, rather the reviews will be sent to this page as a "Pending Review" to await your approval. You will know you have reviews pending because the menu page will have a number next to it.<br />[RICH_REVIEWS_SHOW] will show the first three reviews which were submitted to your website. This is meant to be displayed in a horizontal layout.<br />[RICH_REVIEWS_SHOW_ALL] will show EVERY review which has been approved. It is recommended that you display this in its own dedicated page, as it will likely take a large amount of room.<br />[RICH_REVIEWS_SNIPPET] will display text such as "Overall rating: 4.3 out of 5 based on 10 reviews" in such a way as to show up in a google search, using <a href="http://support.google.com/webmasters/bin/answer.py?hl=en&answer=99170">Google Rich Snippets</a>. This is a separate shortcode so that the rating (and hence the rich snippets) can be placed on many pages, even if the reviews are not also displayed on that page.<br /></p>'; 104 echo '<div class="wrap"><h2>Pending Reviews</h2></div>'; 161 function fp_render_settings_main_page() { 162 $output = ''; 163 $output .= '<div class="wrap"><h2><img src="' . plugin_dir_url( __FILE__ ) . 'fox_logo_32x32.png" /> Rich Reviews</h2></div>'; 164 $output .= '<p>Thank you for using Rich Reviews by <a href="http://www.foxytechnology.com">Foxy Technology</a>!</p> 165 <p>This plugin is built around shortcodes. 166 <br /><b>[RICH_REVIEWS_FORM]</b> will display a form with which your users may submit reviews. These reviews are not accepted automatically, rather the reviews will be sent to this page as a "Pending Review" to await your approval. You will know you have reviews pending because the menu page will have a number next to it. 167 <br /><b>[RICH_REVIEWS_SHOW]</b> will show the first three reviews which were submitted to your website. This is meant to be displayed in a horizontal layout. 168 <br /><b>[RICH_REVIEWS_SHOW_ALL]</b> will show EVERY review which has been approved. It is recommended that you display this in its own dedicated page, as it will likely take a large amount of room. 169 <br /><b>[RICH_REVIEWS_SNIPPET]</b> will display text such as "Overall rating: 4.3 out of 5 based on 10 reviews" in such a way as to show up in a google search, using <a href="http://support.google.com/webmasters/bin/answer.py?hl=en&answer=99170">Google Rich Snippets</a>. This is a separate shortcode so that the rating (and hence the rich snippets) can be placed on many pages, even if the reviews are not also displayed on that page.<br /></p> 170 <p>The other two settings pages will allow you view the reviews that have been posted. 171 <br /><b>"Pending Reviews"</b> shows any pending reviews which are awaiting your approval or rejection (if there are any, this will show up as a number next to this menu. For example, if you have 2 pending reviews, the menu name in the sidebar will be "Rich Reviews (2)". 172 <br /><b>"Approved Reviews"</b> shows all the reviews which you have approved. In this way you can change the status of previously-approved reviews to be either a pending review again, or to delete them entirely.'; 173 echo $output; 174 } 175 176 function fp_render_pending_reviews_page() { 177 global $wpdb; 178 $output = ''; 179 $output .= '<div class="wrap"><h2><img src="' . plugin_dir_url( __FILE__ ) . 'fox_logo_32x32.png" /> Pending Reviews</h2></div>'; 105 180 if (isset($_POST['submitted'])) { 106 181 if ($_POST['submitted'] == 'Y') { 107 $sql = "SELECT 182 $sql = "SELECT 108 183 id as `idid`, 109 184 reviewer_name as `reviewername`, … … 112 187 foreach ($pendingIDs as $result) { 113 188 $idid = $result['idid']; 114 $rName = $result['reviewername'];115 $rIP = $result['reviewerip'];116 $postName = 'updateStatus_' . $idid;117 189 if (isset($_POST["updateStatus_$idid"])) { 118 if ($_POST["updateStatus_$idid"] == "approve") { 119 echo 'Review with internal ID ' . $idid . ' from the reviewer \"' . $rName . '\", whose IP is ' . $rIP . ' has been approved.<br>'; 120 $wpdb->update($this->sqltable, array('review_status' => '1'), array('id' => $idid)); 121 } else if ($_POST["updateStatus_$idid"] == "delete") { 122 echo 'Review with internal ID ' . $idid . ' from the reviewer ' . $this->fp_nice_output($rName) . ', whose IP is ' . $rIP . ' has been deleted.<br>'; 123 $wpdb->query("DELETE FROM $this->sqltable WHERE id=\"$idid\""); 190 $status = $_POST["updateStatus_$idid"]; 191 if ($status != 'limbo') { 192 $output .= $this->fp_update_review_status($result, $status); 124 193 } 125 194 } 126 195 } 127 echo '<br>'; 128 } 129 } 130 global $wpdb; 196 $output .= '<br>'; 197 } 198 } 131 199 $pendingReviewsCount = $wpdb->get_var("SELECT COUNT(*) FROM $this->sqltable WHERE review_status=\"0\""); 132 200 if ($pendingReviewsCount == 0) { 133 echo'<p>There are no reviews pending approval.</p>';201 $output .= '<p>There are no reviews pending approval.</p>'; 134 202 } else { 135 203 $sql = "SELECT id as `idid`, … … 144 212 $pendingReviews = $wpdb->get_results($sql, ARRAY_A); 145 213 146 echo '<form method="post" action=""><input type="hidden" name="submitted" value="Y" /> 147 <table><tbody><tr><th></th><th style="text-align: left">Reviewer</th><th style="text-align: left">Review Content</th></tr>'; 214 $output .= '<form method="post" action=""> 215 <input type="hidden" name="submitted" value="Y" /> 216 <table><tbody><tr><th></th> 217 <th style="text-align: left">Reviewer</th> 218 <th style="text-align: left">Review Content</th></tr>'; 148 219 foreach($pendingReviews as $result) { 149 echo $this->fp_display_admin_review($result); 150 } 151 echo '<tr><td></td><td colspan="2"><input name="submitButton" type="submit" value="Submit Changes" /></td></tr></tbody></table></form>'; 152 } 220 $output .= $this->fp_display_admin_review($result); 221 } 222 $output .= '<tr><td></td><td colspan="2"><input name="submitButton" type="submit" value="Submit Changes" /></td></tr></tbody></table></form>'; 223 } 224 echo $output; 225 } 226 227 function fp_render_all_reviews_page() { 228 global $wpdb; 229 $output = ''; 230 $output .= '<div class="wrap"><h2><img src="' . plugin_dir_url( __FILE__ ) . 'fox_logo_32x32.png" /> Approved Reviews</h2></div>'; 231 if (isset($_POST['submitted'])) { 232 if ($_POST['submitted'] == 'Y') { 233 $sql = "SELECT 234 id as `idid`, 235 reviewer_name as `reviewername`, 236 reviewer_ip as `reviewerip` FROM $this->sqltable WHERE review_status=\"1\""; 237 $pendingIDs = $wpdb->get_results($sql, ARRAY_A); 238 foreach ($pendingIDs as $result) { 239 $idid = $result['idid']; 240 if (isset($_POST["updateStatus_$idid"])) { 241 $status = $_POST["updateStatus_$idid"]; 242 if ($status != 'approve') { 243 $output .= $this->fp_update_review_status($result, $status); 244 } 245 } 246 } 247 $output .= '<br>'; 248 } 249 } 250 $approvedReviewsCount = $wpdb->get_var("SELECT COUNT(*) FROM $this->sqltable WHERE review_status=\"1\""); 251 if ($approvedReviewsCount == 0) { 252 $output .= 'There are no reviews which have been marked as "approved."'; 253 } else { 254 $sql = "SELECT id as `idid`, 255 date_time as `datetime`, 256 reviewer_name as `reviewername`, 257 reviewer_email as `revieweremail`, 258 review_title as `reviewtitle`, 259 review_rating as `reviewrating`, 260 review_text as `reviewtext`, 261 review_status as `reviewstatus`, 262 reviewer_ip as `reviewerip` FROM $this->sqltable WHERE review_status=\"1\""; 263 $approvedReviews = $wpdb->get_results($sql, ARRAY_A); 264 $output .= '<form method="post" action=""> 265 <input type="hidden" name="submitted" value="Y" /> 266 <table><tbody><tr><th></th> 267 <th style="text-align: left">Reviewer</th> 268 <th style="text-align: left">Review Content</th></tr>'; 269 foreach ($approvedReviews as $result) { 270 $output .= $this->fp_display_admin_review($result, 'approve'); 271 } 272 $output .= '<tr><td></td><td colspan="2"><input name="submitButton" type="submit" value="Submit Changes" /></td></tr></tbody></table></form>'; 273 } 274 echo $output; 275 } 276 277 function fp_update_review_status($result, $status) { 278 global $wpdb; 279 $idid = $result['idid']; 280 $rName = $result['reviewername']; 281 $rIP = $result['reviewerip']; 282 $output = 'Something went wrong! Please report this error.'; 283 switch ($status) { 284 case 'approve': 285 $output = 'Review with internal ID ' . $idid . ' from the reviewer ' . $this->fp_nice_output($rName) . ', whose IP is ' . $rIP . ' has been approved.<br>'; 286 $wpdb->update($this->sqltable, array('review_status' => '1'), array('id' => $idid)); 287 break; 288 case 'limbo': 289 $output = 'Review with internal ID ' . $idid . ' from the reviewer ' . $this->fp_nice_output($rName) . ', whose IP is ' . $rIP . ' has been set as a pending review.<br>'; 290 $wpdb->update($this->sqltable, array('review_status' => '0'), array('id' => $idid)); 291 break; 292 case 'delete': 293 $output = 'Review with internal ID ' . $idid . ' from the reviewer ' . $this->fp_nice_output($rName) . ', whose IP is ' . $rIP . ' has been deleted.<br>'; 294 $wpdb->query("DELETE FROM $this->sqltable WHERE id=\"$idid\""); 295 break; 296 } 297 return $output; 153 298 } 154 299 … … 225 370 <input type="hidden" name="submitted" value="Y" /> 226 371 <input type="hidden" name="rRating" id="rRating" value="0" /> 227 <div class=" left">Name</div><div class="right"><input class="rr_small_input" type="text" name="rName" value="' . $rName . '" /></div>228 <div class="clear"></div> 229 <div class=" left">Email</div><div class="right"><input class="rr_small_input" type="text" name="rEmail" value="' . $rEmail . '" /></div>230 <div class="clear"></div> 231 <div class=" left">Review Title</div><div class="right"><input class="rr_small_input" type="text" name="rTitle" value="' . $rTitle . '" /></div>232 <div class="clear"></div> 233 <div class=" left">Rating</div><div class="right">' . $this->fp_star_rating_input() . '</div>234 <div class="clear"></div> 235 <div class=" left">Review Text</div><div class="right"><textarea class="rr_large_input" name="rText"></textarea></div>372 <div class="rr_form_heading">Name (*)</div><div class="right"><input class="rr_small_input" type="text" name="rName" value="' . $rName . '" /></div> 373 <div class="clear"></div> 374 <div class="rr_form_heading">Email</div><div class="right"><input class="rr_small_input" type="text" name="rEmail" value="' . $rEmail . '" /></div> 375 <div class="clear"></div> 376 <div class="rr_form_heading">Review Title (*)</div><div class="right"><input class="rr_small_input" type="text" name="rTitle" value="' . $rTitle . '" /></div> 377 <div class="clear"></div> 378 <div class="rr_form_heading">Rating (*)</div><div class="rr_input_stars">' . $this->fp_star_rating_input() . '</div> 379 <div class="clear"></div> 380 <div class="rr_form_heading">Review Text (*)</div><div class="right"><textarea class="rr_large_input" name="rText"></textarea></div> 236 381 <div class="clear"></div> 237 382 <div class="left"><input name="submitButton" type="submit" value="Submit Review" /></div> … … 269 414 reviewer_ip as `reviewerip` FROM $this->sqltable WHERE review_status=\"1\" LIMIT 3"; 270 415 $results = $wpdb->get_results($sql, ARRAY_A); 271 $output .= '<div >';416 $output .= '<div class="testimonial_group">'; 272 417 foreach($results as $result) { 273 418 $output .= $this->fp_display_review($result); 274 419 } 275 $output .= '</div> ';420 $output .= '</div><div class="clear"></div>'; 276 421 } 277 422 … … 294 439 reviewer_ip as `reviewerip` FROM $this->sqltable WHERE review_status=\"1\""; 295 440 $results = $wpdb->get_results($sql, ARRAY_A); 296 //$output .= '<span id="results">';297 441 $ii = 0; 298 442 $output .= '<div class="testimonial_group">'; … … 302 446 if (($ii % 3) == 0) { 303 447 $output .= '</div><div class="clear"></div><div class="testimonial_group">'; 304 //$output .= '<hr>';305 448 } 306 449 } 307 $output .= '</div> ';450 $output .= '</div><div class="clear"></div>'; 308 451 } 309 452 return $output; … … 319 462 } 320 463 321 $output = '<div class="hreview-aggregate">Overall rating: <span class="rating">' . $averageRating . '</span> out of 5 based on <span class="count">' . $approvedReviewsCount . '</span> reviews</ span></div>';322 return $output; 323 } 324 325 function fp_display_admin_review($review ) {464 $output = '<div class="hreview-aggregate">Overall rating: <span class="rating">' . $averageRating . '</span> out of 5 based on <span class="count">' . $approvedReviewsCount . '</span> reviews</div>'; 465 return $output; 466 } 467 468 function fp_display_admin_review($review, $status = 'limbo') { 326 469 $rID = $review['idid']; 327 470 $rDateTime = $review['datetime']; … … 340 483 $rRating .= '☆'; // white star 341 484 } 485 $approveChecked = ''; 486 $limboChecked = ''; 487 $deleteChecked = ''; 488 switch ($status) { 489 case 'approve': 490 $approveChecked = ' checked'; 491 break; 492 case 'limbo': 493 $limboChecked = ' checked'; 494 break; 495 case 'delete': 496 $deleteChecked = ' checked'; 497 break; 498 } 342 499 $output = '<tr class="rr_admin_review"><td class="rr_action"> 343 <input class="radio" type="radio" name="updateStatus_' . $rID . '" value="approve" /> Approve<br /> 344 <input class="radio" type="radio" name="updateStatus_' . $rID . '" value="delete" /> Delete</td>'; 345 $output .= '<td class="rr_reviewer"><b>' . $rName . '</b><br />' . $rEmail . '<br />' . $rIP . '<br /></td>'; 346 $output .= '<td class="rr_review_content"><span class="rr_title">' . $rTitle . '</span><br />' . $rRating . '<br /><div class="rr_review_text">' . $rText . '</div></tr>'; 500 <input class="radio" type="radio" name="updateStatus_' . $rID . '" value="approve"' . $approveChecked . '/> Approve<br /> 501 <input class="radio" type="radio" name="updateStatus_' . $rID . '" value="limbo"' . $limboChecked . '/> Pending<br /> 502 <input class="radio" type="radio" name="updateStatus_' . $rID . '" value="delete"' . $deleteChecked . '/> Delete</td> 503 <td class="rr_reviewer"><b>' . $rName . '</b><br />' . $rEmail . '<br />' . $rIP . '<br /></td> 504 <td class="rr_review_content"><span class="rr_title">' . $rTitle . '</span><br />' . $rRating . '<br /><div class="rr_review_text">' . $rText . '</div></tr>'; 347 505 return $output; 348 506 } … … 370 528 <div class="clear"></div> 371 529 <span class="stars">' . $rRating . '</span> 372 <h3 class="left">' . $rName . '</h2>373 530 <div class="clear"></div>'; 374 $output .= '<p class="rr_review_text"><span class="drop_cap">“</span>' . $rText . '”</p>'; 531 $output .= '<div class="rr_review_text"><span class="drop_cap">“</span>' . $rText . '”</div>'; 532 $output .= '<span class="rr_review_name"> - ' . $rName . '</span> 533 <div class="clear"></div>'; 375 534 $output .= '</div>'; 376 535 return $output; 377 536 } 537 378 538 function fp_nice_output($input) { 379 539 return str_replace(array('\\', '/'), '', $input);
Note: See TracChangeset
for help on using the changeset viewer.