Changeset 714737
- Timestamp:
- 05/18/2013 05:11:45 AM (13 years ago)
- Location:
- soldpress/branches/0.9.5A
- Files:
-
- 4 edited
-
adapter.php (modified) (2 diffs)
-
settings.php (modified) (5 diffs)
-
single-sp_property-t2.php (modified) (13 diffs)
-
soldpress.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
soldpress/branches/0.9.5A/adapter.php
r712951 r714737 263 263 $listingKey = $listing->post_name; 264 264 if($listingKey){ //If Someone manually adds a listing the key is wrong 265 if($meta) 266 { 267 $this->WriteLog('Photo Record is Synced' .$meta . 'listingkey' .$listingKey ); 268 }else 265 if($meta) 266 { 267 //$this->WriteLog('Photo Record is Synced' .$meta . 'listingkey' .$listingKey ); 268 }else 269 { 270 271 $this->WriteLog('Meta' .$meta . 'listingkey' .$listingKey ); 272 $this->WriteLog('Begin Picture Sync' . $post_id ); 273 $this->sync_propertyobject($listingKey, 'Photo',$post_id); 274 update_post_meta($post_id,'sc-sync-picture', true); 275 276 } 277 } 278 279 $metaagent = get_post_meta( $post_id ,'sc-sync-picture-agent',true); 280 $metaagent = false; 281 if(!$metaagent) 269 282 { 270 271 $this->WriteLog('Meta' .$meta . 'listingkey' .$listingKey ); 272 $this->WriteLog('Begin Picture Sync' . $post_id ); 273 $this->sync_propertyobject($listingKey, 'Photo',$post_id); 274 update_post_meta($post_id,'sc-sync-picture', true); 283 //List Agent 284 285 $agentKey = get_post_meta( $post_id ,'dfd_ListAgentKey',true); 286 $this->WriteLog('Begin Agent Picture Sync' . $post_id . 'AgentKey' . $agentKey); 287 $this->sync_agentobject($agentKey, 'ThumbnailPhoto',$post_id,'agent'); 288 289 //Co Agent 290 $coagentKey = get_post_meta( $post_id ,'dfd_CoListAgentKey',true); 291 if($coagentKey != "") 292 { 293 $this->WriteLog('Begin CoAgent Picture Sync' . $post_id . 'CoAgentKey' . $coagentKey); 294 $this->sync_agentobject($coagentKey, 'ThumbnailPhoto',$post_id,'coagent'); 295 update_post_meta($post_id,'sc-sync-picture-agent', true,'coagent'); 296 } 297 298 } 275 299 276 } 300 $metaoffice = get_post_meta( $post_id ,'sc-sync-picture-office',true); 301 $metaoffice = false; 302 if(!$metaoffice) 303 { 304 //List Agent 305 306 $officeKey = get_post_meta( $post_id ,'dfd_ListOfficeKey',true); 307 $this->WriteLog('Begin Office Picture Sync' . $post_id . 'AgentKey' . $officeKey); 308 $this->sync_listingobject($officeKey, 'ThumbnailPhoto',$post_id,'office'); 309 277 310 } 278 311 } … … 331 364 } 332 365 366 public function sync_agentobject($id, $type, $post_id,$metatype) 367 { 368 $record = $this->service->GetObject("Agent", $type, $id); 369 foreach($record as &$image) 370 { 371 $filename = $id .'-agent-' . $type . '.jpg'; 372 $wp_upload_dir = wp_upload_dir(); 373 $filePath = $wp_upload_dir['basedir']. '/soldpress/'.$filename; 374 file_put_contents($filePath,$image["Data"]); //We Change This In Settings 375 update_post_meta($post_id,'sc-sync-picture-'.$metatype.'-file', $filename); 376 } 377 378 return true; 379 } 380 381 public function sync_listingobject($id, $type, $post_id) 382 { 383 $record = $this->service->GetObject("Office", $type, $id); 384 foreach($record as &$image) 385 { 386 $filename = $id .'-listing-' . $type . '.jpg'; 387 $wp_upload_dir = wp_upload_dir(); 388 $filePath = $wp_upload_dir['basedir']. '/soldpress/'.$filename; 389 file_put_contents($filePath,$image["Data"]); //We Change This In Settings 390 update_post_meta($post_id,'sc-sync-picture-listing-file', $filename); 391 } 392 393 return true; 394 } 395 333 396 public function searchresidentialproperty($crit, $template, $culture) 334 397 { -
soldpress/branches/0.9.5A/settings.php
r712951 r714737 125 125 echo '<tr>'; 126 126 //echo '<th scope="row" class="check-column"><input type="checkbox" name="schedules[]" class="entries" value="1"></th>'; 127 echo '<td><strong>'.$job.'</strong><div class="row-actions" style="margin:0; padding:0;"><a href="/wp-admin/options-general.php?page=soldpress&tab=sync_options&spa=runevt&job='.$job.'">Run Now</a> || <a href="/wp-admin/options-general.php?page=soldpress&tab=sync_options">Disable</a></div></td>';127 echo '<td><strong>'.$job.'</strong><div class="row-actions" style="margin:0; padding:0;"><a href="/wp-admin/options-general.php?page=soldpress&tab=sync_options&spa=runevt&job='.$job.'">Run Now</a></div></td>'; 128 128 echo '<td>'.date("r", $key).'</td>'; 129 129 $schedule = $value[key($value)]; … … 150 150 <?php if( $active_tab == 'debug_options' ) { ?> 151 151 <h3 class="title">Log File</h3> 152 <a target="_blank" href=" /wp-content/uploads/soldpress/soldpress-log.txt">debug log</a>152 <a target="_blank" href="wp-content/uploads/soldpress/soldpress-log.txt">debug log</a> 153 153 <h3 class="title">Debug</h3> 154 154 <div class = "postbox"> … … 184 184 <?php submit_button('Manual Sync', 'secondary', 'sync', false); ?> 185 185 <?php submit_button('Clear Listings', 'secondary', 'delete', false); ?> 186 <?php submit_button('Delete Log', 'secondary', 'deletelog', false); ?> 186 187 </form> 187 188 <?php if (get_option('sc-status' ) == true) { ?> … … 202 203 <div>© 2013 Sanskript Solution, Inc.</div> 203 204 </p> 204 205 205 206 <?php 206 207 //Process Get Actions First … … 248 249 } 249 250 251 if (isset($_POST["deletelog"])) { 252 $wp_upload_dir = wp_upload_dir(); 253 unlink($wp_upload_dir['basedir']. '/soldpress/soldpress-log.txt'); 254 } 255 250 256 if (isset($_POST["delete"])) { 251 257 $mycustomposts = get_posts( array( 'post_type' => 'sp_property', 'numberposts' => 500) ); -
soldpress/branches/0.9.5A/single-sp_property-t2.php
r714386 r714737 11 11 '2.3.1', 12 12 true); 13 13 14 wp_enqueue_script( 14 15 'jquery.cycle2', … … 98 99 99 100 .container-fluid { 100 padding-right: 0px;101 padding-left: 0px;102 }101 padding-right: 0px; 102 padding-left: 0px; 103 } 103 104 104 105 .cycle-prev, .cycle-next { position: absolute; top: 0; width: 30%; opacity: 0; filter: alpha(opacity=0); z-index: 800; height: 100%; cursor: pointer; } … … 110 111 </style> 111 112 <h2><?php the_title(); ?></h2> 112 <div class="well2">113 <div class="cycle-slideshow" data-cycle-fx="carousel" data-cycle-timeout="2000">113 <div class="well2"> 114 <div class="cycle-slideshow" data-cycle-fx="carousel" data-cycle-timeout="2000"> 114 115 <div class="cycle-prev"></div> 115 116 <div class="cycle-next"></div> 116 <?php 117 $photos = get_children( array('post_parent' => get_the_ID(), 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID') ); 118 if($photos){ 119 foreach ($photos as $photo) { 120 echo '<image src="' . wp_get_attachment_url($photo->ID,'thumbnail') . '">'; 121 } 122 } 123 ?> 124 </div> 125 <div class="well3"> 126 <div class="row"> 127 <div class="span4">MLS®: <?php echo get_post_meta($post->ID,'dfd_ListingId',true); ?> </div> 128 <div class="span4 pull-right"><span class="pull-right">For Sale: $<?php echo get_post_meta($post->ID,'dfd_ListPrice',true); ?></span></div> 129 </div> 130 131 </div> 132 133 134 <i class="icon-camera"></i><i class="icon-map-marker"></i> 135 </div> 117 <?php 118 $photos = get_children( array('post_parent' => get_the_ID(), 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID') ); 119 if($photos){ 120 foreach ($photos as $photo) { 121 echo '<image src="' . wp_get_attachment_url($photo->ID,'thumbnail') . '">'; 122 } 123 } 124 ?> 125 </div> 126 <div class="well3"> 127 <div class="row"> 128 <div class="span4">MLS®: <?php echo get_post_meta($post->ID,'dfd_ListingId',true); ?> </div> 129 <div class="span4 pull-right"><span class="pull-right"><strong>For Sale: $<?php echo get_post_meta($post->ID,'dfd_ListPrice',true); ?></strong></span></div> 130 </div> 131 </div> 132 <img src="http://www.realtor.ca/presentation/images/en-CA/various/realtor.jpg"> MLS® 133 </div> 136 134 <div class="container-fluid"> 137 135 <div class="row-fluid"> 138 136 <div class="span8"> 139 137 <div class="well3"> 140 <table class="table">141 <caption><?php echo get_post_meta($post->ID,'dfd_UnparsedAddress',true); ?> , <?php echo get_post_meta($post->ID,'dfd_City',true); ?> , <?php echo get_post_meta($post->ID,'dfd_StateOrProvince',true); ?> <?php echo get_post_meta($post->ID,'dfd_PostalCode',true); ?></caption>142 <tbody>143 <tr>144 <td><span class="sp_key">Bathrooms</span><span><?php echo get_post_meta($post->ID,'dfd_BathroomsTotal',true);?></span></td>145 <td><span class="sp_key">Bedrooms</span><span><?php echo get_post_meta($post->ID,'dfd_BedroomsTotal',true);?></span></td>146 </tr>147 <tr>148 <td><span class="sp_key">Property Type</span><span><?php echo get_post_meta($post->ID,'dfd_PropertyType',true);?></span></td>149 <td><span class="sp_key">Built in</span><span><?php echo get_post_meta($post->ID,'dfd_YearBuilt',true);?></span></td>150 </tr>151 <tr>152 <td><span class="sp_key">LotSize</span><span><?php echo get_post_meta($post->ID,'dfd_LotSizeArea',true); ?> <?php echo get_post_meta($post->ID,'dfd_LotSizeUnits',true); ?></span></td>153 <td><span class="sp_key">Building Area</span><span><?php echo get_post_meta($post->ID,'dfd_BuildingAreaTotal',true); ?> <?php echo get_post_meta($post->ID,'dfd_BuildingAreaUnits',true); ?></span></td>154 </tr>155 </tbody>156 </table>157 138 <?php 158 139 … … 161 142 echo '<table class="table"><caption>' . get_post_meta($post->ID,'dfd_UnparsedAddress',true) . ',' . get_post_meta($post->ID,'dfd_City',true) . ',' . get_post_meta($post->ID,'dfd_StateOrProvince',true) . get_post_meta($post->ID,'dfd_PostalCode',true) . '</caption><tbody>'; 162 143 echo '<tr>'; 163 $array = array("dfd_BathroomsTotal" => "Bathrooms", "dfd_BedroomsTotal" => "Bedrooms", "dfd_PropertyType" => "Property Type","dfd_ PropertyType" => "Attached Garage", "dfd_YearBuilt" => "Built in", "dfd_LotSizeArea" => "LotSize","dfd_BuildingAreaTotal" => "Building Area");144 $array = array("dfd_BathroomsTotal" => "Bathrooms", "dfd_BedroomsTotal" => "Bedrooms", "dfd_PropertyType" => "Property Type","dfd_YearBuilt" => "Built in", "dfd_LotSizeArea" => "LotSize","dfd_BuildingAreaTotal" => "Building Area"); 164 145 foreach ($array as $i => $value) { 165 146 if ($item_count == $max_per_row) … … 170 151 $meta = get_post_meta($post->ID,$i,true); 171 152 $meta = trim($meta,","); 172 if($meta != "0"){ 173 if($meta != ""){ 174 $name = $value; 175 echo '<td><span class="sp_key">' .$name.'</span><span>' .$meta .'</span></td>'; 176 $item_count++; 177 } 178 } 153 154 if($meta != "0"){ 155 if($meta != ""){ 156 if($i == 'dfd_LotSizeArea'){ 157 $meta = $meta . ' ' .get_post_meta($post->ID,'dfd_LotSizeUnits',true); 158 } 159 160 if($i == 'dfd_BuildingAreaTotal'){ 161 $meta = $meta . ' ' .get_post_meta($post->ID,'dfd_BuildingAreaUnits',true); 162 } 163 164 $name = $value; 165 echo '<td><span class="sp_key">' .$name.'</span><span>' .$meta .'</span></td>'; 166 $item_count++; 167 } 168 } 179 169 } 180 170 if ($item_count != $max_per_row ) … … 211 201 echo '<table class="table"><caption>Details</caption><tbody>'; 212 202 echo '<tr>'; 213 $array = array("dfd_GarageYN" => "Garage", "dfd_CarportYN" => "Carport", "dfd_CoveredSpaces" => "Coverd Spaces","dfd_AttachedGarageYN" => "Attached Garage", "dfd_OpenParkingYN" => "Open Parking", "dfd_LotFeatures" => "Features","dfd_WaterfrontYN" => "Waterfront","dfd_PoolYN" => "Pool"); 203 $array = array("dfd_GarageYN" => "Garage", 204 "dfd_CarportYN" => "Carport", 205 "dfd_CarportSpaces" => "Carport Spaces", 206 "dfd_CoveredSpaces" => "Coverd Spaces", 207 "dfd_AttachedGarageYN" => "Attached Garage", 208 "dfd_OpenParkingYN" => "Open Parking", 209 "dfd_OpenParkingSpaces" => "Open Parking Spaces", 210 "dfd_ParkingTotal" => "Parking Total", 211 "dfd_GarageYN" => "Garage", 212 "dfd_LotFeatures" => "Features", 213 "dfd_WaterfrontYN" => "Waterfront", 214 "dfd_ArchitecturalStyle" => "Architectural Style", 215 ,"dfd_CommunityFeatures" => "Community Features", 216 ,"dfd_ConstructionMaterials" => "Construction Materials", 217 ,"dfd_Fencing" => "Fencing", 218 ,"dfd_FrontageLength" => "Frontage Length", 219 ,"dfd_FrontageType" => "Frontage Type", 220 ,"dfd_GreenBuildingCertification" => "Green Building Certification", 221 ,"dfd_GreenCertificationRating" => "Green CertificationRating", 222 ,"dfd_Roof" => "Roof", 223 ,"dfd_View" => "View", 224 ,"dfd_ViewYN" => "View", 225 ,"dfd_WaterBodyName" => "Water Body Name", 226 ,"dfd_WaterfrontYN" => "Waterfront", 227 ,"dfd_Zoning" => "Zoning"); 214 228 foreach ($array as $i => $value) { 215 229 if ($item_count == $max_per_row) … … 248 262 echo '<table class="table"><caption>Building</caption><tbody>'; 249 263 echo '<tr>'; 250 $array = array("dfd_BathroomsHalf" => "Bathrooms(Half)", "dfd_Flooring" => "Flooring", "dfd_Cooling" => "Cooling","dfd_Heating" => "Heating", "dfd_HeatingFuel" => "Heating Fuel", "dfd_FireplaceFuel" => "Fireplace Fuel","dfd_FireplaceFeatures" => "Fireplace Features","dfd_FireplacesTotal" => "Fireplaces"); 264 265 $array = array("dfd_BathroomsHalf" => "Bathrooms(Half)", 266 "dfd_Flooring" => "Flooring", 267 "dfd_Cooling" => "Cooling", 268 "dfd_CoolingYN" => "CoolingYN", 269 "dfd_Heating" => "Heating", 270 "dfd_HeatingFuel" => "Heating Fuel", 271 "dfd_FireplaceFuel" => "Fireplace Fuel", 272 "dfd_FireplacesTotal" => "Fireplaces", 273 "dfd_Levels" => "Levels", 274 "dfd_NumberOfUnitsTotal" => "Number Of Units Total", 275 "dfd_PoolYN" => "Pool", 276 "dfd_PoolFeatures" => "Pool Features", 277 "dfd_Sewer" => "Sewer", 278 "dfd_Stories" => "Stories"); 279 251 280 foreach ($array as $i => $value) { 252 281 if ($item_count == $max_per_row) … … 300 329 ?> 301 330 </tbody> 302 </table> 303 304 <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&"></script> <!-- &language=ja --> 331 </table> 332 <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&"></script> <!-- &language=ja --> 305 333 <script> 306 334 // Enable the visual refresh … … 348 376 349 377 google.maps.event.addDomListener(window, 'load', initialize); 350 </script> 351 352 378 </script> 353 379 <table class="table table-striped table-condensed "> 354 380 <caption>Map</caption> … … 368 394 <div class="row-fluid"> 369 395 <div class="well3 span12"> 396 <?php if(get_post_meta($post->ID,'sc-sync-picture-agent',true) != ''){ ?> 397 <img src="<?php $wp_upload_dir = wp_upload_dir(); echo $wp_upload_dir[baseurl] .'/soldpress/'. get_post_meta($post->ID,'sc-sync-picture-agent-file',true); ?>"> 398 <?php }?> 370 399 <address> 371 400 <strong><?php echo get_post_meta($post->ID,'dfd_ListAgentFullName',true); ?></strong><br> … … 387 416 <?php }?> 388 417 </address> 418 <?php if(get_post_meta($post->ID,'sc-sync-picture-office',true) != ''){ ?> 419 <img src="<?php $wp_upload_dir = wp_upload_dir(); echo $wp_upload_dir[baseurl] .'/soldpress/'. get_post_meta($post->ID,'sc-sync-picture-office-file',true); ?>"> 420 <?php }?> 389 421 <address> 390 422 <small><?php echo get_post_meta($post->ID,'dfd_ListOfficeName',true); ?></small></br> … … 398 430 <div class="row-fluid"> 399 431 <div class="well3 span12"> 400 <!-- Co Agent --> 432 <?php if(get_post_meta($post->ID,'sc-sync-picture-agent',true) != ''){ ?> 433 <img src="<?php $wp_upload_dir = wp_upload_dir(); echo $wp_upload_dir[baseurl] .'/soldpress/'. get_post_meta($post->ID,'sc-sync-picture-coagent-file',true); ?>"> 434 <?php }?> 401 435 <address> 402 436 <strong><?php echo get_post_meta($post->ID,'dfd_CoListAgentFullName',true); ?></strong><br> … … 442 476 <p><small> 443 477 ©1998-2013 The Canadian Real Estate Association. All rights reserved. MLS®, Multiple Listing Service®, and all related graphics are trademarks of The Canadian Real Estate Association. REALTOR®, REALTORS®, and all related graphics are trademarks of REALTOR® Canada Inc. a corporation owned by The Canadian Real Estate Association and the National Association of REALTORS®.</small> </p> 444 <p><small> ©2013 Sanskript Solutions, Inc. All rights reserved. Powered by SoldPress.</small></p>478 <p><small>Powered by SoldPress. ©2013 Sanskript Solutions, Inc. All rights reserved. </small></p> 445 479 <?php get_footer(); ?> 446 480 <script src="http://malsup.github.com/jquery.cycle2.carousel.js"></script> -
soldpress/branches/0.9.5A/soldpress.php
r712951 r714737 4 4 Plugin URI: http://www.sanskript.com/products/soldpress 5 5 Description: SoldPress is a WordPress plugin to enable CREA’s members to easily disseminate MLS® listing content on WordPress Sites. 6 Version: 0.9.5 Beta6 Version: 0.9.5.2 Beta 7 7 Author: Amer Gill 8 8 Author URI: http://www.sanskript.com … … 61 61 62 62 //Schedule The Events 63 wp_schedule_event( time(), ' twicedaily', 'soldpress_listing_sync');63 wp_schedule_event( time(), 'daily', 'soldpress_listing_sync'); 64 64 wp_schedule_event( time(), 'hourly', 'soldpress_photo_sync'); 65 65 … … 80 80 }else 81 81 { 82 $date = $lastupdate ; 83 $date->add(new DateInterval('P' . 1 . 'D')); 82 $date = new DateTime(); 83 //$date = $lastupdate ; 84 //$date->add(new DateInterval('P' . 1 . 'D')); 84 85 update_option( 'sc-lastupdate', $date); 85 86 }
Note: See TracChangeset
for help on using the changeset viewer.