Plugin Directory

Changeset 1815229


Ignore:
Timestamp:
02/04/2018 07:10:39 PM (8 years ago)
Author:
reblogdog
Message:

Commit v9.0.3

Location:
blogdog/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • blogdog/trunk/admin/admin.php

    r1813712 r1815229  
    896896       
    897897        if( $_REQUEST['ID'] === 'blogdog_city' ) {
    898            
    899             $result = $this->blogdog_zipcode_checkbox( $_REQUEST['city'], array(), $_REQUEST['section'] );
    900            
    901             if( $result )  $response['html'] = $result;
    902             else  $response['html'] = 'No zipcodes available for this city.';
    903            
     898
     899            $response['html'] = apply_filters( 'blogdog_GET', 'zipcodes/', array( urlencode( $_REQUEST['city'] ), $_REQUEST['section'] ) );
     900
    904901            $response['code'] = '#blogdog_zipcode_' . $_REQUEST['section'];
    905902           
  • blogdog/trunk/admin/css/style.css

    r1750834 r1815229  
    1616    float:left;
    1717    margin: 6px 9px;
     18}
     19
     20.location-footer{
     21    padding: 40px 0 10px;
    1822}
    1923
  • blogdog/trunk/admin/js/admin.js

    r1750834 r1815229  
    124124   
    125125    /** Update city and zipcode inputs  */
    126     $( '#blogdog_admin' ).on( 'change click', '.blogdog_watch', function() {
     126    $( '#blogdog_admin' ).on( 'change', '.blogdog-city', function() {
    127127           
    128128        var ID = this.id;
    129129        var city = $( this ).val();
    130         var state = $( '#blogdog_state' ).val();
    131130        var section = $( this ).attr( 'section' );
    132         var shortcode_type = $( '#shortcode_type' ).val();
    133        
     131
     132        $( this ).parents( '.locations-wrap' ).children( '.location_heading' ).children( '.city-text' ).html( city );
    134133       
    135134        jQuery.ajax ( {
     
    140139                ID : ID,
    141140                city : city,
    142                 state : state,
    143141                section : section,
    144                 shortcode_type : shortcode_type,
    145                 blogdog_ajax_nonce : blogdog_url.nonce,
     142                blogdog_ajax_nonce : blogdog_url.nonce,
     143            },
     144            beforeSend: function() {
     145                $( '#blogdog_zipcode_' + section ).html( '<i class="far fa-spin fa-spinner"></i>' );
    146146            },
    147147            success: function( response ) {
     
    152152            dataType:'json'
    153153        } );
    154     } );
    155    
    156     /* Update location heading on city select change */
    157     $( '#locations_wrap'  ).on( 'change', '.blogdog-city', function( ) {
    158         var city = $( this ).val();
    159         $( this ).parents( '.locations-wrap' ).children( '.location_heading' ).children( '.city-text' ).html( city );
    160154    } );
    161155
  • blogdog/trunk/blogdog.php

    r1814511 r1815229  
    44Plugin URI:  https://reblogdog.com
    55Description: Add automated real estate content to your website. We publish an SEO optimized blog post for you everyday.
    6 Version:     9.0.2
     6Version:     9.0.3
    77Author:      reblogdog
    88Author URI:  https://reblogdog.com
     
    2828
    2929if ( ! defined( 'BLOGDOG_PLUGIN_VERSION' ) )
    30     define( 'BLOGDOG_PLUGIN_VERSION', '9.0.2' );
     30    define( 'BLOGDOG_PLUGIN_VERSION', '9.0.3' );
    3131
    3232/**
     
    604604           
    605605        }
    606 
    607         $this->update_api_key_9_0_1();
    608        
    609     }
    610 
    611     public function update_api_key_9_0_1() {
    612 
    613         $option = 'update_api_key_9_0_1';
    614 
    615         if( ! get_option( $option ) ) {
    616 
    617             $settings = get_option( 'blogdog_api_settings' );
    618 
    619             update_option( 'blogdog_api_key', $settings['api_key'] );
    620 
    621             update_option( $option, 'success' );
    622 
    623         }
    624 
     606       
    625607    }
    626608   
     
    649631     * @since 6.0.0
    650632     *
    651      * @param  object $results The MLS data object.
    652      */
    653    
    654     public function blogdog_elite_post( $results ) {
    655 
    656         if( $this->useable_listing( $results ) ) {
     633     * @param  object $listing The MLS data object.
     634     */
     635   
     636    public function blogdog_elite_post( $listing ) {
     637
     638        if( $this->useable_listing( $listing ) ) {
    657639
    658640            $arg = 'blogdog_elite_post_body_' . time();
    659641
    660             update_option( $arg, $results );
     642            update_option( $arg, $listing );
    661643
    662644            wp_schedule_single_event( time() + 60, 'blogdog_elite_publish', array( $arg ) );
     
    668650    }
    669651
    670     private function useable_listing( $results ) {
     652    private function useable_listing( $listing ) {
    671653
    672654        if( $settings = (array) apply_filters( 'blogdog_GET', 'elite-settings/' ) ) {
     
    677659
    678660            if(
    679                 ! empty( $results->images )
    680                 &&
    681                 $results->mls_class == 'res'
    682                 &&
    683                 in_array( $results->ListStatus, array( 'Active', 'Closed', 'Sold' ) )
    684                 &&
    685                 empty( $results->Contingent )
    686                 &&
    687                 (
    688                     in_array( $results->ListOfficeID, $broker_ids )
    689                     ||
    690                     in_array( $results->ListAgentID, $agent_ids )
    691                 )
    692                 &&
    693                 in_array( $results->City, $areas )
    694                 &&
    695                 post_exists( 'Featured Listing: ' . $listing->PropertyAddress ) == 0
    696                 &&
    697                 post_exists( 'Recently Sold: ' . $listing->PropertyAddress ) == 0
    698 
     661                empty( $listing->images )
     662                ||
     663                $listing->mls_class != 'res'
     664                ||
     665                ! in_array( $listing->ListStatus, array( 'Active', 'Closed', 'Sold' ) )
     666                ||
     667                ! empty( $listing->Contingent )
     668                ||
     669                ! in_array( $listing->ListOfficeID, $broker_ids )
     670                ||
     671                ! in_array( $listing->ListAgentID, $agent_ids )
     672                ||
     673                ! in_array( $listing->City, $areas )
     674                ||
     675                (
     676                    in_array( $listing->ListStatus, array( 'Closed', 'Sold' ) )
     677                    &&
     678                    strtotime( $listing->DaysBack ) > ( time() - ( 86400 * 30 ) )
     679                )
     680                ||
     681                post_exists( 'Featured Listing: ' . $listing->PropertyAddress )
     682                ||
     683                post_exists( 'Recently Sold: ' . $listing->PropertyAddress )
     684           
    699685            ) {
    700686
    701                 // Check for sold and inside 30 days.
    702                 if(
    703                     in_array( $results->ListStatus, array( 'Closed', 'Sold' ) )
    704                     &&
    705                     strtotime( $results->DaysBack ) > ( time() - ( 86400 * 30 ) )
    706                 ) {
    707 
    708                     return false;
    709 
    710                 }
     687                return false;
     688
     689            }
    711690               
    712                 return true;
    713 
    714             }
     691            return true;
    715692
    716693        }
  • blogdog/trunk/readme.txt

    r1814512 r1815229  
    6363== Changelog ==
    6464
     65= 9.0.3 =
     66
     67* Bug fix - zipcode ajax request.
     68* Update conditions for Elite Automation posts.
     69
    6570= 9.0.2 =
    6671
    67 * Bug fix - Wrong DB key for api_key in blogdog API push.
     72* Bug fix - Wrong options key for api_key in blogdog API push.
    6873* Verify title does not exists for Elite Automation posts.
    6974
Note: See TracChangeset for help on using the changeset viewer.