Changeset 765228
- Timestamp:
- 08/31/2013 09:14:48 PM (13 years ago)
- Location:
- rich-reviews/trunk
- Files:
-
- 12 added
- 2 edited
-
css (added)
-
css/rich-reviews.css (added)
-
fonts (added)
-
fonts/glyphicons-halflings-regular.eot (added)
-
fonts/glyphicons-halflings-regular.svg (added)
-
fonts/glyphicons-halflings-regular.ttf (added)
-
fonts/glyphicons-halflings-regular.woff (added)
-
js (added)
-
js/rich-reviews.js (added)
-
readme.txt (modified) (2 diffs)
-
rich-reviews-admin-tables.php (added)
-
rich-reviews.php (modified) (12 diffs)
-
scss (added)
-
scss/rich-reviews.scss (added)
Legend:
- Unmodified
- Added
- Removed
-
rich-reviews/trunk/readme.txt
r665820 r765228 4 4 Tags: reviews, review, testimonials, testimonial, hreview, rating, ratings, google, rich snippets, review widget, seo, shortcode, plugin, snippet, snippets 5 5 Requires at least: 3.4 6 Tested up to: 3. 57 Stable tag: 1. 36 Tested up to: 3.6 7 Stable tag: 1.4 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 52 52 == Changelog == 53 53 54 = 1.4 = 55 * Some much needed tweaks, such as better displaying data from the database (no more "rnrn"!) 56 * VASTLY improved admin menus - now the tried and true WordPress menus you know and love are in Rich Reviews! This means that now you can approve/delete bulk items with much greater ease! 57 * Added scss files for easier css maintenance 58 * Much better css! I am no longer providing the majority of the styles - instead I will allow whatever theme you currently have installed to do the leg work (as it should be!) 59 * Much better javascript! 60 54 61 = 1.3 = 55 62 * Added the much-requested feature of per-page/per-product reviews, as well as adding optional review categories to go along with it -
rich-reviews/trunk/rich-reviews.php
r665820 r765228 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. 36 Version: 1.4 7 7 Author: Foxy Technology 8 8 Author URI: http://www.foxytechnology.com … … 70 70 array(&$this, 'fp_render_settings_main_page'), 71 71 plugin_dir_url( __FILE__ ) . 'fox_logo_16x16.png', 72 '25.11 111111'72 '25.11' 73 73 ); 74 74 add_submenu_page( … … 137 137 function fp_load_scripts_styles() { 138 138 $pluginDirectory = trailingslashit(plugins_url(basename(dirname(__FILE__)))); 139 wp_register_script('rich-reviews', $pluginDirectory . ' rich-reviews.js', array('jquery'));139 wp_register_script('rich-reviews', $pluginDirectory . 'js/rich-reviews.js', array('jquery')); 140 140 wp_enqueue_script('rich-reviews'); 141 wp_register_style('rich-reviews', $pluginDirectory . ' rich-reviews.css');141 wp_register_style('rich-reviews', $pluginDirectory . 'css/rich-reviews.css'); 142 142 wp_enqueue_style('rich-reviews'); 143 143 } … … 145 145 function fp_load_admin_scripts_styles() { 146 146 $pluginDirectory = trailingslashit(plugins_url(basename(dirname(__FILE__)))); 147 wp_register_script('rich-reviews', $pluginDirectory . ' rich-reviews.js', array('jquery'));147 wp_register_script('rich-reviews', $pluginDirectory . 'js/rich-reviews.js', array('jquery')); 148 148 wp_enqueue_script('rich-reviews'); 149 wp_register_style('rich-reviews', $pluginDirectory . ' rich-reviews.css');149 wp_register_style('rich-reviews', $pluginDirectory . 'css/rich-reviews.css'); 150 150 wp_enqueue_style('rich-reviews'); 151 151 } … … 297 297 298 298 function fp_render_pending_reviews_page() { 299 global $wpdb; 300 $output = ''; 301 $output .= '<div class="wrap"><h2><img src="' . plugin_dir_url( __FILE__ ) . 'fox_logo_32x32.png" /> Pending Reviews</h2></div>'; 302 if (isset($_POST['submitted'])) { 303 if ($_POST['submitted'] == 'Y') { 304 $sql = "SELECT 305 id as `idid`, 306 reviewer_name as `reviewername`, 307 reviewer_ip as `reviewerip` FROM $this->sqltable WHERE review_status=\"0\""; 308 $pendingIDs = $wpdb->get_results($sql, ARRAY_A); 309 foreach ($pendingIDs as $result) { 310 $idid = $result['idid']; 311 if (isset($_POST["updateStatus_$idid"])) { 312 $status = $_POST["updateStatus_$idid"]; 313 if ($status != 'limbo') { 314 $output .= $this->fp_update_review_status($result, $status); 315 } 316 } 317 } 318 $output .= '<br>'; 319 } 320 } 321 $pendingReviewsCount = $wpdb->get_var("SELECT COUNT(*) FROM $this->sqltable WHERE review_status=\"0\""); 322 if ($pendingReviewsCount == 0) { 323 $output .= '<p>There are no reviews pending approval.</p>'; 324 } else { 325 $sql = "SELECT id as `idid`, 326 date_time as `datetime`, 327 reviewer_name as `reviewername`, 328 reviewer_email as `revieweremail`, 329 review_title as `reviewtitle`, 330 review_rating as `reviewrating`, 331 review_text as `reviewtext`, 332 review_status as `reviewstatus`, 333 reviewer_ip as `reviewerip`, 334 post_id as `postid`, 335 review_category as `reviewcategory` FROM $this->sqltable WHERE review_status=\"0\""; 336 $pendingReviews = $wpdb->get_results($sql, ARRAY_A); 337 338 $output .= '<form method="post" action=""> 339 <input type="hidden" name="submitted" value="Y" /> 340 341 <div class="rr_admin_review_table"> 342 <table class="rr_admin_review_table"> 343 <tr class="rr_admin_review_container"> 344 <td colspan="3"><input name="submitButton" type="submit" value="Submit Changes" /></td> 345 </tr> 346 <tr class="rr_admin_review_container"> 347 <td class="rr_admin_review_actions_container"></td> 348 <td class="rr_admin_review_info_container"><b>Reviewer</b></td> 349 <td class="rr_admin_review_content_container"><b>Review Content</b></td> 350 </tr>'; 351 foreach($pendingReviews as $result) { 352 $output .= $this->fp_display_admin_review($result); 353 } 354 $output .= '<tr class="rr_admin_review_container"> 355 <td colspan="3"><input name="submitButton" type="submit" value="Submit Changes" /></td> 356 </tr> 357 </table> 358 </form>'; 359 } 360 echo $output; 299 if (!current_user_can('manage_options')) { 300 wp_die( __('You do not have sufficient permissions to access this page.') ); 301 } 302 require_once(dirname(__FILE__) . '/rich-reviews-admin-tables.php'); 303 $rich_review_admin_table = new Rich_Reviews_Table(); 304 $rich_review_admin_table->prepare_items('pending'); 305 echo '<div class="wrap"><h2><img src="' . plugin_dir_url( __FILE__ ) . 'fox_logo_32x32.png" /> Pending Reviews</h2></div>'; 306 echo '<form id="form" method="POST">'; 307 $rich_review_admin_table->display(); 308 echo '</form>'; 361 309 } 362 310 363 311 function fp_render_approved_reviews_page() { 364 global $wpdb; 365 $output = ''; 366 $output .= '<div class="wrap"><h2><img src="' . plugin_dir_url( __FILE__ ) . 'fox_logo_32x32.png" /> Approved Reviews</h2></div>'; 367 if (isset($_POST['submitted'])) { 368 if ($_POST['submitted'] == 'Y') { 369 $sql = "SELECT 370 id as `idid`, 371 reviewer_name as `reviewername`, 372 reviewer_ip as `reviewerip` FROM $this->sqltable WHERE review_status=\"1\""; 373 $pendingIDs = $wpdb->get_results($sql, ARRAY_A); 374 foreach ($pendingIDs as $result) { 375 $idid = $result['idid']; 376 if (isset($_POST["updateStatus_$idid"])) { 377 $status = $_POST["updateStatus_$idid"]; 378 if ($status != 'approve') { 379 $output .= $this->fp_update_review_status($result, $status); 380 } 381 } 382 } 383 $output .= '<br>'; 384 } 385 } 386 $approvedReviewsCount = $wpdb->get_var("SELECT COUNT(*) FROM $this->sqltable WHERE review_status=\"1\""); 387 if ($approvedReviewsCount == 0) { 388 $output .= 'There are no reviews which have been marked as "approved."'; 389 } else { 390 $sql = "SELECT id as `idid`, 391 date_time as `datetime`, 392 reviewer_name as `reviewername`, 393 reviewer_email as `revieweremail`, 394 review_title as `reviewtitle`, 395 review_rating as `reviewrating`, 396 review_text as `reviewtext`, 397 review_status as `reviewstatus`, 398 reviewer_ip as `reviewerip`, 399 post_id as `postid`, 400 review_category as `reviewcategory` FROM $this->sqltable WHERE review_status=\"1\""; 401 $approvedReviews = $wpdb->get_results($sql, ARRAY_A); 402 $output .= '<form method="post" action=""> 403 <input type="hidden" name="submitted" value="Y" /> 404 405 <div class="rr_admin_review_table"> 406 <table class="rr_admin_review_table"> 407 <tr class="rr_admin_review_container"> 408 <td colspan="3"><input name="submitButton" type="submit" value="Submit Changes" /></td> 409 </tr> 410 <tr class="rr_admin_review_container"> 411 <td class="rr_admin_review_actions_container"></td> 412 <td class="rr_admin_review_info_container"><b>Reviewer</b></td> 413 <td class="rr_admin_review_content_container"><b>Review Content</b></td> 414 </tr>'; 415 foreach($approvedReviews as $result) { 416 $output .= $this->fp_display_admin_review($result, $result['reviewstatus']); 417 } 418 $output .= '<tr class="rr_admin_review_container"> 419 <td colspan="3"><input name="submitButton" type="submit" value="Submit Changes" /></td> 420 </tr> 421 </table> 422 </form>'; 423 } 424 echo $output; 312 if (!current_user_can('manage_options')) { 313 wp_die( __('You do not have sufficient permissions to access this page.') ); 314 } 315 require_once(dirname(__FILE__) . '/rich-reviews-admin-tables.php'); 316 $rich_review_admin_table = new Rich_Reviews_Table(); 317 $rich_review_admin_table->prepare_items('approved'); 318 echo '<div class="wrap"><h2><img src="' . plugin_dir_url( __FILE__ ) . 'fox_logo_32x32.png" /> Approved Reviews</h2></div>'; 319 echo '<form id="form" method="POST">'; 320 $rich_review_admin_table->display(); 321 echo '</form>'; 425 322 } 426 323 … … 449 346 450 347 function fp_star_rating_input() { 451 $output = '348 /*$output = ' 452 349 <span onmouseover="this.style.cursor=\'default\';"> 453 350 <span id="s1" onclick="starSelection(this.id);"onmouseout="outStar(this.id);"onmouseover="overStar(this.id);">☆</span> … … 456 353 <span id="s4" onclick="starSelection(this.id);"onmouseout="outStar(this.id);"onmouseover="overStar(this.id);">☆</span> 457 354 <span id="s5" onclick="starSelection(this.id);"onmouseout="outStar(this.id);"onmouseover="overStar(this.id);">☆</span> 458 </span>'; 355 </span>';*/ 356 $output = '<div class="rr_stars_container"> 357 <span class="rr_star glyphicon glyphicon-star-empty" id="rr_star_1"></span> 358 <span class="rr_star glyphicon glyphicon-star-empty" id="rr_star_2"></span> 359 <span class="rr_star glyphicon glyphicon-star-empty" id="rr_star_3"></span> 360 <span class="rr_star glyphicon glyphicon-star-empty" id="rr_star_4"></span> 361 <span class="rr_star glyphicon glyphicon-star-empty" id="rr_star_5"></span> 362 </div>'; 459 363 return $output; 460 364 } … … 538 442 } 539 443 if ($displayForm) { 540 $output .= '<form class="reviewform" id="fprr_review_form" method="post" action=""> 541 <input type="hidden" name="submitted" value="Y" /> 542 <input type="hidden" name="rRating" id="rRating" value="0" /> 543 <div class="rr_form_heading">Name (*)</div><div class="right"><input class="rr_small_input" type="text" name="rName" value="' . $rName . '" /></div> 544 <div class="clear"></div> 545 <div class="rr_form_heading">Email</div><div class="right"><input class="rr_small_input" type="text" name="rEmail" value="' . $rEmail . '" /></div> 546 <div class="clear"></div> 547 <div class="rr_form_heading">Review Title (*)</div><div class="right"><input class="rr_small_input" type="text" name="rTitle" value="' . $rTitle . '" /></div> 548 <div class="clear"></div> 549 <div class="rr_form_heading">Rating (*)</div><div class="rr_input_stars">' . $this->fp_star_rating_input() . '</div> 550 <div class="clear"></div> 551 <div class="rr_form_heading">Review Text (*)</div><div class="right"><textarea class="rr_large_input" name="rText"></textarea></div> 552 <div class="clear"></div> 553 <div class="left"><input name="submitButton" type="submit" value="Submit Review" /></div> 554 <div class="clear"></div> 555 </form>'; 444 $output .= '<form action="" method="post" class="rr_review_form" id="fprr_review_form">'; 445 $output .= ' <input type="hidden" name="submitted" value="Y" />'; 446 $output .= ' <input type="hidden" name="rRating" id="rRating" value="0" />'; 447 $output .= ' <table class="form_table">'; 448 $output .= ' <tr class="rr_form_row">'; 449 $output .= ' <td class="rr_form_heading rr_required">Name</td>'; 450 $output .= ' <td class="rr_form_input"><input class="rr_small_input" type="text" name="rName" value="' . $rName . '" /></td>'; 451 $output .= ' </tr>'; 452 $output .= ' <tr class="rr_form_row">'; 453 $output .= ' <td class="rr_form_heading">Email</td>'; 454 $output .= ' <td class="rr_form_input"><input class="rr_small_input" type="text" name="rEmail" value="' . $rEmail . '" /></td>'; 455 $output .= ' </tr>'; 456 $output .= ' <tr class="rr_form_row">'; 457 $output .= ' <td class="rr_form_heading rr_required">Review Title</td>'; 458 $output .= ' <td class="rr_form_input"><input class="rr_small_input" type="text" name="rTitle" value="' . $rTitle . '" /></td>'; 459 $output .= ' </tr>'; 460 $output .= ' <tr class="rr_form_row">'; 461 $output .= ' <td class="rr_form_heading rr_required">Rating</td>'; 462 $output .= ' <td class="rr_form_input">' . $this->fp_star_rating_input() . '</td>'; 463 $output .= ' </tr>'; 464 $output .= ' <tr class="rr_form_row">'; 465 $output .= ' <td class="rr_form_heading rr_required">Review Content</td>'; 466 $output .= ' <td class="rr_form_input"><textarea class="rr_large_input" name="rText" rows="10">' . $rText . '</textarea></td>'; 467 $output .= ' </tr>'; 468 $output .= ' <tr class="rr_form_row">'; 469 $output .= ' <td></td>'; 470 $output .= ' <td class="rr_form_input rr_required"><input name="submitButton" type="submit" value="Submit Review" /></td>'; 471 $output .= ' </tr>'; 472 $output .= ' </table>'; 473 $output .= '</form>'; 556 474 } 557 475 return $output; … … 726 644 $rID = $review['idid']; 727 645 $rDateTime = $review['datetime']; 728 $rName = $this->fp_nice_output($review['reviewername'] );729 $rEmail = $this->fp_nice_output($review['revieweremail'] );730 $rTitle = $this->fp_nice_output($review['reviewtitle'] );646 $rName = $this->fp_nice_output($review['reviewername'], FALSE); 647 $rEmail = $this->fp_nice_output($review['revieweremail'], FALSE); 648 $rTitle = $this->fp_nice_output($review['reviewtitle'], FALSE); 731 649 $rRatingVal = max(1,intval($review['reviewrating'])); 732 650 $rText = $this->fp_nice_output($review['reviewtext']); … … 734 652 $rIP = $review['reviewerip']; 735 653 $rRating = ''; 654 736 655 for ($i=1; $i<=$rRatingVal; $i++) { 737 656 $rRating .= '★'; // orange star … … 742 661 743 662 $output = '<div class="testimonial"> 744 < span class="rr_title">' . $rTitle . '</span>663 <h3 class="rr_title">' . $rTitle . '</h3> 745 664 <div class="clear"></div> 746 < span class="stars">' . $rRating . '</span>665 <div class="stars">' . $rRating . '</div> 747 666 <div class="clear"></div>'; 748 667 $output .= '<div class="rr_review_text"><span class="drop_cap">“</span>' . $rText . '”</div>'; 749 $output .= '< span class="rr_review_name"> - ' . $rName . '</span>668 $output .= '<div class="rr_review_name"> - ' . $rName . '</div> 750 669 <div class="clear"></div>'; 751 670 $output .= '</div>'; … … 753 672 } 754 673 755 function fp_nice_output($input) { 756 return str_replace(array('\\', '/'), '', $input); 674 function fp_nice_output($input, $keep_breaks = TRUE) { 675 //echo '<pre>' . $input . '</pre>'; 676 //return str_replace(array('\\', '/'), '', $input); 677 if (strpos($input, '\r\n')) { 678 if ($keep_breaks) { 679 while (strpos($input, '\r\n\r\n\r\n')) { 680 // get rid of everything but single line breaks and pretend-paragraphs 681 $input = str_replace(array('\r\n\r\n\r\n'), '\r\n\r\n', $input); 682 } 683 $input = str_replace(array('\r\n'), '<br />', $input); 684 } else { 685 $input = str_replace(array('\r\n'), '', $input); 686 } 687 } 688 $input = str_replace(array('\\', '/'), '', $input); 689 690 return $input; 757 691 } 758 692
Note: See TracChangeset
for help on using the changeset viewer.