Plugin Directory

Changeset 661474


Ignore:
Timestamp:
01/31/2013 02:09:49 AM (13 years ago)
Author:
FoxyTechnology
Message:

Updating to version 1.1

Location:
rich-reviews/trunk
Files:
3 edited

Legend:

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

    r658498 r661474  
    33Donate link: http://www.foxytechnology.com
    44Tags: reviews, review, testimonials, testimonial, hreview, rating, ratings, google, rich snippets, review widget, seo, shortcode, plugin, snippet, snippets
    5 Requires at least: 3.0.1
     5Requires at least: 3.4
    66Tested up to: 3.5
    7 Stable tag: 1.0
     7Stable tag: 1.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5050== Changelog ==
    5151
     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
    5259= 1.0 =
    5360* Initial release
     61
     62== Upgrade Notice ==
     63
     64= 1.1 =
     65This 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 =
     68Initial release
  • rich-reviews/trunk/rich-reviews.css

    r658488 r661474  
    11.testimonial {
    22    width:31%;
     3    min-width: 150px;
    34    height:auto;
    45    float: left;
    56    margin-right: 3.5%;
     7    margin-bottom: 5%;
    68}
    79.testimonial:last-child {
     
    2123    float:none;
    2224    clear:both;
    23 }
    24 
    25 .testimonial .stars {
    26     float:left !important;
    27     font-size:20px;
    2825}
    2926
     
    8885    border-collapse: collapse;
    8986}
     87.reviewform {
     88    display: block;
     89}
    9090.rr_action {
    9191    min-width: 80px;
     
    105105    vertical-align: text-top;
    106106}
    107 .rr_review_text {
    108 }
    109 .rr_all_review_text {
    110 }
     107
    111108.rr_star{
    112109    color: #ffaf00;
     
    114111.rr_small_input {
    115112    width: 250px;
    116     height: 20px;
     113    height: 1.1em;
     114    margin-bottom: 9px;
    117115}
    118116.rr_large_input {
    119117    width: 250px;
    120     height: 160px;
     118    height: 6em;
    121119    vertical-align: top;
     120    margin-bottom: 12px;
    122121}
    123122.rr_title {
    124     font-size: 120%;
     123    font-size: 130%;
    125124    font-weight: bold;
     125    line-height: 1em !important;
     126    text-transform: uppercase;
     127    margin-top: 3%;
     128    display: block;
    126129}
    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;
    130137}
     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  
    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.0
     6Version: 1.1
    77Author: Foxy Technology
    88Author URI: http://www.foxytechnology.com
     
    2828class FPRichReviews {
    2929    var $sqltable = 'richreviews';
     30    var $fp_admin_options = 'rr_admin_options';
    3031   
    3132    function FPRichReviews() {
     
    3536        add_action('init', array(&$this, 'fp_init'));
    3637        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);
    3740        add_shortcode('RICH_REVIEWS_FORM', array(&$this, 'fp_shortcode_reviews_form'));
    3841        add_shortcode('RICH_REVIEWS_SHOW', array(&$this, 'fp_shortcode_reviews_show'));
     
    4952            $this->fp_update_database();
    5053        }
     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() {
    51122        $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');
    52125        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__))));
    53131        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');
    54134        wp_enqueue_style('rich-reviews');
    55         wp_enqueue_script('rich-reviews');
    56135    }
    57136   
     
    75154                 review_status tinyint(1) DEFAULT '0',
    76155                 reviewer_ip varchar(15) DEFAULT NULL,
    77                 PRIMARY KEY (id)
     156                PRIMARY KEY (id) CHARACTER SET utf8 COLLATE utf8_general_ci
    78157        );";
    79158        dbDelta($sql);
    80159    }
    81160   
    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>';
    105180        if (isset($_POST['submitted'])) {
    106181            if ($_POST['submitted'] == 'Y') {
    107                 $sql = "SELECT 
     182                $sql = "SELECT
    108183                        id as `idid`,
    109184                        reviewer_name as `reviewername`,
     
    112187                foreach ($pendingIDs as $result) {
    113188                    $idid = $result['idid'];
    114                     $rName = $result['reviewername'];
    115                     $rIP = $result['reviewerip'];
    116                     $postName = 'updateStatus_' . $idid;
    117189                    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);
    124193                        }
    125194                    }
    126195                }
    127             echo '<br>';
    128             }
    129         }
    130         global $wpdb;
     196                $output .= '<br>';
     197            }
     198        }
    131199        $pendingReviewsCount = $wpdb->get_var("SELECT COUNT(*) FROM $this->sqltable WHERE review_status=\"0\"");
    132200        if ($pendingReviewsCount == 0) {
    133             echo '<p>There are no reviews pending approval.</p>';
     201            $output .= '<p>There are no reviews pending approval.</p>';
    134202        } else {
    135203            $sql = "SELECT id as `idid`,
     
    144212            $pendingReviews = $wpdb->get_results($sql, ARRAY_A);
    145213           
    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>';
    148219            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;
    153298    }
    154299   
     
    225370            <input type="hidden" name="submitted" value="Y" />
    226371            <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>
    236381            <div class="clear"></div>
    237382            <div class="left"><input name="submitButton" type="submit" value="Submit Review" /></div>
     
    269414                    reviewer_ip as `reviewerip` FROM $this->sqltable WHERE review_status=\"1\" LIMIT 3";
    270415            $results = $wpdb->get_results($sql, ARRAY_A);
    271             $output .= '<div>';
     416            $output .= '<div class="testimonial_group">';
    272417            foreach($results as $result) {
    273418                $output .= $this->fp_display_review($result);
    274419            }
    275             $output .= '</div>';
     420            $output .= '</div><div class="clear"></div>';
    276421        }
    277422       
     
    294439                    reviewer_ip as `reviewerip` FROM $this->sqltable WHERE review_status=\"1\"";
    295440            $results = $wpdb->get_results($sql, ARRAY_A);
    296             //$output .= '<span id="results">';
    297441            $ii = 0;
    298442            $output .= '<div class="testimonial_group">';
     
    302446                if (($ii % 3) == 0) {
    303447                    $output .= '</div><div class="clear"></div><div class="testimonial_group">';
    304                     //$output .= '<hr>';
    305448                }
    306449            }
    307             $output .= '</div>';
     450            $output .= '</div><div class="clear"></div>';
    308451        }
    309452        return $output;
     
    319462        }
    320463
    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') {
    326469        $rID        = $review['idid'];
    327470        $rDateTime  = $review['datetime'];
     
    340483            $rRating .= '&#9734'; // white star
    341484        }
     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        }
    342499        $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>';
    347505        return $output;
    348506    }
     
    370528            <div class="clear"></div>
    371529            <span class="stars">' . $rRating . '</span>
    372             <h3 class="left">' . $rName . '</h2>
    373530            <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>';
    375534        $output .= '</div>';
    376535        return $output;
    377536    }
     537   
    378538    function fp_nice_output($input) {
    379539        return str_replace(array('\\', '/'), '', $input);
Note: See TracChangeset for help on using the changeset viewer.