Plugin Directory

Changeset 2435527


Ignore:
Timestamp:
12/09/2020 02:17:19 PM (5 years ago)
Author:
guestapp
Message:

display public responses

Location:
guestapp
Files:
10 edited
11 copied

Legend:

Unmodified
Added
Removed
  • guestapp/tags/1.4.11/CGuestApp.php

    r2268051 r2435527  
    2121    function __construct($token = null) {
    2222        $this->APIPath = "https://wire.guest-suite.com/rest/reviews.json?";
    23         //$this->APIPath = "http://guestapp.dev/app_dev.php/rest/reviews.json?"; // DEBUG
    24         // Et quand je commit ici, ca casse probablement
    2523        $this->token = $token;
    2624    }
     
    8886
    8987        foreach ($json->reviews as $review) {
    90 
    9188            $data = array(
    9289                "id"                    => $review->id,
     
    296293
    297294        $data = array();
    298 
    299295        if ($this->token != null) {
    300296            $data['access_token'] = $this->token;
     
    303299
    304300        $query .= http_build_query($data);
    305 
    306301        // We need to use cURL here
    307302        // file_get_contents returns false, or null on any other code than HTTP 200
     
    314309        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    315310        $return = curl_exec($curl);
    316 
    317311        // The curl request has failed
    318312        if ($return === FALSE) {
  • guestapp/tags/1.4.11/README.txt

    r2320287 r2435527  
    44Requires at least: 3.1
    55Tested up to: 5.2
    6 Stable tag: 1.4.10
     6Stable tag: 1.4.11
    77Requires PHP: 5.2
    88License: GPLv2
  • guestapp/tags/1.4.11/guestapp-widget.php

    r2228979 r2435527  
    5858        $note   = (isset($instance['note'])     ? $instance['note']     : 'both');
    5959        $noavg  = (isset($instance['noavg'])    ? $instance['noavg']    : 'off');
    60         $rep    = (isset($instance['rep'])      ? $instance['rep']      : '0');
    6160
    6261        $data = array(
     
    8584            "noavgName"     => $this->get_field_name("noavg"),
    8685            "noavg"         => esc_attr($noavg),
    87             "repId"         => $this->get_field_id("rep"),
    88             "repName"       => $this->get_field_name("rep"),
    89             "rep"           => esc_attr($rep)
    9086        );
    9187
     
    108104        $instance['note']   = (isset($new_instance['note']  )) ? strip_tags($new_instance['note']  ) : '';
    109105        $instance['noavg']  = (isset($new_instance['noavg'] )) ? strip_tags($new_instance['noavg'] ) : '';
    110         $instance['rep']    = (isset($new_instance['rep'] ))   ? strip_tags($new_instance['rep'] ) : '';
    111106
    112107        // Inserting the instance => amount into the database
     
    127122
    128123        $this->insertWidgetProps("noavg", $instance['noavg'], $instance['number']);
    129 
    130         // Setting the widget responses Displays
    131         $this->insertWidgetProps("rep", $instance['rep'], $instance['number']);
    132 
    133124
    134125        return $instance;
     
    164155        if (GuestApp_Widget::$jsonCache === null) {
    165156            $returned = $wpdb->get_row("SELECT * FROM $wpdb->options WHERE option_name = 'guestapp_review_data';");
    166 
    167157            if (is_object($returned)) {
    168158                // If $returned is not an object, this probably means it's the first time we activate the plugin
     
    206196                "compact"=> $params["compact"],
    207197                "total"  => $total,
    208                 "counter"=> $counter,
    209                 "rep"    => $params["rep"]
     198                "counter"=> $counter
    210199            ));
    211200            $counter++;
     
    236225        $colorscheme = (!isset($instance['color']) ? get_option("guestapp_widget_" . $number . "_color") : $instance['color']);
    237226        $note        = (!isset($instance['note'])  ? get_option("guestapp_widget_" . $number . "_note")  : $instance['note']);
    238         $rep         = (!isset($instance['rep'])   ? get_option("guestapp_widget_" . $number . "_rep", "0")   : $instance['rep']);
    239227        $number      = ($number == null) ? GuestApp_Widget::$renderCounter : $number;
    240228
     
    243231
    244232        $noavg = $noavg == 'on' ? true : false; // Wordpress stores checkboxes as on/off
    245 
    246         $rep = $rep == 'on' ? true : false;
    247233
    248234        $hasErrors = false;
     
    281267                                                            "sidebar"=> $isSidebarWidget,
    282268                                                            "counter"=> GuestApp_Widget::$renderCounter,
    283                                                             "id"     => $id,
    284                                                             "rep"    => $rep
     269                                                            "id"     => $id
    285270                                                            ));
    286271
     
    321306                                                      "color"   => $colorscheme,
    322307                                                      "note"    => $note,
    323                                                       "rep"     => $rep,
    324308                                                      "sidebar" => !isset($instance["from_shortcode"])));
    325309        }
     
    397381        "compact" => false,
    398382        "color"   => 'light',
    399         "note"    => 'both',
    400         "rep"     => false
     383        "note"    => 'both'
    401384    );
    402385
     
    434417        'compact'           => $compact === "true" ? true : false,
    435418        'color'             => $color,
    436         'note'              => $note,
    437         'rep'               => $rep === "true" ? true : false
     419        'note'              => $note
    438420    );
    439421
  • guestapp/tags/1.4.11/guestapp.php

    r2320287 r2435527  
    55Plugin URI: https://wordpress.org/plugins/guestapp/
    66Description: Guest Suite Plugin
    7 Version: 1.4.10
     7Version: 1.4.11
    88Author: Guest Suite
    99Author URI: https://www.guest-suite.com
  • guestapp/tags/1.4.11/templates/widget.php

    r2239936 r2435527  
    159159            </div>
    160160
    161             <?php if($rep): ?>
    162                 <?php if (!empty($review["responses"])): ?>
    163                 <div class="ga-comment-full ga-review-response">
     161            <?php if (!empty($review["responses"])): ?>
     162            <div class="ga-comment-full ga-review-response">
     163                <br>
     164                <strong><?php _e("Réponse de l'établissement :", "guestapp") ?></strong>
     165                <p>
     166                    <?php echo $review["responses"]{0}->content ?>
    164167                    <br>
    165                     <strong><?php _e("Réponse de l'établissement :", "guestapp") ?></strong>
    166                     <p>
    167                         <?php echo $review["responses"]{0}->content ?>
    168                         <br>
    169                         <span class="ga-review-info">
    170                             <?php echo $review["responses"]{0}->datetime ?>
    171                         </span>
    172                     </p>
    173                 </div>
    174                 <?php endif ?>
     168                    <span class="ga-review-info">
     169                        <?php echo $review["responses"]{0}->datetime ?>
     170                    </span>
     171                </p>
     172            </div>
    175173            <?php endif ?>
    176174        </div>
  • guestapp/tags/1.4.11/templates/widget_settings.php

    r1771316 r2435527  
    1515        <option value="100" <?php echo ($amount == 100 ? "selected" : "") ?>><?php _e("100 reviews", "guestapp") ?></option>
    1616    </select><br>
    17 
    18     <label for="<?php echo $repIp ?>">
    19         <?php _e("View responses to reviews", 'guestapp') ?> :
    20     </label><br>
    21     <input type="radio" value="0" name="<?php echo $repName ?>" <?php echo ($rep == "1" ? "checked" : "") ?> ><?php _e("Yes", "guestapp") ?></input>
    22     <input type="radio" value="1" name="<?php echo $repName ?>" <?php echo ($rep == "0" ? "checked" : "") ?> ><?php _e("No", "guestapp") ?></input>
    23 
    2417
    2518    <label for="<?php echo $langId ?>">
  • guestapp/trunk/CGuestApp.php

    r2268051 r2435527  
    2121    function __construct($token = null) {
    2222        $this->APIPath = "https://wire.guest-suite.com/rest/reviews.json?";
    23         //$this->APIPath = "http://guestapp.dev/app_dev.php/rest/reviews.json?"; // DEBUG
    24         // Et quand je commit ici, ca casse probablement
    2523        $this->token = $token;
    2624    }
     
    8886
    8987        foreach ($json->reviews as $review) {
    90 
    9188            $data = array(
    9289                "id"                    => $review->id,
     
    296293
    297294        $data = array();
    298 
    299295        if ($this->token != null) {
    300296            $data['access_token'] = $this->token;
     
    303299
    304300        $query .= http_build_query($data);
    305 
    306301        // We need to use cURL here
    307302        // file_get_contents returns false, or null on any other code than HTTP 200
     
    314309        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    315310        $return = curl_exec($curl);
    316 
    317311        // The curl request has failed
    318312        if ($return === FALSE) {
  • guestapp/trunk/README.txt

    r2320287 r2435527  
    44Requires at least: 3.1
    55Tested up to: 5.2
    6 Stable tag: 1.4.10
     6Stable tag: 1.4.11
    77Requires PHP: 5.2
    88License: GPLv2
  • guestapp/trunk/guestapp-widget.php

    r2228979 r2435527  
    5858        $note   = (isset($instance['note'])     ? $instance['note']     : 'both');
    5959        $noavg  = (isset($instance['noavg'])    ? $instance['noavg']    : 'off');
    60         $rep    = (isset($instance['rep'])      ? $instance['rep']      : '0');
    6160
    6261        $data = array(
     
    8584            "noavgName"     => $this->get_field_name("noavg"),
    8685            "noavg"         => esc_attr($noavg),
    87             "repId"         => $this->get_field_id("rep"),
    88             "repName"       => $this->get_field_name("rep"),
    89             "rep"           => esc_attr($rep)
    9086        );
    9187
     
    108104        $instance['note']   = (isset($new_instance['note']  )) ? strip_tags($new_instance['note']  ) : '';
    109105        $instance['noavg']  = (isset($new_instance['noavg'] )) ? strip_tags($new_instance['noavg'] ) : '';
    110         $instance['rep']    = (isset($new_instance['rep'] ))   ? strip_tags($new_instance['rep'] ) : '';
    111106
    112107        // Inserting the instance => amount into the database
     
    127122
    128123        $this->insertWidgetProps("noavg", $instance['noavg'], $instance['number']);
    129 
    130         // Setting the widget responses Displays
    131         $this->insertWidgetProps("rep", $instance['rep'], $instance['number']);
    132 
    133124
    134125        return $instance;
     
    164155        if (GuestApp_Widget::$jsonCache === null) {
    165156            $returned = $wpdb->get_row("SELECT * FROM $wpdb->options WHERE option_name = 'guestapp_review_data';");
    166 
    167157            if (is_object($returned)) {
    168158                // If $returned is not an object, this probably means it's the first time we activate the plugin
     
    206196                "compact"=> $params["compact"],
    207197                "total"  => $total,
    208                 "counter"=> $counter,
    209                 "rep"    => $params["rep"]
     198                "counter"=> $counter
    210199            ));
    211200            $counter++;
     
    236225        $colorscheme = (!isset($instance['color']) ? get_option("guestapp_widget_" . $number . "_color") : $instance['color']);
    237226        $note        = (!isset($instance['note'])  ? get_option("guestapp_widget_" . $number . "_note")  : $instance['note']);
    238         $rep         = (!isset($instance['rep'])   ? get_option("guestapp_widget_" . $number . "_rep", "0")   : $instance['rep']);
    239227        $number      = ($number == null) ? GuestApp_Widget::$renderCounter : $number;
    240228
     
    243231
    244232        $noavg = $noavg == 'on' ? true : false; // Wordpress stores checkboxes as on/off
    245 
    246         $rep = $rep == 'on' ? true : false;
    247233
    248234        $hasErrors = false;
     
    281267                                                            "sidebar"=> $isSidebarWidget,
    282268                                                            "counter"=> GuestApp_Widget::$renderCounter,
    283                                                             "id"     => $id,
    284                                                             "rep"    => $rep
     269                                                            "id"     => $id
    285270                                                            ));
    286271
     
    321306                                                      "color"   => $colorscheme,
    322307                                                      "note"    => $note,
    323                                                       "rep"     => $rep,
    324308                                                      "sidebar" => !isset($instance["from_shortcode"])));
    325309        }
     
    397381        "compact" => false,
    398382        "color"   => 'light',
    399         "note"    => 'both',
    400         "rep"     => false
     383        "note"    => 'both'
    401384    );
    402385
     
    434417        'compact'           => $compact === "true" ? true : false,
    435418        'color'             => $color,
    436         'note'              => $note,
    437         'rep'               => $rep === "true" ? true : false
     419        'note'              => $note
    438420    );
    439421
  • guestapp/trunk/guestapp.php

    r2320287 r2435527  
    55Plugin URI: https://wordpress.org/plugins/guestapp/
    66Description: Guest Suite Plugin
    7 Version: 1.4.10
     7Version: 1.4.11
    88Author: Guest Suite
    99Author URI: https://www.guest-suite.com
  • guestapp/trunk/templates/widget.php

    r2239936 r2435527  
    159159            </div>
    160160
    161             <?php if($rep): ?>
    162                 <?php if (!empty($review["responses"])): ?>
    163                 <div class="ga-comment-full ga-review-response">
     161            <?php if (!empty($review["responses"])): ?>
     162            <div class="ga-comment-full ga-review-response">
     163                <br>
     164                <strong><?php _e("Réponse de l'établissement :", "guestapp") ?></strong>
     165                <p>
     166                    <?php echo $review["responses"]{0}->content ?>
    164167                    <br>
    165                     <strong><?php _e("Réponse de l'établissement :", "guestapp") ?></strong>
    166                     <p>
    167                         <?php echo $review["responses"]{0}->content ?>
    168                         <br>
    169                         <span class="ga-review-info">
    170                             <?php echo $review["responses"]{0}->datetime ?>
    171                         </span>
    172                     </p>
    173                 </div>
    174                 <?php endif ?>
     168                    <span class="ga-review-info">
     169                        <?php echo $review["responses"]{0}->datetime ?>
     170                    </span>
     171                </p>
     172            </div>
    175173            <?php endif ?>
    176174        </div>
  • guestapp/trunk/templates/widget_settings.php

    r1771316 r2435527  
    1515        <option value="100" <?php echo ($amount == 100 ? "selected" : "") ?>><?php _e("100 reviews", "guestapp") ?></option>
    1616    </select><br>
    17 
    18     <label for="<?php echo $repIp ?>">
    19         <?php _e("View responses to reviews", 'guestapp') ?> :
    20     </label><br>
    21     <input type="radio" value="0" name="<?php echo $repName ?>" <?php echo ($rep == "1" ? "checked" : "") ?> ><?php _e("Yes", "guestapp") ?></input>
    22     <input type="radio" value="1" name="<?php echo $repName ?>" <?php echo ($rep == "0" ? "checked" : "") ?> ><?php _e("No", "guestapp") ?></input>
    23 
    2417
    2518    <label for="<?php echo $langId ?>">
Note: See TracChangeset for help on using the changeset viewer.