Plugin Directory

Changeset 765228


Ignore:
Timestamp:
08/31/2013 09:14:48 PM (13 years ago)
Author:
FoxyTechnology
Message:

pushing version 1.4

Location:
rich-reviews/trunk
Files:
12 added
2 edited

Legend:

Unmodified
Added
Removed
  • rich-reviews/trunk/readme.txt

    r665820 r765228  
    44Tags: reviews, review, testimonials, testimonial, hreview, rating, ratings, google, rich snippets, review widget, seo, shortcode, plugin, snippet, snippets
    55Requires at least: 3.4
    6 Tested up to: 3.5
    7 Stable tag: 1.3
     6Tested up to: 3.6
     7Stable tag: 1.4
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5252== Changelog ==
    5353
     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
    5461= 1.3 =
    5562* 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  
    44Plugin URI: http://www.foxytechnology.com/rich-reviews-wordpress-plugin/
    55Description: 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.3
     6Version: 1.4
    77Author: Foxy Technology
    88Author URI: http://www.foxytechnology.com
     
    7070            array(&$this, 'fp_render_settings_main_page'),
    7171            plugin_dir_url( __FILE__ ) . 'fox_logo_16x16.png',
    72             '25.11111111'
     72            '25.11'
    7373        );
    7474        add_submenu_page(
     
    137137    function fp_load_scripts_styles() {
    138138        $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'));
    140140        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');
    142142        wp_enqueue_style('rich-reviews');
    143143    }
     
    145145    function fp_load_admin_scripts_styles() {
    146146        $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'));
    148148        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');
    150150        wp_enqueue_style('rich-reviews');
    151151    }
     
    297297   
    298298    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>';
    361309    }
    362310   
    363311    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>';
    425322    }
    426323   
     
    449346   
    450347    function fp_star_rating_input() {
    451         $output = '
     348        /*$output = '
    452349            <span onmouseover="this.style.cursor=\'default\';">
    453350              <span id="s1" onclick="starSelection(this.id);"onmouseout="outStar(this.id);"onmouseover="overStar(this.id);">&#9734</span>
     
    456353              <span id="s4" onclick="starSelection(this.id);"onmouseout="outStar(this.id);"onmouseover="overStar(this.id);">&#9734</span>
    457354              <span id="s5" onclick="starSelection(this.id);"onmouseout="outStar(this.id);"onmouseover="overStar(this.id);">&#9734</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>';
    459363        return $output;
    460364    }
     
    538442        }
    539443        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>';
    556474        }
    557475        return $output;
     
    726644        $rID        = $review['idid'];
    727645        $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);
    731649        $rRatingVal = max(1,intval($review['reviewrating']));
    732650        $rText      = $this->fp_nice_output($review['reviewtext']);
     
    734652        $rIP        = $review['reviewerip'];
    735653        $rRating = '';
     654
    736655        for ($i=1; $i<=$rRatingVal; $i++) {
    737656            $rRating .= '&#9733'; // orange star
     
    742661       
    743662        $output = '<div class="testimonial">
    744             <span class="rr_title">' . $rTitle . '</span>
     663            <h3 class="rr_title">' . $rTitle . '</h3>
    745664            <div class="clear"></div>
    746             <span class="stars">' . $rRating . '</span>
     665            <div class="stars">' . $rRating . '</div>
    747666            <div class="clear"></div>';
    748667        $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>
    750669            <div class="clear"></div>';
    751670        $output .= '</div>';
     
    753672    }
    754673   
    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;
    757691    }
    758692   
Note: See TracChangeset for help on using the changeset viewer.