Changeset 1244784
- Timestamp:
- 09/14/2015 04:10:02 AM (10 years ago)
- Location:
- track-connect/trunk
- Files:
-
- 4 edited
-
includes/api/request.php (modified) (1 diff)
-
includes/views/archive-listing.php (modified) (3 diffs)
-
plugin.php (modified) (2 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
track-connect/trunk/includes/api/request.php
r1243633 r1244784 230 230 231 231 $unitArray = []; 232 foreach(json_decode($units['body'])->response as $unit){ 233 $query = $wpdb->get_row("SELECT post_id FROM wp_postmeta WHERE meta_key = '_listing_unit_id' AND meta_value = '".$unit."' LIMIT 1; "); 232 233 if(json_decode($units['body'])->success == false){ 234 return [ 235 'success' => false, 236 'message' => json_decode($units['body'])->message 237 ]; 238 } 239 foreach(json_decode($units['body'])->response->available as $cid=>$avgRate){ 240 $query = $wpdb->get_row("SELECT post_id FROM wp_postmeta WHERE meta_key = '_listing_unit_id' AND meta_value = '".$cid."' LIMIT 1; "); 234 241 $unitArray[] = $query->post_id; 235 236 } 237 238 return $unitArray; 242 $rateArray[$cid] = $avgRate; 243 244 } 245 246 return [ 247 'success' => true, 248 'units' => $unitArray, 249 'rates' => $rateArray 250 ]; 239 251 } 240 252 -
track-connect/trunk/includes/views/archive-listing.php
r1240960 r1244784 113 113 $count = 0; // start counter at 0 114 114 $unitsAvailable = true; 115 116 if($checkAvailability && !count($availableUnits)){117 echo '<div align="center" style="padding:25px;"> No units are available from '. date('m/d/Y', strtotime($checkin)) . ' to ' . date('m/d/Y', strtotime($checkout)). '.</div>';115 116 if($checkAvailability && $availableUnits['success'] == false){ 117 echo '<div align="center" style="padding:25px;">'.$availableUnits['message'].'</div>'; 118 118 $unitsAvailable = false; 119 119 } 120 120 121 $avgRates = null; 122 $avgRates = $availableUnits['rates']; 123 121 124 // Start the Loop. 122 125 $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; … … 142 145 } 143 146 if($checkAvailability){ 144 $args += array('post__in' => $availableUnits );147 $args += array('post__in' => $availableUnits['units']); 145 148 } 146 149 if(get_query_var('status') != ''){ … … 216 219 $loop .= sprintf( '<div class="listing-thumb-meta">' ); 217 220 218 if ( '' != get_post_meta( $post->ID, '_listing_min_rate', true ) ) { 219 $loop .= sprintf( '<span class="listing-property-type">%s</span>', 'starting at' ); 221 if ( $avgRates[$unitId] > 0 ) { 222 $loop .= sprintf( '<span class="listing-property-type">%s</span>', 'avg. rate' ); 223 $loop .= sprintf( '<span class="listing-price">$%s/night</span>', number_format($avgRates[$unitId],0) ); 224 }else{ 225 $loop .= sprintf( '<span class="listing-property-type">%s</span>', 'starting at' ); 220 226 $loop .= sprintf( '<span class="listing-price">$%s/night</span>', number_format(get_post_meta( $post->ID, '_listing_min_rate', true ),0) ); 221 227 } -
track-connect/trunk/plugin.php
r1243633 r1244784 7 7 Author URI: http://www.trackhs.com 8 8 9 Version: 1. 6.99 Version: 1.7 10 10 11 11 License: GNU General Public License v2.0 (or later) … … 55 55 56 56 define( 'WP_LISTINGS_URL', plugin_dir_url( __FILE__ ) ); 57 define( 'WP_LISTINGS_VERSION', '1. 6.9' );57 define( 'WP_LISTINGS_VERSION', '1.7' ); 58 58 59 59 /** Load textdomain for translation */ -
track-connect/trunk/readme.txt
r1243633 r1244784 4 4 Requires at least: 3.7 5 5 Tested up to: 4.2.3 6 Stable tag: 1. 6.96 Stable tag: 1.7 7 7 8 8 Creates and syncs listing-type posts from TRACK PM, a cloud-based property management system (www.trackhs.com).
Note: See TracChangeset
for help on using the changeset viewer.