Changeset 2435527
- Timestamp:
- 12/09/2020 02:17:19 PM (5 years ago)
- Location:
- guestapp
- Files:
-
- 10 edited
- 11 copied
-
tags/1.4.11 (copied) (copied from guestapp/trunk)
-
tags/1.4.11/CGuestApp.php (modified) (5 diffs)
-
tags/1.4.11/README.txt (copied) (copied from guestapp/trunk/README.txt) (1 diff)
-
tags/1.4.11/guestapp-widget.php (modified) (12 diffs)
-
tags/1.4.11/guestapp.php (copied) (copied from guestapp/trunk/guestapp.php) (1 diff)
-
tags/1.4.11/lang/en_EN.po (copied) (copied from guestapp/trunk/lang/en_EN.po)
-
tags/1.4.11/lang/fr_FR.po (copied) (copied from guestapp/trunk/lang/fr_FR.po)
-
tags/1.4.11/lang/guestapp-en_GB.mo (copied) (copied from guestapp/trunk/lang/guestapp-en_GB.mo)
-
tags/1.4.11/lang/guestapp-en_US.mo (copied) (copied from guestapp/trunk/lang/guestapp-en_US.mo)
-
tags/1.4.11/lang/guestapp-es_ES.mo (copied) (copied from guestapp/trunk/lang/guestapp-es_ES.mo)
-
tags/1.4.11/lang/guestapp-fr_FR.mo (copied) (copied from guestapp/trunk/lang/guestapp-fr_FR.mo)
-
tags/1.4.11/styles/style.css (copied) (copied from guestapp/trunk/styles/style.css)
-
tags/1.4.11/templates/widget-overview.php (copied) (copied from guestapp/trunk/templates/widget-overview.php)
-
tags/1.4.11/templates/widget.php (modified) (1 diff)
-
tags/1.4.11/templates/widget_settings.php (modified) (1 diff)
-
trunk/CGuestApp.php (modified) (5 diffs)
-
trunk/README.txt (modified) (1 diff)
-
trunk/guestapp-widget.php (modified) (12 diffs)
-
trunk/guestapp.php (modified) (1 diff)
-
trunk/templates/widget.php (modified) (1 diff)
-
trunk/templates/widget_settings.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
guestapp/tags/1.4.11/CGuestApp.php
r2268051 r2435527 21 21 function __construct($token = null) { 22 22 $this->APIPath = "https://wire.guest-suite.com/rest/reviews.json?"; 23 //$this->APIPath = "http://guestapp.dev/app_dev.php/rest/reviews.json?"; // DEBUG24 // Et quand je commit ici, ca casse probablement25 23 $this->token = $token; 26 24 } … … 88 86 89 87 foreach ($json->reviews as $review) { 90 91 88 $data = array( 92 89 "id" => $review->id, … … 296 293 297 294 $data = array(); 298 299 295 if ($this->token != null) { 300 296 $data['access_token'] = $this->token; … … 303 299 304 300 $query .= http_build_query($data); 305 306 301 // We need to use cURL here 307 302 // file_get_contents returns false, or null on any other code than HTTP 200 … … 314 309 curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); 315 310 $return = curl_exec($curl); 316 317 311 // The curl request has failed 318 312 if ($return === FALSE) { -
guestapp/tags/1.4.11/README.txt
r2320287 r2435527 4 4 Requires at least: 3.1 5 5 Tested up to: 5.2 6 Stable tag: 1.4.1 06 Stable tag: 1.4.11 7 7 Requires PHP: 5.2 8 8 License: GPLv2 -
guestapp/tags/1.4.11/guestapp-widget.php
r2228979 r2435527 58 58 $note = (isset($instance['note']) ? $instance['note'] : 'both'); 59 59 $noavg = (isset($instance['noavg']) ? $instance['noavg'] : 'off'); 60 $rep = (isset($instance['rep']) ? $instance['rep'] : '0');61 60 62 61 $data = array( … … 85 84 "noavgName" => $this->get_field_name("noavg"), 86 85 "noavg" => esc_attr($noavg), 87 "repId" => $this->get_field_id("rep"),88 "repName" => $this->get_field_name("rep"),89 "rep" => esc_attr($rep)90 86 ); 91 87 … … 108 104 $instance['note'] = (isset($new_instance['note'] )) ? strip_tags($new_instance['note'] ) : ''; 109 105 $instance['noavg'] = (isset($new_instance['noavg'] )) ? strip_tags($new_instance['noavg'] ) : ''; 110 $instance['rep'] = (isset($new_instance['rep'] )) ? strip_tags($new_instance['rep'] ) : '';111 106 112 107 // Inserting the instance => amount into the database … … 127 122 128 123 $this->insertWidgetProps("noavg", $instance['noavg'], $instance['number']); 129 130 // Setting the widget responses Displays131 $this->insertWidgetProps("rep", $instance['rep'], $instance['number']);132 133 124 134 125 return $instance; … … 164 155 if (GuestApp_Widget::$jsonCache === null) { 165 156 $returned = $wpdb->get_row("SELECT * FROM $wpdb->options WHERE option_name = 'guestapp_review_data';"); 166 167 157 if (is_object($returned)) { 168 158 // If $returned is not an object, this probably means it's the first time we activate the plugin … … 206 196 "compact"=> $params["compact"], 207 197 "total" => $total, 208 "counter"=> $counter, 209 "rep" => $params["rep"] 198 "counter"=> $counter 210 199 )); 211 200 $counter++; … … 236 225 $colorscheme = (!isset($instance['color']) ? get_option("guestapp_widget_" . $number . "_color") : $instance['color']); 237 226 $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']);239 227 $number = ($number == null) ? GuestApp_Widget::$renderCounter : $number; 240 228 … … 243 231 244 232 $noavg = $noavg == 'on' ? true : false; // Wordpress stores checkboxes as on/off 245 246 $rep = $rep == 'on' ? true : false;247 233 248 234 $hasErrors = false; … … 281 267 "sidebar"=> $isSidebarWidget, 282 268 "counter"=> GuestApp_Widget::$renderCounter, 283 "id" => $id, 284 "rep" => $rep 269 "id" => $id 285 270 )); 286 271 … … 321 306 "color" => $colorscheme, 322 307 "note" => $note, 323 "rep" => $rep,324 308 "sidebar" => !isset($instance["from_shortcode"]))); 325 309 } … … 397 381 "compact" => false, 398 382 "color" => 'light', 399 "note" => 'both', 400 "rep" => false 383 "note" => 'both' 401 384 ); 402 385 … … 434 417 'compact' => $compact === "true" ? true : false, 435 418 'color' => $color, 436 'note' => $note, 437 'rep' => $rep === "true" ? true : false 419 'note' => $note 438 420 ); 439 421 -
guestapp/tags/1.4.11/guestapp.php
r2320287 r2435527 5 5 Plugin URI: https://wordpress.org/plugins/guestapp/ 6 6 Description: Guest Suite Plugin 7 Version: 1.4.1 07 Version: 1.4.11 8 8 Author: Guest Suite 9 9 Author URI: https://www.guest-suite.com -
guestapp/tags/1.4.11/templates/widget.php
r2239936 r2435527 159 159 </div> 160 160 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 ?> 164 167 <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> 175 173 <?php endif ?> 176 174 </div> -
guestapp/tags/1.4.11/templates/widget_settings.php
r1771316 r2435527 15 15 <option value="100" <?php echo ($amount == 100 ? "selected" : "") ?>><?php _e("100 reviews", "guestapp") ?></option> 16 16 </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 24 17 25 18 <label for="<?php echo $langId ?>"> -
guestapp/trunk/CGuestApp.php
r2268051 r2435527 21 21 function __construct($token = null) { 22 22 $this->APIPath = "https://wire.guest-suite.com/rest/reviews.json?"; 23 //$this->APIPath = "http://guestapp.dev/app_dev.php/rest/reviews.json?"; // DEBUG24 // Et quand je commit ici, ca casse probablement25 23 $this->token = $token; 26 24 } … … 88 86 89 87 foreach ($json->reviews as $review) { 90 91 88 $data = array( 92 89 "id" => $review->id, … … 296 293 297 294 $data = array(); 298 299 295 if ($this->token != null) { 300 296 $data['access_token'] = $this->token; … … 303 299 304 300 $query .= http_build_query($data); 305 306 301 // We need to use cURL here 307 302 // file_get_contents returns false, or null on any other code than HTTP 200 … … 314 309 curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); 315 310 $return = curl_exec($curl); 316 317 311 // The curl request has failed 318 312 if ($return === FALSE) { -
guestapp/trunk/README.txt
r2320287 r2435527 4 4 Requires at least: 3.1 5 5 Tested up to: 5.2 6 Stable tag: 1.4.1 06 Stable tag: 1.4.11 7 7 Requires PHP: 5.2 8 8 License: GPLv2 -
guestapp/trunk/guestapp-widget.php
r2228979 r2435527 58 58 $note = (isset($instance['note']) ? $instance['note'] : 'both'); 59 59 $noavg = (isset($instance['noavg']) ? $instance['noavg'] : 'off'); 60 $rep = (isset($instance['rep']) ? $instance['rep'] : '0');61 60 62 61 $data = array( … … 85 84 "noavgName" => $this->get_field_name("noavg"), 86 85 "noavg" => esc_attr($noavg), 87 "repId" => $this->get_field_id("rep"),88 "repName" => $this->get_field_name("rep"),89 "rep" => esc_attr($rep)90 86 ); 91 87 … … 108 104 $instance['note'] = (isset($new_instance['note'] )) ? strip_tags($new_instance['note'] ) : ''; 109 105 $instance['noavg'] = (isset($new_instance['noavg'] )) ? strip_tags($new_instance['noavg'] ) : ''; 110 $instance['rep'] = (isset($new_instance['rep'] )) ? strip_tags($new_instance['rep'] ) : '';111 106 112 107 // Inserting the instance => amount into the database … … 127 122 128 123 $this->insertWidgetProps("noavg", $instance['noavg'], $instance['number']); 129 130 // Setting the widget responses Displays131 $this->insertWidgetProps("rep", $instance['rep'], $instance['number']);132 133 124 134 125 return $instance; … … 164 155 if (GuestApp_Widget::$jsonCache === null) { 165 156 $returned = $wpdb->get_row("SELECT * FROM $wpdb->options WHERE option_name = 'guestapp_review_data';"); 166 167 157 if (is_object($returned)) { 168 158 // If $returned is not an object, this probably means it's the first time we activate the plugin … … 206 196 "compact"=> $params["compact"], 207 197 "total" => $total, 208 "counter"=> $counter, 209 "rep" => $params["rep"] 198 "counter"=> $counter 210 199 )); 211 200 $counter++; … … 236 225 $colorscheme = (!isset($instance['color']) ? get_option("guestapp_widget_" . $number . "_color") : $instance['color']); 237 226 $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']);239 227 $number = ($number == null) ? GuestApp_Widget::$renderCounter : $number; 240 228 … … 243 231 244 232 $noavg = $noavg == 'on' ? true : false; // Wordpress stores checkboxes as on/off 245 246 $rep = $rep == 'on' ? true : false;247 233 248 234 $hasErrors = false; … … 281 267 "sidebar"=> $isSidebarWidget, 282 268 "counter"=> GuestApp_Widget::$renderCounter, 283 "id" => $id, 284 "rep" => $rep 269 "id" => $id 285 270 )); 286 271 … … 321 306 "color" => $colorscheme, 322 307 "note" => $note, 323 "rep" => $rep,324 308 "sidebar" => !isset($instance["from_shortcode"]))); 325 309 } … … 397 381 "compact" => false, 398 382 "color" => 'light', 399 "note" => 'both', 400 "rep" => false 383 "note" => 'both' 401 384 ); 402 385 … … 434 417 'compact' => $compact === "true" ? true : false, 435 418 'color' => $color, 436 'note' => $note, 437 'rep' => $rep === "true" ? true : false 419 'note' => $note 438 420 ); 439 421 -
guestapp/trunk/guestapp.php
r2320287 r2435527 5 5 Plugin URI: https://wordpress.org/plugins/guestapp/ 6 6 Description: Guest Suite Plugin 7 Version: 1.4.1 07 Version: 1.4.11 8 8 Author: Guest Suite 9 9 Author URI: https://www.guest-suite.com -
guestapp/trunk/templates/widget.php
r2239936 r2435527 159 159 </div> 160 160 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 ?> 164 167 <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> 175 173 <?php endif ?> 176 174 </div> -
guestapp/trunk/templates/widget_settings.php
r1771316 r2435527 15 15 <option value="100" <?php echo ($amount == 100 ? "selected" : "") ?>><?php _e("100 reviews", "guestapp") ?></option> 16 16 </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 24 17 25 18 <label for="<?php echo $langId ?>">
Note: See TracChangeset
for help on using the changeset viewer.