Plugin Directory

Changeset 703015


Ignore:
Timestamp:
04/24/2013 07:38:33 PM (13 years ago)
Author:
Sanskript
Message:

Nightly Checkin

Location:
soldpress/branches/0.9.5A
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • soldpress/branches/0.9.5A/adapter.php

    r700610 r703015  
    1717        $this->service->SetParam('compression_enabled', true);
    1818        $this->service->SetParam('disable_follow_location', true);
    19 
     19        $this->service->SetParam('offset_support', true);
     20       
    2021        $cookie_file = 'soldpress';
    2122        @touch(cookie_file);
     
    99100   
    100101    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;
    104106        if($culture =='')
    105107        {
     
    107109        }
    108110
    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)); 
    110112       
    111113        while ($rets = $this->service->FetchRow($results)) {
     
    136138                wp_update_post($post);
    137139                $post_id = $post->ID;
     140                echo ' update';
    138141            }
    139142            else{               
     
    148151               
    149152                $post_id = wp_insert_post( $post );
     153                echo ' insert';
    150154            }
    151155
     
    159163        $this->service->FreeResult($results);
    160164
     165        update_option( 'sc-status', false );
     166        update_option( 'sc-sync-end',time() );
    161167        return true;
    162168    }
     
    233239    public function searchresidentialproperty($crit, $template, $culture)
    234240    {   
     241   
    235242        $render = 'Listing not found.';
    236243
  • soldpress/branches/0.9.5A/settings.php

    r700514 r703015  
    1313    register_setting( 'sc-settings-group', 'sc-url' );
    1414    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' );
    1617}
    1718
     
    4849        </tr>
    4950    </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' ) ?>
    5155    <?php submit_button(); ?> 
    5256</form>
     
    5559    <?php submit_button('Test Connection', 'secondary', 'test_connection', false); ?>
    5660    <?php submit_button('Manual Sync', 'secondary', 'sync', false); ?>
     61    <?php submit_button('Clear Listings', 'secondary', 'delete', false); ?>
     62   
     63   
    5764</form>
    5865<br><br>
     
    8087        if($adapter->connect())
    8188        {
    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.
    83101        }
    84102    }
  • soldpress/branches/0.9.5A/soldpress.php

    r700610 r703015  
    44Plugin URI: http://www.sanskript.com/products/soldpress
    55Description: SoldPress is a WordPress plugin to enable CREA’s members to easily disseminate MLS® listing content on WordPress Sites.
    6 Version: 0.9.2 RC
     6Version: 0.9.5 A
    77Author: Amer Gill
    88Author URI: http://www.sanskript.com
     
    2424}
    2525
     26register_deactivation_hook(__FILE__,'deactivate_cron_hook');
     27
     28function deactivate_cron_hook(){
     29wp_clear_scheduled_hook('soldpress_listing_sync');
     30}
     31
    2632/*register_deactivation_hook(__FILE__, soldpress_deactivate);
    2733
     
    3642register_activation_hook(__FILE__, 'soldpress_activation');
    3743
    38 add_action('my_hourly_event', 'do_this_hourly');
     44add_action('soldpress_listing_sync', 'soldpress_hourly');
    3945
    4046function 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');
    4350}
    4451
    45 function do_this_hourly() {
     52function soldpress_hourly() {
    4653    // do something every hour
    4754    update_option( 'sc-lastupdate', time() );
    48 
     55   
    4956    $adapter= new soldpress_adapter();
    5057    if($adapter->connect())
Note: See TracChangeset for help on using the changeset viewer.