Changeset 2182261
- Timestamp:
- 10/29/2019 12:54:32 PM (6 years ago)
- Location:
- xamoom/trunk
- Files:
-
- 4 edited
-
public/class-xamoom-public.php (modified) (4 diffs)
-
public/css/xamoom-public.css (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
xamoom.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
xamoom/trunk/public/class-xamoom-public.php
r2168056 r2182261 114 114 $style = false; 115 115 $custom_map_marker = false; 116 if($content['data']['relationships']['system']['data']['id']) { 116 117 // HANDLE ERROR 118 if(array_key_exists('errors', $content) && $content['errors']) { 119 $errCode = $content['errors'][0]['code']; 120 if ($errCode == 92 || $errCode == 93) { // password protected or spot only 121 $html = '<div class="not-available-content"><i class="fa fa-lock"></i><span>This content is password protected<span></div>'; 122 return $html; 123 } else { // any other error 124 return ''; 125 } 126 } 127 128 if(array_key_exists('data', $content) && $content['data']['relationships']['system']['data']['id']) { 117 129 $styles = $this->call_api($this->api_endpoint . "styles/" . $content['data']['relationships']['system']['data']['id']); 118 130 … … 401 413 //get spot map 402 414 $cursor = ""; 415 $total_num_results = 0; 403 416 $has_more = true; 404 417 $spot_map = array('items' => array()); 405 418 while($has_more){ 406 $spot_map_response = $this->call_api($this->api_endpoint . "spots?filter[tags]=[\"" . implode("\",\"", $block['spot-map-tags']) . "\"]&page[cursor]=" . $cursor . "&filter[has-location]=true&&page[size]=100&lang=" . $lang); 419 $api = $this->encodeURI($this->api_endpoint . "spots?filter[tags]=[\"" . implode("\",\"", $block['spot-map-tags']) . "\"]&page[cursor]=" . $cursor . "&filter[has-location]=true&page[size]=100&lang=" . $lang); 420 $spot_map_response = $this->call_api($api); 407 421 $resp = json_decode($spot_map_response, true); 408 $spot_map['items'] = array_merge($spot_map['items'], $resp['data']); 409 422 if ($resp['data']) { 423 $spot_map['items'] = array_merge($spot_map['items'], $resp['data']); 424 } 425 $total_num_results = $resp['meta']['total']; 410 426 $cursor = $resp['meta']['cursor']; 411 427 $has_more = $resp['meta']['has-more']; … … 435 451 436 452 //render marker script 437 for($j = 0; $j < count($spot_map['items']); $j++){453 for($j = 0; $j < $total_num_results; $j++){ 438 454 $marker = $spot_map['items'][$j]['attributes']; 439 455 … … 532 548 */ 533 549 public function call_api($url){ 550 $header = array('headers' => array( 'ApiKey' => get_option('xamoom_api_key'), 'X-Reason' => 2, 'user-agent' => 'xamoom wordpress plugin' )); 534 551 $result = wp_remote_get( $url , array('headers' => array( 'ApiKey' => get_option('xamoom_api_key'), 'X-Reason' => 2, 'user-agent' => 'xamoom wordpress plugin' ) )); 535 552 return wp_remote_retrieve_body($result); 536 553 } 537 554 555 /** 556 * encodes special characters in uri 557 */ 558 public function encodeURI($uri) 559 { 560 return preg_replace_callback("{[^0-9a-z_.!~*'();,/?:@&=+$#-]}i", function ($m) { 561 return sprintf('%%%02X', ord($m[0])); 562 }, $uri); 538 563 } 564 565 } -
xamoom/trunk/public/css/xamoom-public.css
r2168056 r2182261 213 213 height: 20px; 214 214 } 215 216 .not-available-content { 217 font-size: 24px; 218 text-align: center; 219 color: #888888; 220 margin: 70px 0px 70px 0px !important; 221 } 222 223 .not-available-content i { 224 margin-right: 10px; 225 } -
xamoom/trunk/readme.txt
r2168056 r2182261 3 3 Tags: CMS, Location Based Service, Mobile Marketing, NFC, QR, iBeacon 4 4 Requires at least: 4.5 5 Tested up to: 5. 1.15 Tested up to: 5.2.4 6 6 Requires PHP: 5.2.4 7 Stable tag: 3. 0.17 Stable tag: 3.1.0 8 8 9 9 The connection between the xamoom CMS and WordPress. Use your great mobile content also on the desktop. … … 43 43 44 44 == Changelog == 45 = 3.1 = 46 * Fixed rare issue involving maps not loading. 47 * Content using security package is now better visualized. 48 45 49 = 3.0 = 46 50 *Added new download type GPX. -
xamoom/trunk/xamoom.php
r2168056 r2182261 37 37 * Plugin URI: http://xamoom.com 38 38 * Description: This plugin allows you to sync xamoom pages to Wordpress 39 * Version: 3. 0.139 * Version: 3.1.0 40 40 * Author: xamoom GmbH 41 41 * Author URI: http://xamoom.com/
Note: See TracChangeset
for help on using the changeset viewer.