Changeset 703015
- Timestamp:
- 04/24/2013 07:38:33 PM (13 years ago)
- Location:
- soldpress/branches/0.9.5A
- Files:
-
- 3 edited
-
adapter.php (modified) (7 diffs)
-
settings.php (modified) (4 diffs)
-
soldpress.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
soldpress/branches/0.9.5A/adapter.php
r700610 r703015 17 17 $this->service->SetParam('compression_enabled', true); 18 18 $this->service->SetParam('disable_follow_location', true); 19 19 $this->service->SetParam('offset_support', true); 20 20 21 $cookie_file = 'soldpress'; 21 22 @touch(cookie_file); … … 99 100 100 101 public function sync_residentialproperty($crit, $culture) 101 { 102 echo $crit; 103 102 { echo "<br>Sync<br>"; 103 update_option( 'sc-status', true ); 104 update_option( 'sc-sync-start',time() ); 105 // echo $crit; 104 106 if($culture =='') 105 107 { … … 107 109 } 108 110 109 $results = $this->service->SearchQuery("Property","Property",$crit,array("Limit" => ' None',"Culture" => $culture));111 $results = $this->service->SearchQuery("Property","Property",$crit,array("Limit" => '100',"Culture" => $culture)); 110 112 111 113 while ($rets = $this->service->FetchRow($results)) { … … 136 138 wp_update_post($post); 137 139 $post_id = $post->ID; 140 echo ' update'; 138 141 } 139 142 else{ … … 148 151 149 152 $post_id = wp_insert_post( $post ); 153 echo ' insert'; 150 154 } 151 155 … … 159 163 $this->service->FreeResult($results); 160 164 165 update_option( 'sc-status', false ); 166 update_option( 'sc-sync-end',time() ); 161 167 return true; 162 168 } … … 233 239 public function searchresidentialproperty($crit, $template, $culture) 234 240 { 241 235 242 $render = 'Listing not found.'; 236 243 -
soldpress/branches/0.9.5A/settings.php
r700514 r703015 13 13 register_setting( 'sc-settings-group', 'sc-url' ); 14 14 register_setting( 'sc-settings-group', 'sc-template' ); 15 register_setting( 'sc-settings-group', 'sc-lastupdate' ); 15 // register_setting( 'sc-settings-group', 'sc-lastupdate' ); 16 // register_setting( 'sc-settings-group', 'sc-status' ); 16 17 } 17 18 … … 48 49 </tr> 49 50 </table> 50 51 Status : <?php echo get_option('sc-status' ) ?> 52 Start : <?php echo get_option('sc-sync-start' ) ?> 53 End : <?php echo get_option('sc-sync-end' ) ?> 54 Error : <?php echo get_option('sc-sync-error' ) ?> 51 55 <?php submit_button(); ?> 52 56 </form> … … 55 59 <?php submit_button('Test Connection', 'secondary', 'test_connection', false); ?> 56 60 <?php submit_button('Manual Sync', 'secondary', 'sync', false); ?> 61 <?php submit_button('Clear Listings', 'secondary', 'delete', false); ?> 62 63 57 64 </form> 58 65 <br><br> … … 80 87 if($adapter->connect()) 81 88 { 82 return $adapter-> sync_residentialproperty("ID=11937198",""); 89 return $adapter-> sync_residentialproperty("LastUpdated=2011-05-08T22:00:17Z",""); 90 } 91 } 92 93 if (isset($_POST["delete"])) { 94 echo 'delete'; 95 $mycustomposts = get_posts( array( 'post_type' => 'property', 'numberposts' => 500) ); 96 foreach( $mycustomposts as $mypost ) { 97 echo $mypost->ID; 98 // Delete's each post. 99 wp_delete_post( $mypost->ID, true); 100 // Set to False if you want to send them to Trash. 83 101 } 84 102 } -
soldpress/branches/0.9.5A/soldpress.php
r700610 r703015 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. 2 RC6 Version: 0.9.5 A 7 7 Author: Amer Gill 8 8 Author URI: http://www.sanskript.com … … 24 24 } 25 25 26 register_deactivation_hook(__FILE__,'deactivate_cron_hook'); 27 28 function deactivate_cron_hook(){ 29 wp_clear_scheduled_hook('soldpress_listing_sync'); 30 } 31 26 32 /*register_deactivation_hook(__FILE__, soldpress_deactivate); 27 33 … … 36 42 register_activation_hook(__FILE__, 'soldpress_activation'); 37 43 38 add_action(' my_hourly_event', 'do_this_hourly');44 add_action('soldpress_listing_sync', 'soldpress_hourly'); 39 45 40 46 function soldpress_activation() { 41 echo "activate"; 42 wp_schedule_event( time(), 'hourly', 'my_hourly_event'); 47 48 //wp_schedule_event( time(), 'daily', 'soldpress_listing_sync'); 49 wp_schedule_event( time(), 'hourly', 'soldpress_listing_sync'); 43 50 } 44 51 45 function do_this_hourly() {52 function soldpress_hourly() { 46 53 // do something every hour 47 54 update_option( 'sc-lastupdate', time() ); 48 55 49 56 $adapter= new soldpress_adapter(); 50 57 if($adapter->connect())
Note: See TracChangeset
for help on using the changeset viewer.