Plugin Directory

Changeset 2749653


Ignore:
Timestamp:
06/29/2022 12:50:11 PM (4 years ago)
Author:
therealestatevoice
Message:
  • Fixed issue of siteloft plugin's listing image
  • Added categories to category dropdown in siteloft plugin's listing page
  • Added placeholder to Instagram default hashtags area in Instagram setting
Location:
the-real-estate-voice
Files:
75 added
12 edited

Legend:

Unmodified
Added
Removed
  • the-real-estate-voice/trunk/classes/class-trev-csmap-revoice-calendar.php

    r2742727 r2749653  
    4444        public function trev_csmap_display_calendar() {
    4545
     46            $general_tab_option_name = get_option( 'general_tab_option_name' );
     47
     48            $agentPoint = false;
     49
     50            if ( isset( $general_tab_option_name['website_platform'] ) && 'Agentpoint' == $general_tab_option_name['website_platform'] ) {
     51
     52                $agentPoint = true;
     53
     54            }
     55            $general_tab_options = get_option( 'general_tab_option_name' );
    4656            $current_time_zone   = get_option( 'timezone_string' );
    47             $general_tab_options = get_option( 'general_tab_option_name' );
    48             date_default_timezone_set( $current_time_zone );
     57
     58            if( !empty( $current_time_zone ) ){
     59                date_default_timezone_set( $current_time_zone );   
     60            }
     61           
     62           
    4963
    5064            $args        = array(
     
    189203                $html .= '<div class="day_num' . esc_attr( $selected ) . '">';
    190204                $html .= '<span>' . esc_html( $i ) . '</span>';
    191 
     205               
    192206                foreach ( $this->events as $event ) {
    193207
    194208                    for ( $d = 0; $d <= ( $event[2] - 1 ); $d++ ) {
    195209                        $listing_color = '';
     210                       
    196211                        $post_id       = $event[4];
    197                         $get_post_data = trev_csmap_get_post_data( $post_id );
    198 
    199                         $content_post = get_post($post_id);
     212
     213                        $content_post  = get_post($post_id);
    200214
    201215                        $page_ids      = get_post_meta( $post_id, 'revoice_scheduled_page_id', true );
     
    204218
    205219                        $page_listing = get_post_meta( $post_id, 'revoice_listingpage', true );
     220                   
    206221                        $datetime     = $event[1] . ' ' . $event[5];
    207222                        $current_date = date( 'Y-m-d', strtotime( $datetime ) );
    208223
    209224                        $post_color        = '';
    210                         $revoice_post_type = get_post_meta( $post_id, 'revoice_post_type', true );
     225                        $revoice_post_type = get_post_meta($post_id, 'revoice_post_type', true );
    211226
    212227                        if ( $datetime < current_time( 'mysql' ) ) {
     
    225240
    226241                        $parent_id       = get_post_meta( $post_id, 'revoice_scheduled_post_id', true );
     242                           
    227243                        $parent_content  = get_the_excerpt( $parent_id );
    228244
    229245                        $listing_details = trev_csmap_get_web_plateform_data($revoice_post_type, $parent_id);
    230                    
     246                       
     247                        if( 'property' == $revoice_post_type ){
     248                                                           
     249                            $get_post_data = trev_csmap_get_agentpoint_data( $post_id );
     250                            $permalink = get_site_url().'/'.$parent_id;
     251                            $listing_details['listing_link']    = $permalink;
     252                           
     253                        }else{
     254
     255                            $get_post_data = trev_csmap_get_post_data( $post_id ); 
     256                        }
     257   
    231258                            $bedroom_emoji   = '';
    232259                            if ( ! empty( $listing_details['bedroom'] ) ) {
     
    260287                            } else {
    261288
    262                                 if ( 'listing' == $revoice_post_type ) {
     289                                if ( 'listings' == $revoice_post_type || 'listing' == $revoice_post_type || 'property' == $revoice_post_type) {
    263290                                    $plugin_status = false;
    264291                                    if ( ! empty( $event[1] ) && $event[1] < current_time( 'mysql' ) ) {
     
    271298                                        $plugin_status = trev_csmap_is_pro_license_plugin();
    272299                                    }
     300
    273301                                    ?>
    274302                                    <a style="color:<?php echo esc_attr( $listing_color ); ?>" href="javascript:void(0)" class="edit_schedule edit_post_cl" data-event_time="<?php echo esc_attr( $scheduled ); ?>" data-paglisting="<?php echo esc_attr( $page_listing ); ?>" data-listing-details='<?php echo esc_attr( $js_code ); ?>'  data-parent-content="<?php echo esc_attr( $parent_content ); ?>"  data-post-type="<?php echo esc_attr( $revoice_post_type ); ?>" data-event_time="<?php echo esc_attr( $datetime ); ?>" data-pageid="<?php echo esc_attr( $page_ids ); ?>" data-event="<?php echo esc_attr( $event[0] ); ?>" data-id="<?php echo esc_attr( $event[4] ); ?>" data-image="<?php echo esc_url( $get_post_data['image_url'] ); ?>"  data-content-page="<?php echo esc_attr( 'scheduled' ); ?>" data-desc="<?php echo esc_attr( $get_post_data['desc'] ); ?>" data-plugin-status ="<?php echo esc_attr( $plugin_status ); ?>"> <?php echo esc_html( $event[5] ) . ' ' . esc_html( $event[0] ); ?></a>
    275303
    276304                                    <?php
     305
    277306                                    $cal_sch = ob_get_contents();
    278307                                    ob_end_clean();
    279308                                    $html .= $cal_sch;
     309
    280310                                } else {
     311
    281312                                    if ( ! empty( $event[1] ) && $event[1] < current_time( 'mysql' ) ) {
    282313                                        $event[1] = '';
  • the-real-estate-voice/trunk/classes/class-trev-csmap-schedules-table.php

    r2742727 r2749653  
    143143            if ( ! empty( $posts ) ) {
    144144                foreach ( $posts as $post ) {
    145                     $get_post_data = trev_csmap_get_post_data( $post->ID );
     145                   
    146146
    147147                    // Current fb page id of schedule post
     
    149149                    $insta_ids              = get_post_meta( $post->ID, 'revoice_scheduled_insta_id', true );
    150150                    $revoice_post_type      = get_post_meta( $post->ID, 'revoice_post_type', true );
     151
    151152                    $parent_id              = get_post_meta( $post->ID, 'revoice_scheduled_post_id', true );
     153
    152154                    $revoice_listing_detail = get_post_meta( $post->ID, 'revoice_listing_detail', true );
     155
    153156                    $parent_content         = get_the_excerpt( $parent_id );
    154157
    155158                    $listing_details        = trev_csmap_get_web_plateform_data($revoice_post_type ,$parent_id);
     159
     160                    $get_post_data = trev_csmap_get_post_data( $post->ID );
     161
     162                    if( 'property' == $revoice_post_type ){
     163
     164                        $get_post_data = trev_csmap_get_agentpoint_data( $post->ID );
     165                        $permalink = get_site_url().'/'.$parent_id;
     166                        $listing_details['listing_link']    = $permalink;
     167
     168                    }else{
     169
     170                        $get_post_data = trev_csmap_get_post_data( $post->ID );
     171                    }
    156172
    157173                    $bedroom_emoji = '';
     
    228244                                } else {
    229245
    230                                     if ( 'listing' == $revoice_post_type ) {
     246                                    if ( 'listings' == $revoice_post_type || 'listing' == $revoice_post_type || 'property' == $revoice_post_type) {
    231247                                        if ( ! empty( $scheduled ) && $scheduled < current_time( 'mysql' ) ) {
    232248                                            $scheduled = '';
  • the-real-estate-voice/trunk/classes/class-trev-csmap-settings.php

    r2745011 r2749653  
    10881088                'WPCasa'               => esc_html__( 'WPCasa', 'the-real-estate-voice' ),
    10891089                'Website Blue'         => esc_html__( 'Website Blue', 'the-real-estate-voice' ),
    1090                 // 'Agentpoint'  => esc_html__('Agentpoint','the-real-estate-voice'),
     1090                //'Agentpoint'         => esc_html__('Agentpoint','the-real-estate-voice'),
    10911091                'Easy Property Listings' => esc_html__( 'Easy Property Listings', 'the-real-estate-voice' ),
    10921092                'SiteLoft'               => esc_html__( 'SiteLoft', 'the-real-estate-voice' )
     
    11011101            foreach ( $website_platform as $key => $platform ) {
    11021102                $selected = ( isset( $this->general_tab_options['website_platform'] ) && $this->general_tab_options['website_platform'] == $key ) ? 'selected' : '';    ?>
    1103                
     1103
    11041104                <option value="<?php echo esc_attr( $key ); ?>" <?php echo esc_attr( $selected ); ?> > <?php echo esc_html( $platform ); ?></option>
    11051105
     
    11071107
    11081108                </select>
    1109 
    1110            
     1109       
    11111110                <p class="description">
    11121111                    <i><?php esc_html_e( "Select your website provider.", 'the-real-estate-voice' ); ?></i>
     
    12261225            ?>
    12271226
    1228             <textarea name="instagram_tab_option_name[hashtags]" id="default_hashtags" rows="8" style="width:44%"><?php echo esc_html( $hashtags ); ?></textarea>
     1227            <textarea name="instagram_tab_option_name[hashtags]" id="default_hashtags" placeholder="#realestate #voicerealestate #iloverealestate
     1228       
     1229Voice Real Estate
     1230📞 9999 99999
     1231💻 www.voicerealestate.com
     1232LINK IN BIO" rows="8" style="width:44%"><?php echo esc_html( $hashtags ); ?></textarea>
    12291233            <p class="description">
    12301234                <i><?php esc_html_e( 'Enter any content you always want to add when sharing', 'the-real-estate-voice' ); ?></i>
  • the-real-estate-voice/trunk/css/trev-csmap-css.css

    r2744106 r2749653  
    561561.fb-content-list .blog_image {
    562562    min-height: 210px;
     563    max-height: 210px;
     564    overflow: hidden;
    563565}
    564566
     
    15271529
    15281530.swal2-container.swal2-center.post #swal2-html-container .map_share_window,
    1529 .swal2-container.swal2-center.listing #swal2-html-container .map_share_window {
     1531.swal2-container.swal2-center.listing #swal2-html-container .map_share_window,
     1532.swal2-container.swal2-center.listings #swal2-html-container .map_share_window,
     1533.swal2-container.swal2-center.property #swal2-html-container .map_share_window {
    15301534    padding: 5px 30px 30px 30px;
    15311535}
     
    15341538.swal2-container.swal2-center.post .swal2-popup.swal2-modal,
    15351539.swal2-container.swal2-center.post #swal2-html-container,
    1536 .swal2-container.swal2-center.listing #swal2-html-container {
     1540.swal2-container.swal2-center.listing #swal2-html-container,
     1541.swal2-container.swal2-center.listings #swal2-html-container,
     1542.swal2-container.swal2-center.property #swal2-html-container {
    15371543    padding-bottom: 0px !important;
    15381544
     
    15601566}
    15611567
    1562 .swal2-container.listing .post_image {
     1568.swal2-container.listing .post_image,
     1569.swal2-container.listings .post_image,
     1570.swal2-container.property .post_image {
    15631571    padding: 0 0px;
    15641572    height: 200px;
  • the-real-estate-voice/trunk/includes/ajax.php

    r2742727 r2749653  
    140140function trev_csmap_add_schedule() {
    141141    check_ajax_referer( 'revoice_nonce_fb', 'security' );
     142
     143    $general_tab_option_name = get_option( 'general_tab_option_name' );
     144
     145   
    142146
    143147    $title        = sanitize_text_field( wp_unslash( $_POST['title'] ) );
     
    173177        update_post_meta( $post_id, 'revoice_post_type', $post_type );
    174178        update_post_meta( $post_id, 'revoice_listing_detail', $share_desc );
    175         update_post_meta( $id, 'revoice_scheduled_id', $post_id );
    176         update_post_meta( $id, 'revoice_sharing_status', $status );
     179       
     180
     181        if( isset( $general_tab_option_name['website_platform'] ) && 'Agentpoint' == $general_tab_option_name['website_platform'] ) {
     182            trev_csmap_update_preperty_meta( $id, 'revoice_scheduled_id', $post_id );
     183            trev_csmap_update_preperty_meta( $id, 'revoice_sharing_status', $status );
     184
     185        }else{
     186            update_post_meta( $id, 'revoice_scheduled_id', $post_id );
     187            update_post_meta( $id, 'revoice_sharing_status', $status );
     188
     189        }
     190       
    177191        update_post_meta( $post_id, 'revoice_scheduled_page_id', $page_id );
    178192        update_post_meta( $post_id, 'revoice_platform', $plafrom );
     
    213227
    214228    $post_data = array(
     229
    215230        'post_title'    => $title,
    216231        'post_content'  => $share_desc,
     
    220235        'post_date'     => $postdate,
    221236        'edit_date'     => 'true',
     237
    222238    );
    223239
     
    320336        update_post_meta( $id, 'revoice_scheduled', $date_time );
    321337        update_post_meta( $id, 'revoice_scheduled_page_id', $page_id );
     338
    322339        if ( ! empty( $sharable_agent ) ) {
    323340            update_post_meta( $id, 'revoice_scheduled_agenet_details', $sharable_agent );
     
    343360function trev_csmap_remove_schedule() {
    344361    check_ajax_referer( 'revoice_nonce_fb', 'security' );
     362
    345363    $id      = sanitize_text_field( wp_unslash( $_POST['id'] ) );
    346364
    347365    $post_id = get_post_meta( $id, 'revoice_scheduled_post_id', true );
    348366
    349     if ( metadata_exists( 'post', $post_id, 'revoice_shared' ) ) {
    350         update_post_meta( $post_id, 'revoice_sharing_status', 'Shared' );
    351     } else {
    352         update_post_meta( $post_id, 'revoice_sharing_status', 'Never Shared' );
    353     }
    354 
    355     delete_post_meta( $post_id, 'revoice_scheduled_id', $id );
    356 
     367    $general_tab_option_name = get_option( 'general_tab_option_name' );
     368
     369    if( isset( $general_tab_option_name['website_platform'] ) && 'Agentpoint' == $general_tab_option_name['website_platform'] ) {
     370
     371        if( trev_csmap_exist_preperty_meta($post_id, 'revoice_shared') ){
     372            trev_csmap_update_preperty_meta( $post_id, 'revoice_sharing_status', 'Shared' );
     373        }else{
     374            trev_csmap_update_preperty_meta($post_id, 'revoice_sharing_status', 'Never Shared' );
     375        }
     376
     377        trev_delete_preperty_meta( $post_id, 'revoice_scheduled_id' );
     378
     379    }else{
     380        if ( metadata_exists( 'post', $post_id, 'revoice_shared' ) ) {
     381            update_post_meta( $post_id, 'revoice_sharing_status', 'Shared' );
     382        } else {
     383            update_post_meta( $post_id, 'revoice_sharing_status', 'Never Shared' );
     384        }
     385
     386        delete_post_meta( $post_id, 'revoice_scheduled_id', $id );
     387       
     388    }
    357389    wp_delete_post( $id );
     390
     391   
    358392    die();
    359393
     
    392426    $status         = sanitize_text_field( wp_unslash( $_POST['status'] ) );
    393427    $id             = sanitize_text_field( wp_unslash( $_POST['id'] ) );
    394     $current_status = get_post_meta( $id, 'revoice_sharing_status', true );
     428    $general_tab_option_name = get_option( 'general_tab_option_name' );
     429
     430    if ( isset( $general_tab_option_name['website_platform'] ) && 'Agentpoint' == $general_tab_option_name['website_platform'] ) {
     431       
     432        $current_status = trev_csmap_get_preperty_meta( $id, 'revoice_sharing_status' );
     433
     434    }else{
     435
     436        $current_status = get_post_meta( $id, 'revoice_sharing_status', true );
     437
     438    }
     439   
    395440
    396441    if ( 'Currently scheduled' == $current_status ) {
     
    436481                $data['status'] = 'success';
    437482                $data['msg']    = esc_html__( 'Successfully Shared', 'the-real-estate-voice' );
    438                 update_post_meta( $id, 'revoice_shared', current_datetime() );
    439                 update_post_meta( $id, 'revoice_sharing_status', $status );
     483           
     484                if( isset( $general_tab_option_name['website_platform'] ) && 'Agentpoint' == $general_tab_option_name['website_platform'] ) {
     485
     486                    $current_datetime = date( 'd/m/Y' );
     487
     488                trev_csmap_update_preperty_meta($id,'revoice_shared',$current_datetime);   
     489                    trev_csmap_update_preperty_meta( $id, 'revoice_sharing_status', $status ); 
     490
     491                }else{
     492
     493                    update_post_meta( $id, 'revoice_shared', current_datetime() );
     494                    update_post_meta( $id, 'revoice_sharing_status', $status );
     495
     496                }
     497               
    440498            } else {
    441499                $data['status'] = 'error';
  • the-real-estate-voice/trunk/includes/custom-functions.php

    r2742727 r2749653  
    181181    function trev_csmap_get_post_data( $schedule_id ) {
    182182
    183         $get_post_date              = array();
    184         $post_id                    = get_post_meta( $schedule_id, 'revoice_scheduled_post_id', true );
    185         $image_url                  = get_the_post_thumbnail_url( $post_id, 'full' );
     183        $general_tab_options = get_option( 'general_tab_option_name' );
     184        $get_post_date       = array();
     185        $post_id             = get_post_meta( $schedule_id, 'revoice_scheduled_post_id', true );
     186        $image_url           ='';
     187
     188        if ( isset( $general_tab_options['website_platform'] ) && 'SiteLoft' == $general_tab_options['website_platform'] ) {
     189
     190            $postType = get_post_type($post_id);
     191
     192            if('listings' == $postType){
     193               
     194                $hero_image_thumbs = get_post_meta( $post_id, 'thumbnails', true );
     195
     196                if(!empty($hero_image_thumbs) && ! empty( $hero_image_thumbs[0]['full'] )){
     197
     198                    $image_url = $hero_image_thumbs[0]['full'];
     199
     200                }else{
     201
     202                    $hero_image_full = get_post_meta( $post_id, 'images', true );
     203
     204                    if(!empty($hero_image_full)){
     205                        $image_url = $hero_image_full[0]['full'];   
     206                    }
     207                }
     208            }else{
     209                $hero_image_thumbs = get_post_meta( $post_id, 'hero_image_thumbs', true );
     210                if ( ! empty( $hero_image_thumbs['full'] ) ) {
     211                    $image_url = $hero_image_thumbs['full'];
     212                }
     213            }
     214           
     215
     216        }else{
     217            $image_url                 = get_the_post_thumbnail_url( $post_id, 'full' );   
     218        }
     219       
    186220        $desc                       = get_the_excerpt( $schedule_id );
    187221        $get_post_date['post_id']   = $post_id;
     
    192226    }
    193227}
     228
     229function trev_csmap_get_agentpoint_data( $schedule_id ) {
     230
     231        $get_post_date              = array();
     232        $post_id                    = get_post_meta( $schedule_id, 'revoice_scheduled_post_id', true );
     233
     234        global $wpdb;
     235
     236        $properties = 'properties';
     237
     238        $qry_post = "SELECT * FROM $properties WHERE id=".$post_id;
     239
     240        $posts = $wpdb->get_results( $qry_post );
     241
     242        $attachment = 'attachments';
     243
     244        $qry_img = "SELECT * FROM $attachment WHERE parent_id=".$post_id;
     245
     246        $images_res = $wpdb->get_results( $qry_img );
     247        if(!empty($images_res) || !empty($posts)){
     248            $image_url                  = $images_res[0]->url;
     249         $desc                       = $posts[0]->description;
     250         $get_post_date['post_id']   = $post_id;
     251         $get_post_date['image_url'] = $image_url;
     252         $get_post_date['desc']      = $desc;
     253        }
     254         
     255
     256         return $get_post_date;
     257    }
    194258
    195259if ( ! function_exists( 'trev_csmap_listing_auto_share_post' ) ) {
     
    335399            // If Drip feed enabled
    336400            if ( $auto_schedule_share ) {
     401
    337402                $fb_page_ids       = implode( ',', $page_ids );
    338403                $current_time_zone = get_option( 'timezone_string' );
     
    343408
    344409                if ( $dripfeed_schedule > $date_now ) {
     410                   
    345411                    $date_time = date( 'Y-m-d' ) . ' ' . $dripfeed_schedule;
    346412
    347413                } else {
     414
    348415                    date( 'Y-m-d', strtotime( date( 'Y-m-d' ) . ' +1 days' ) );
    349416                    $tomorrow  = date( 'Y-m-d', strtotime( '+1 days' ) );
     
    370437                if ( $schedule_post_id > 0 ) {
    371438
    372                     update_post_meta( $schedule_post_id, 'revoice_scheduled', $date_time );
    373                     update_post_meta( $schedule_post_id, 'revoice_scheduled_status', 'scheduled' );
    374                     update_post_meta( $schedule_post_id, 'revoice_scheduled_post_id', $post_id );
    375                     update_post_meta( $schedule_post_id, 'revoice_post_type', $post_type );
    376                     update_post_meta( $post_id, 'revoice_scheduled_id', $schedule_post_id );
    377                     update_post_meta( $post_id, 'revoice_sharing_status', $status );
    378                     update_post_meta( $schedule_post_id, 'revoice_scheduled_page_id', $fb_page_ids );
     439                update_post_meta( $schedule_post_id, 'revoice_scheduled', $date_time );
     440                update_post_meta( $schedule_post_id, 'revoice_scheduled_status', 'scheduled' );
     441                update_post_meta( $schedule_post_id, 'revoice_scheduled_post_id', $post_id );
     442                update_post_meta( $schedule_post_id, 'revoice_post_type', $post_type );
     443                update_post_meta( $post_id, 'revoice_scheduled_id', $schedule_post_id );
     444                update_post_meta( $post_id, 'revoice_sharing_status', $status );
     445                update_post_meta( $schedule_post_id, 'revoice_scheduled_page_id', $fb_page_ids);
     446
    379447                }
    380448            }
     
    581649function trev_csmap_licence_version_url() {
    582650
    583     $current_domain = home_url();
     651    $current_domain = 'https://projects.theglobalwebdev.com/real-estate-voice-content';
     652    //$current_domain = home_url();
    584653    $url            = preg_replace( '(^https?://)', '', $current_domain );
    585654    $response       = wp_remote_get(
     
    11401209            $listing_details['map_address'] = $addressStreetNumber . $addressStreet . $addressSuburb . $addressPostcode . $addressState;
    11411210
    1142         }elseif( isset($general_tab_options['website_platform']) && 'Easy Property Listings' == $general_tab_options['website_platform'] ) {
    1143 
    1144             $listing_details['bedroom']     = get_post_meta( $post_id, 'property_bedrooms', true );
    1145             $listing_details['bathroom']    = get_post_meta( $post_id, 'property_bathrooms', true );
    1146             $listing_details['garage']      = get_post_meta( $post_id, 'property_garage', true );
    1147 
    1148             $property_sold_price            = get_post_meta( $post_id, 'property_sold_price', true );
    1149 
    1150             if ( !empty( $property_sold_price ) ) {
    1151 
    1152                 $listing_details['price']   = $property_sold_price;
    1153             }else{
    1154 
    1155                 $listing_details['price']   = get_post_meta( $post_id, 'property_price_view', true );
    1156             }
    1157 
    1158             $listing_details['name']        = get_post_meta( $post_id, 'property_agent', true );
    1159 
    1160             $listing_details['phone']       = get_post_meta( $post_id, 'property_owner', true );
    1161 
    1162             $addressStreetNumber = get_post_meta( $post_id, 'property_address_street_number', true );
    1163 
    1164 
    1165             $addressStreet    = get_post_meta( $post_id, 'property_address_street', true );
    1166             $addressSuburb    = get_post_meta( $post_id, 'property_address_suburb', true );
    1167             $addressState     = get_post_meta( $post_id, 'property_address_state', true );
    1168             $addressPostcode  = get_post_meta( $post_id, 'property_address_postal_code',true );
    1169             $property_country = get_post_meta( $post_id, 'property_address_country',true );
    1170            
    1171             if ( ! empty( $addressStreetNumber ) ) {
    1172                 $addressStreetNumber .= ', ';
    1173             }
    1174 
    1175             if ( ! empty( $addressStreet ) ) {
    1176                 $addressStreet .= ', ';
    1177             }
    1178 
    1179             if ( ! empty( $addressSuburb ) ) {
    1180                 $addressSuburb .= ', ';
    1181             }
    1182 
    1183             if ( ! empty( $addressState ) ) {
    1184                 $addressState .= ', ';
    1185             }
    1186 
    1187             if ( ! empty( $addressPostcode ) && ! empty( $property_country ) ) {
    1188                 $property_country .= ', ';
     1211
     1212        }elseif( isset($general_tab_options['website_platform']) && 'Agentpoint' == $general_tab_options['website_platform'] ) {
     1213
     1214            global $wpdb;
     1215
     1216            if('property' == $revoice_post_type){
     1217
     1218                $properties = 'properties';
     1219               
     1220                $qry_post = "SELECT * FROM $properties WHERE id=$post_id";
     1221
     1222                $posts = $wpdb->get_results( $qry_post );
     1223                if(!empty($posts)){
     1224                    $listing_details['bedroom']  = $posts[0]->bedrooms;
     1225                    $listing_details['bathroom'] = $posts[0]->bathrooms;
     1226                    $listing_details['garage']   = $posts[0]->garage;
     1227
     1228                    $listing_details['price']    = $posts[0]->price;
     1229
     1230                    if ( empty( $listing_details['price'] ) ) {
     1231
     1232                        $listing_details['price'] = $posts[0]->display_price_text;
     1233                    }
     1234
     1235                    $addressStreetNumber = $posts[0]->street_number;
     1236
     1237                    $addressStreet   = $posts[0]->street;
     1238                    $addressSuburb   = $posts[0]->suburb;
     1239                    $addressPostcode = $posts[0]->postcode;
     1240                    $addressState    = $posts[0]->state;
     1241
     1242                    if ( ! empty( $addressStreetNumber ) ) {
     1243                        $addressStreetNumber .= ',';
     1244                    }
     1245
     1246                    if ( ! empty( $addressStreet ) ) {
     1247                        $addressStreet .= ',';
     1248                    }
     1249
     1250                    if ( ! empty( $addressSuburb ) ) {
     1251                        $addressSuburb .= ',';
     1252                    }
     1253
     1254                    if ( ! empty( $addressPostcode ) && ! empty( $addressState ) ) {
     1255                        $addressPostcode .= ',';
     1256                    }
     1257
     1258                    $listing_details['map_address'] = $addressStreetNumber . $addressStreet . $addressSuburb . $addressPostcode . $addressState;
     1259
     1260                }
     1261               
     1262
    11891263            }
    11901264       
    1191             $listing_details['map_address'] = $addressStreetNumber . $addressStreet . $addressSuburb . $addressState . $property_country . $addressPostcode;
     1265
    11921266
    11931267        }else{
     
    12431317     * @since 1.0.0
    12441318     **/
    1245     function trev_csmap_admin_footer() {?>
    1246 
     1319    function trev_csmap_admin_footer() {
     1320        ?>
    12471321        <style type="text/css">
    12481322            .revoice_activation_notice.error .notice-wrap {
     
    12541328        <script type="text/javascript">
    12551329              jQuery( "ul#adminmenu a[href='<?php echo TREV_CSMAP_HELP_LINK ?>']" ).attr( 'target', '_blank' );
     1330
    12561331        </script>
    12571332        <?php
    12581333    }
    12591334}
     1335
    12601336
    12611337/**
     
    12881364             $countryName = 'Australia';
    12891365            break;
    1290         case 'US':
    1291              $countryName = 'United States of America';
     1366        case 'USA':
     1367             $countryName = 'USA';
    12921368            break;
    12931369        case 'UK':
    1294              $countryName = 'United Kingdom';
     1370             $countryName = 'UK';
    12951371            break;
    12961372        case 'NZ':
     
    13391415
    13401416}
     1417
  • the-real-estate-voice/trunk/includes/hooks.php

    r2742727 r2749653  
    5757
    5858                $revoice_platform = get_post_meta( $post->ID, 'revoice_platform', true );
     59                $general_tab_option_name = get_option( 'general_tab_option_name' );
    5960
    6061                if ( 'instagram' == $revoice_platform ) {
     
    132133                    $page_id                = get_post_meta( $id, 'revoice_scheduled_page_id', true );
    133134                    $post_id                = get_post_meta( $id, 'revoice_scheduled_post_id', true );
     135                   
    134136                    $sharable_agent         = get_post_meta( $id, 'revoice_scheduled_agenet_details', true );
     137
    135138                    $revoice_post_type      = get_post_meta( $id, 'revoice_post_type', true );
     139                   
    136140                    $revoice_listing_detail = '';
    137141
    138                     if ( 'listing' == $revoice_post_type ) {
     142                    if ( 'listings' == $revoice_post_type || 'listing' == $revoice_post_type || 'property' == $revoice_post_type ) {
    139143
    140144                        $revoice_listing_detail = get_post_meta( $id, 'revoice_listing_detail', true );
     
    171175                        if ( 0 == $result->error ) {
    172176
    173                             update_post_meta( $post_id, 'revoice_shared', current_datetime() );
    174                             update_post_meta( $post_id, 'revoice_sharing_status', $status );
     177                            if( isset( $general_tab_option_name['website_platform'] ) && 'Agentpoint' == $general_tab_option_name['website_platform'] ) {
     178
     179                                trev_csmap_update_preperty_meta( $post_id, 'revoice_shared', current_datetime() );
     180                                trev_csmap_update_preperty_meta( $post_id, 'revoice_sharing_status', $status );
     181
     182                            }else{
     183                                update_post_meta( $post_id, 'revoice_shared', current_datetime() );
     184                                update_post_meta( $post_id, 'revoice_sharing_status', $status );   
     185                            }
     186                           
    175187
    176188                        } else {
     
    228240    function trev_csmap_og_meta() {
    229241
    230         global $post;
    231 
    232         $revcp_settings_options = get_option( 'auto_social_option_name' );
     242        global $post, $rev_post_types, $wpdb;
     243       
     244        $revcp_settings_options  = get_option( 'auto_social_option_name' );
     245        $general_tab_option_name = get_option( 'general_tab_option_name' );
     246       
     247        if( isset( $general_tab_option_name['website_platform'] ) && 'Agentpoint' == $general_tab_option_name['website_platform'] ) {
     248           
     249            remove_action( 'aioseo_meta_views', 'aioseo_filter_meta_views');
     250
     251        }
     252   
    233253
    234254        if ( is_array( $revcp_settings_options ) ) {
    235 
     255            $featured_img_url='';
    236256            if ( isset( $revcp_settings_options['add_open_graph_tags_1'] ) && 1 == trim( $revcp_settings_options['add_open_graph_tags_1'] ) ) {
    237257
    238                 if ( is_single() ) {
    239 
    240                     $postsubtitrare  = get_post_meta( $post->ID, 'id-subtitrare', true );
     258
     259                if ( isset( $general_tab_option_name['website_platform'] ) && 'SiteLoft' == $general_tab_option_name['website_platform'] ) {
     260
     261                    $post_id = $post->ID;
     262
     263                    $hero_image_thumbs = get_post_meta( $post->ID, 'thumbnails', true );
     264                    if(!empty($hero_image_thumbs) && ! empty( $hero_image_thumbs[0]['full'] )){
     265                        $featured_img_url = $hero_image_thumbs[0]['full'];
     266                    }else{
     267                        $hero_image_full = get_post_meta( $post_id, 'images', true );
     268                        if(!empty($hero_image_full)){
     269                            $featured_img_url = $hero_image_full[0]['full'];   
     270                        }
     271                    }
     272                    if( strpos($featured_img_url, '//') !== false ){
     273
     274                        $featured_img_url = str_replace('//', 'https://',$featured_img_url);   
     275
     276                    }
     277                   
     278       
     279                }elseif (isset( $general_tab_option_name['website_platform'] ) && 'Agentpoint' == $general_tab_option_name['website_platform']) {
     280
     281
     282                    $actual_link = "https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
     283
     284                    $parts = parse_url($actual_link);
     285
     286                    $id = explode('/', $parts['path']);
     287
     288                    $post_id = end($id);
     289                   
     290                    if(!empty($post_id)){
     291
     292                        $qry_img ="SELECT * FROM attachments WHERE parent_id = $post_id";   
     293                        $image_res = $wpdb->get_results( $qry_img );   
     294                    }
     295   
     296                   
     297
     298                    if(!empty($image_res)){
     299                        $featured_img_url= $image_res[0]->url;
     300                    }
     301
     302                    if(!empty($post_id)){
     303                        $qry_post="SELECT * FROM properties WHERE id=$post_id";
     304                        $qry_res = $wpdb->get_results( $qry_post );
     305                    }
     306                   
     307                    if(!empty($qry_res)){
     308                        $title     = $qry_res[0]->headline;
     309                        $content   = $qry_res[0]->description;
     310                        $permalink = get_site_url().'/'.$post_id;   
     311                    }
     312                   
     313
     314                    $featured_img_url = $featured_img_url.'.png';
     315                   
     316                       
     317                }
     318                else{
     319                     $fb_image = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'thumbnail' );
     320                    $post_id = $post->ID;
     321
     322                    $featured_img_url = $fb_image[0];
     323
     324                    $title = get_the_title($post_id);
     325
     326                    $permalink = get_site_url().'/'.$post_id;
     327
     328                    $postsubtitrare  = get_post_meta( $post_id, 'id-subtitrare', true );
    241329                    $post_subtitrare = get_post( $postsubtitrare );
    242330                    $content         = trev_csmap_revoice_limit( strip_tags( $post_subtitrare->post_content ), 297 );
     331                }
     332
     333                $postType = get_post_type();
     334
     335                if ( in_array($postType, $rev_post_types) || is_single() ) {
     336                               
    243337                    ?>
    244         <meta property="og:title" content="<?php the_title(); ?>"/>
     338
     339        <meta property="og:title" content="<?php echo esc_html($title); ?>"/>
    245340        <meta property="og:description" content="<?php echo esc_attr( $content ); ?>" />
    246         <meta property="og:url" content="<?php the_permalink(); ?>"/>
    247                     <?php $fb_image = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'thumbnail' ); ?>
    248                     <?php if ( $fb_image ) : ?>
    249         <meta property="og:image" content="<?php echo esc_url( $fb_image[0] ); ?>" />
    250         <?php endif; ?>
    251         <meta property="og:type" content="
    252                     <?php
    253                     if ( is_single() || is_page() ) {
    254                             echo esc_attr( 'article' );
    255                     } else {
    256                         echo esc_attr( 'website' );}
    257                     ?>
    258 " />
     341        <meta property="og:url" content="<?php echo esc_url($permalink); ?>"/>
     342        <meta property="og:image" content="<?php echo esc_url( $featured_img_url ); ?>" />
     343        <meta property="og:image:url" content="<?php echo esc_url( $featured_img_url ); ?>" />
     344        <meta property="og:image:secure_url" content="<?php echo esc_url( $featured_img_url );?>" />
     345
     346        <meta property="og:image:type" content="image/png" />
     347        <meta property="og:image:width" content="1120">
     348        <meta property="og:image:height" content="500">
     349       
     350        <meta property="og:type" content="<?php  echo esc_attr('article');?>" />
    259351        <meta property="og:site_name" content="<?php bloginfo( 'name' ); ?>"/>
    260352                    <?php
     
    264356    }
    265357}
    266 add_action( 'wp_head', 'trev_csmap_og_meta' );
     358add_action( 'wp_head', 'trev_csmap_og_meta',1 );
     359
  • the-real-estate-voice/trunk/includes/order-tab.php

    r2744106 r2749653  
    4949        $original_feed_ex = implode('&', $original_ex);
    5050
    51         $original_feed = $original_feed_ex.$current_page;
     51        $original_feed  = $original_feed_ex.$current_page;
    5252        $original_rss   = simplexml_load_file( $original_feed );   
    5353    }
    5454
    55 
    5655   
    5756    $final_feed     = TREV_CSMAP_FEED_URL . $current_page;
    58                
     57
    5958    $rss            = simplexml_load_file( $final_feed );
    60 
    61            
     59                   
    6260    $checked        = '';
    6361    $eparm          = '';
     
    6563   
    6664
    67 if ( isset( $_GET['include_exists'] ) ) {
    68     $checked        = 'checked';
    69     $eparm          = '&include_exists=1';
    70     $include_exists = 1;
    71 } else {
    72     if ( ! trev_csmap_is_pro_license_plugin() ) {
    73         $checked = 'checked';
     65    if ( isset( $_GET['include_exists'] ) ) {
     66        $checked        = 'checked';
     67        $eparm          = '&include_exists=1';
     68        $include_exists = 1;
     69    } else {
     70        if ( ! trev_csmap_is_pro_license_plugin() ) {
     71            $checked = 'checked';
     72        }
    7473    }
    75 }
    7674
    7775
     
    166164    <div class="country-library-section <?php echo (trev_csmap_is_pro_license_plugin())? 'premium-ver':''; ?>">
    167165        <?php
     166       
    168167            $countryCode = trev_selected_country();
    169             $country     = trev_csmap_country_name($countryCode); ?>
    170 
    171             <span><?php echo esc_html($country).' ' ;?>
     168            $country     = trev_csmap_country_name($countryCode);
     169
     170        ?>
     171
     172            <span>
     173                <?php echo esc_html($country).' ' ;?>
    172174                <?php echo esc_html('Library','the-real-estate-voice');?></span>
    173175            <a href="<?php echo esc_url( admin_url('admin.php?page=trev-csmap-settings&tab=general'))?>" title="<?php echo esc_attr($country);?>">
     
    188190            <?php
    189191
    190             $rss_items = array();       
    191             $icount    = 0;
     192            $rss_items   = array();     
     193            $icount      = 0;
    192194            $feed_count  = 0;
    193            
    194195
    195196            foreach ( $original_rss->channel->item as $item ) {
     197
    196198                $alreay_exist = post_exists( $item->title, '', '', 'post' );
    197                
    198                 if ( $alreay_exist && !isset($_GET['include_exists'])) {
     199
     200                if( $alreay_exist && !isset($_GET['include_exists']) ) {
    199201                    continue;
    200202                }
     
    204206            }
    205207
    206            
    207208            $start = 1;
    208209           
    209             if(!empty($csrp_paged) && $csrp_paged > 1) {
     210            if( !empty($csrp_paged) && $csrp_paged > 1 ) {
     211
    210212                $start = $start + $post_per_page * $csrp_paged;
    211213            }
    212214           
     215            if( $feed_count >= 50 ){
     216
     217                $new_rss_items = array_slice( $rss_items, $start, $post_per_page );
     218
     219            }else{
     220
     221                $new_rss_items = $original_rss->channel->item; 
     222            }
     223           
     224
     225            $num_pages      = ceil( $feed_count / $post_per_page );         
    213226               
    214                
    215             $new_rss_items = array_slice( $rss_items, $start, $post_per_page );
    216            
    217             $num_pages = ceil( $feed_count / $post_per_page );         
    218                
    219             if(!empty($new_rss_items)){
     227            if( !empty($new_rss_items) ){
    220228
    221229                foreach ( $new_rss_items as $item ) {
  • the-real-estate-voice/trunk/includes/share-listing-tab.php

    r2742727 r2749653  
    11<?php
    2 
    3 if ( ! defined( 'ABSPATH' ) ) {
    4     exit;
    5 }
    6 
    7 global $rev_post_types;
    8 
    9 $tax_query               = array( 'relation' => 'OR' );
    10 $general_tab_option_name = get_option( 'general_tab_option_name' );
    11 
    12 if ( isset( $general_tab_option_name['website_platform'] ) && 'SiteLoft' == $general_tab_option_name['website_platform'] ) {
    13     $listing = 'listings';
    14 }
    15 elseif ( isset( $general_tab_option_name['website_platform'] ) && 'Easy Property Listings' == $general_tab_option_name['website_platform'] ) {
    16     $listing = 'property';
    17 }else {
    18     $listing = 'listing';
    19 }
     2    global $wpdb;
     3
     4    if ( ! defined( 'ABSPATH' ) ) {
     5        exit;
     6    }
     7
     8    global $rev_post_types;
     9
     10    $tax_query               = array( 'relation' => 'OR' );
     11    $general_tab_option_name = get_option( 'general_tab_option_name' );
     12
     13    $agentPoint = false;
     14    $siteloft   = false;
     15    if ( isset( $general_tab_option_name['website_platform'] ) && 'Agentpoint' == $general_tab_option_name['website_platform'] ) {
     16        $agentPoint = true;
     17
     18    }
     19
     20    if ( isset( $general_tab_option_name['website_platform'] ) && 'SiteLoft' == $general_tab_option_name['website_platform'] ) {
     21
     22        $listing = 'listings';
     23        $siteloft = true;
     24       
     25    }
     26    elseif ( isset( $general_tab_option_name['website_platform'] ) && ( 'Easy Property Listings' == $general_tab_option_name['website_platform'] || $agentPoint )) {
     27
     28
     29        $listing = 'property';
     30
     31    }else {
     32
     33        $listing = 'listing';
     34
     35    }
    2036
    2137    $args = array(
     
    2743    );
    2844
     45
     46
     47
    2948    if ( isset( $_GET['category'] ) ) {
    3049        $selected = sanitize_text_field( wp_unslash( $_GET['category'] ) );
     
    3453
    3554
    36     if ( isset( $_GET['type'] ) ) {
    37         $current_post_type = sanitize_text_field( wp_unslash( $_GET['type'] ) );
    38 
    39         if ( 'all' != $current_post_type ) {
    40             $args['post_type'] = $current_post_type;
    41         }
    42        
    43     } else {
    44         $current_post_type = esc_html__( 'listing', 'the-real-estate-voice' );
    45     }
     55   
     56    $current_post_type = $listing;
     57
    4658
    4759    if ( isset( $_GET['status'] ) && ! empty( $_GET['status'] ) ) {
     
    6274    );
    6375
    64     $taxonomies_objects = get_object_taxonomies( $current_post_type, 'objects' );
    65 
    66     if ( ! empty( $taxonomies_objects ) ) {
    67         $taxonomies = get_taxonomies( array( 'object_type' => array( $current_post_type ) ) );
    68         foreach ( $unset_cat as  $taxonomy ) {
    69             unset( $taxonomies[ $taxonomy ] );
    70 
    71         }
    72 
    73         foreach ( $taxonomies as  $taxonomy ) {
    74             $hierarchical = $taxonomies_objects[ $taxonomy ]->hierarchical;
    75             if ( $hierarchical ) {
    76                 $args_taxonomy = array(
    77                     'taxonomy'   => $taxonomy,
    78                     'orderby'    => 'name',
    79                     'order'      => 'ASC',
    80                     'hide_empty' => false,
    81                 );
    82 
    83 
    84                 if ( $selected != 'all' ) {
    85                     $tax_query[]       = array(
    86                         'taxonomy' => $taxonomy,
    87                         'field'    => 'id',
    88                         'terms'    => $selected,
    89                         'operator' => 'IN',
     76
     77   
     78       
     79
     80    if($agentPoint){
     81       
     82        $cate_ap      = array();
     83        $categories   = array();   
     84        $properties   = 'properties';
     85        $qry_property = "SELECT property_type FROM ".$properties;
     86        $res_property = $wpdb->get_results( $qry_property );
     87       
     88        foreach ($res_property as $key => $value) {
     89            $cate_ap[] = $value->property_type;
     90        }
     91
     92        $cate_ap = array_unique($cate_ap);
     93
     94        foreach ($cate_ap as $key => $cate) {
     95           
     96            $categories_ap   = new stdClass(); 
     97            $categories_ap->term_id   = $cate;
     98            $categories_ap->name = $cate;
     99            $categories[] = $categories_ap;
     100
     101        }
     102
     103    }
     104
     105    if($siteloft) {
     106
     107        $cate_ap      = array();
     108        $categories   = array();
     109
     110        $listCategories = json_decode(str_replace('\\', '', get_option('siteloft_settings_filter_category_options')));
     111
     112        if (($listCategories = get_option('siteloft_settings_filter_category_options'))) {
     113            $listCategories = json_decode(str_replace('\\', '', $listCategories), true);
     114        }
     115
     116        $listCategories = array_column($listCategories ?: [], 'value', 'key');
     117
     118        $listCategories = is_array($listCategories) ? $listCategories : [];
     119
     120        if(!empty($listCategories)){
     121            foreach ($listCategories as $key => $cate_sl) {
     122                $categories_ap   = new stdClass(); 
     123                $categories_ap->term_id   = $cate_sl;
     124                $categories_ap->name = $cate_sl;
     125                $categories[] = $categories_ap;
     126            }
     127        }
     128
     129       
     130
     131        if ( $selected != 'all' ) {
     132            $args['meta_query'] =  array(
     133                'relation' => 'OR',
     134                array(
     135                    'key'       => 'subcategories',
     136                    'value'     => $selected,
     137                    'compare'   => 'LIKE',
     138                )       
     139            );
     140        }
     141
     142
     143    }
     144    else{
     145
     146        $taxonomies_objects = get_object_taxonomies( $current_post_type, 'objects' );
     147
     148        if ( ! empty( $taxonomies_objects ) ) {
     149
     150            $taxonomies=get_taxonomies( array( 'object_type' => array( $current_post_type ) ) );
     151            foreach ( $unset_cat as  $taxonomy ) {
     152                unset( $taxonomies[ $taxonomy ] );
     153
     154            }
     155
     156            foreach ( $taxonomies as  $taxonomy ) {
     157                $hierarchical = $taxonomies_objects[ $taxonomy ]->hierarchical;
     158                if ( $hierarchical ) {
     159                    $args_taxonomy = array(
     160                        'taxonomy'   => $taxonomy,
     161                        'orderby'    => 'name',
     162                        'order'      => 'ASC',
     163                        'hide_empty' => false,
    90164                    );
    91                     $args['tax_query'] = $tax_query;
    92                 }
    93             }
    94         }
    95         $categories = get_categories( $args_taxonomy );
    96     }
    97 
     165
     166
     167                    if ( $selected != 'all' ) {
     168                        $tax_query[]       = array(
     169                            'taxonomy' => $taxonomy,
     170                            'field'    => 'id',
     171                            'terms'    => $selected,
     172                            'operator' => 'IN',
     173                        );
     174                        $args['tax_query'] = $tax_query;
     175                    }
     176                }
     177            }
     178
     179            $categories = get_categories( $args_taxonomy );
     180
     181        }
     182    }
    98183
    99184    if ( isset( $_GET['post_status'] ) ) {
     
    122207        }
    123208    }
    124 
    125 
    126209
    127210    $reset = false;
     
    144227            <select name="category" id="category" data-url="<?php echo esc_url( admin_url( 'admin.php?page=trev-csmap-social-media&tab=share_listing&paged=1' ) ); ?>">
    145228
    146                 <option value="all"><?php esc_html_e( 'All Categories', 'the-real-estate-voice' ); ?></option>
     229                <option value="all">
     230                    <?php esc_html_e( 'All Categories', 'the-real-estate-voice' ); ?></option>
    147231
    148232                <?php
     
    155239                    ?>
    156240                <option value="<?php echo esc_attr( $cat->term_id ); ?>" <?php echo esc_attr( $select ); ?>><?php echo esc_html( $cat->name ); ?></option>
    157                 <?php } ?> 
     241                <?php } ?>
    158242            </select>
    159243        </div>
     
    187271        <?php if ( $reset ) { ?>
    188272            <div class="category_filter">
    189                 <a href="<?php echo esc_url( admin_url( 'admin.php?page=trev-csmap-social-media&tab=share' ) ); ?>" class="button button-primary"><?php esc_html_e( 'Reset Filter', 'the-real-estate-voice' ); ?></a>
     273               
     274                <a href="<?php echo esc_url( admin_url( 'admin.php?page=trev-csmap-social-media&tab=share_listing' ) ); ?>" class="button button-primary"><?php esc_html_e( 'Reset Filter', 'the-real-estate-voice' ); ?>
     275                </a>
     276
    190277            </div>
    191278        <?php } ?>
     
    198285
    199286    $icount    = 0;
    200     $posts     = get_posts( $args );
    201     $eparm     = '';
    202     $args_temp = $args;
    203     unset( $args_temp['posts_per_page'] );
    204 
    205     $args_temp['posts_per_page'] = -1;
    206 
    207     $posts_temp          = get_posts( $args_temp );
    208     $post_count          = count( $posts_temp );
     287   
     288    if($agentPoint){
     289   
     290        $properties = 'properties';
     291        $attachment = 'attachments';
     292       
     293        if(!empty($get_status) && 'all' == $get_status && 'all' != $selected && isset($_GET['filter'])){
     294            $qry_post="SELECT * FROM $properties WHERE property_type='$selected'"; 
     295       
     296        }elseif ( isset($get_status) && 'all' != $get_status  && !empty( $get_status)  && isset($_GET['filter']) && 'all' == $selected  ) {
     297           
     298            $qry_post="SELECT * FROM $properties as p LEFT JOIN property_meta as m ON p.id = m.property_id WHERE m.meta_value='$get_status' AND m.meta_key='revoice_sharing_status'";   
     299       
     300
     301        }elseif ( isset($_GET['status'] ) && isset($_GET['category']) && 'all' != $selected   ) {
     302           
     303            $qry_post="SELECT * FROM $properties as p LEFT JOIN property_meta as m ON p.id = m.property_id WHERE p.property_type='$selected' AND m.meta_value='$get_status' AND m.meta_key='revoice_sharing_status'";   
     304           
     305        }else{
     306
     307            $qry_post="SELECT * FROM ".$properties;
     308
     309        }
     310       
     311               
     312        $posts = $wpdb->get_results( $qry_post );
     313       
     314        $post_count          = count( $posts );
     315    }else{
     316        $posts     = get_posts( $args );   
     317        $eparm     = '';
     318        $args_temp = $args;
     319        unset( $args_temp['posts_per_page'] );
     320
     321        $args_temp['posts_per_page'] = -1;
     322
     323        $posts_temp          = get_posts( $args_temp );
     324        $post_count          = count( $posts_temp );
     325    }
     326   
     327   
     328   
    209329    $general_tab_options = get_option( 'general_tab_option_name' );
    210330
     
    217337
    218338    $num_pages = ceil( $post_count / $post_per_page );
     339    $revoice_scheduled_id = '';
     340       
    219341    if ( $post_count > 0 ) {
    220342
    221         foreach ( $posts as $post ) {
     343        foreach ( $posts as $key => $post ) {
    222344            $last_shared = '';
    223             $post_id     = $post->ID;
    224             if ( metadata_exists( 'post', $post_id, 'revoice_sharing_status' ) ) {
    225                 $status = get_post_meta( $post_id, 'revoice_sharing_status', true );
    226             } else {
    227                 update_post_meta( $post_id, 'revoice_sharing_status', 'Never Shared' );
    228                 $status = esc_html__( 'Never Shared', 'the-real-estate-voice' );
    229             }
    230 
    231 
    232             $featured_img_url     = get_the_post_thumbnail_url( $post_id, 'full' );
    233             $categories           = get_the_category( $post_id );
    234             $revoice_scheduled_id = get_post_meta( $post_id, 'revoice_scheduled_id', true );
    235             $parent_content       = get_the_excerpt( $post_id );
    236             $listing_details      = trev_csmap_get_web_plateform_data($current_post_type, $post_id);
    237    
     345            $featured_img_url='';
     346           
     347            if($agentPoint){
     348                   
     349                $post_id = $post->id;
     350                $qry_img ="SELECT * FROM ".$attachment." WHERE parent_id =$post_id";
     351                $image_res = $wpdb->get_results( $qry_img );
     352
     353                if(!empty($image_res)){
     354                    $featured_img_url= $image_res[0]->url;
     355                }
     356           
     357                $permalink = get_site_url().'/'.$post_id;
     358                $title = $post->headline;
     359                $description = $post->description;
     360                $listing_details=trev_csmap_get_web_plateform_data($current_post_type, $post_id);
     361
     362                $listing_details['listing_link']    = $permalink;
     363                $listing_details['listing_desc']    = $description;
     364
     365           
     366                if ( trev_csmap_exist_preperty_meta( $post_id, 'revoice_shared' ) ) {
     367
     368                    $last_shared = trev_csmap_get_preperty_meta( $post_id, 'revoice_shared' );
     369                       
     370                    // if(!empty($revoice_shared)){
     371                    //  $last_shared    = date( 'd/m/Y', strtotime( $revoice_shared ) );   
     372                    // }
     373
     374                }
     375               
     376
     377                if ( trev_csmap_exist_preperty_meta( $post_id, 'revoice_sharing_status' ) ) {
     378                   
     379                    $status = trev_csmap_get_preperty_meta( $post_id, 'revoice_sharing_status', true );
     380       
     381                       
     382                } else {
     383
     384                    $res = trev_csmap_update_preperty_meta( $post_id, 'revoice_sharing_status', 'Never Shared' );
     385                    $status = esc_html__( 'Never Shared', 'the-real-estate-voice' );
     386                }
     387
     388                $revoice_scheduled_id = trev_csmap_get_preperty_meta( $post_id, 'revoice_scheduled_id' );   
     389
     390            }else{
     391
     392                $post_id    = $post->ID;
     393                $permalink  = get_permalink( $post_id );
     394                $title      = get_the_title( $post_id );
     395
     396                $featured_img_url     = get_the_post_thumbnail_url( $post_id, 'full' );
     397                if ( empty( $featured_img_url ) && isset( $general_tab_options['website_platform'] ) && 'SiteLoft' == $general_tab_options['website_platform'] ) {
     398
     399                    $hero_image_thumbs = get_post_meta( $post_id, 'thumbnails', true );
     400
     401                    if(!empty($hero_image_thumbs) && ! empty( $hero_image_thumbs[0]['full'] )){
     402
     403                        $featured_img_url = $hero_image_thumbs[0]['full'];
     404
     405                    }else{
     406
     407                        $hero_image_full = get_post_meta( $post_id, 'images', true );
     408
     409                        if(!empty($hero_image_full)){
     410                            $featured_img_url = $hero_image_full[0]['full'];   
     411                        }
     412                    }
     413
     414                }
     415
     416                if($siteloft){
     417                    $categories     = get_post_meta($post_id,'subcategories',true);
     418               
     419                }else{
     420                    $categories     = get_the_category( $post_id );
     421                }
     422               
     423                $parent_content     = get_the_excerpt( $post_id );
     424
     425                if ( metadata_exists( 'post', $post_id, 'revoice_shared' ) ) {
     426                    $revoice_shared = get_post_meta( $post_id, 'revoice_shared', true );
     427                    $last_shared    = date( 'd/m/Y', strtotime( $revoice_shared->date ) );
     428                }
     429
     430                $listing_details    = trev_csmap_get_web_plateform_data($current_post_type, $post_id);
     431
     432                if ( metadata_exists( 'post', $post_id, 'revoice_sharing_status' ) ) {
     433
     434                    $status = get_post_meta( $post_id, 'revoice_sharing_status', true );
     435
     436                } else {
     437
     438                    update_post_meta( $post_id, 'revoice_sharing_status', 'Never Shared' );
     439                    $status = esc_html__( 'Never Shared', 'the-real-estate-voice' );
     440                }
     441               
     442                $revoice_scheduled_id = get_post_meta( $post_id, 'revoice_scheduled_id', true );
     443            }
     444
     445               
     446                $page_ids  = get_post_meta( $revoice_scheduled_id, 'revoice_scheduled_page_id', true );
     447
     448                $scheduled = get_post_meta( $revoice_scheduled_id, 'revoice_scheduled', true );
     449                if ( $scheduled < current_time( 'mysql' ) ) {
     450                    $scheduled = '';
     451                }
     452               
     453                $post_content = get_post( $revoice_scheduled_id );
     454
     455           
    238456            $bedroom_emoji = '';
    239457            if ( ! empty( $listing_details['bedroom'] ) ) {
     
    257475                $version_status = true;
    258476            }
    259 
    260             $page_ids  = get_post_meta( $revoice_scheduled_id, 'revoice_scheduled_page_id', true );
    261             $scheduled = get_post_meta( $revoice_scheduled_id, 'revoice_scheduled', true );
    262             if ( $scheduled < current_time( 'mysql' ) ) {
    263                 $scheduled = '';
    264             }
    265             $post_content = get_post( $revoice_scheduled_id );
     477   
    266478
    267479            $autshare = false;
    268 
    269             if ( metadata_exists( 'post', $post_id, 'revoice_shared' ) ) {
    270                 $revoice_shared = get_post_meta( $post_id, 'revoice_shared', true );
    271                 $last_shared    = date( 'd/m/Y', strtotime( $revoice_shared->date ) );
    272             }
    273 
    274480            ?>
    275481
    276         <div class="blog_item">
    277 
    278     <div class="blog_image">
    279         <img class="map_image" src="<?php echo esc_url( $featured_img_url ); ?>"></div> 
    280         <h3 class="map_date">
    281              
    282 
    283                 <?php
    284                 if ( ! empty( $last_shared ) && $last_shared != '' ) {
    285                     ?>
    286                 <span><?php esc_html_e( 'Last Shared: ', 'the-real-estate-voice' ); ?> <?php echo esc_html( $last_shared ); ?></span>
    287                 <span class="saperater">  <?php esc_html_e( '| ', 'the-real-estate-voice' ); ?> </span>
    288                 <?php } ?>
    289 
    290                 <?php
    291                 if ( $status != '' || ! empty( $status ) ) {
    292                     ?>
    293                 <span> <?php esc_html_e( 'Status: ', 'the-real-estate-voice' ); ?><?php echo esc_html( $status ); ?></span>
    294                 <?php } ?>
    295             </h3>
    296 
    297         <div class="blog_description social-media-desc">
    298 
    299         <h3 class="map_title">
    300                 <a href="<?php echo esc_url( get_permalink( $post_id ) ); ?>" class="" target="_blank">
    301                     <?php echo esc_html( get_the_title( $post_id ) ); ?>
    302                 </a>
    303             </h3>       
    304             <?php
    305             if ( is_array( $categories ) ) {
    306                 foreach ( $categories as $cat ) {
    307                     ?>
    308                     <div class="map_category">
    309                         <?php echo esc_html( $cat->cat_name ); ?>
    310                     </div>
    311                     <?php
    312                 }
    313             }
    314 
    315             ?>
    316 
    317 
    318             <div class="map_desc test">
    319             <?php
    320                 $get_content = $post->post_excerpt;
    321 
    322             if ( ! empty( $get_content ) ) {
    323                 echo wp_kses_post( $get_content );
    324             } else {
    325                 $get_content = apply_filters( 'the_content', $post->post_content );
    326                 $get_content = preg_replace( '~(?:\[/?)[^/\]]+/?\]~s', '', $get_content );
    327 
    328                 echo wp_kses_post( $get_content );
    329             }
    330 
    331             ?>
    332                
    333             </div>
    334           <div class="map_content" style="display:none;"><?php echo wp_kses_post( $post->post_content ); ?></div>
    335            
    336 
    337         </div>   
    338 
    339 
    340             <div class="blog_action">
    341                 <?php
    342 
    343                 if ( 'Currently scheduled' == $status && trev_csmap_is_pro_license_plugin() ) {
    344                     ?>
    345 
    346                        <button class="button button-primary edit_schedule edit_post_cl" data-bedroom-emoji="<?php echo esc_attr( $bedroom_emoji ); ?>" data-event_time="<?php echo esc_attr( $scheduled ); ?>" data-pageid="<?php echo esc_attr( $page_ids ); ?>" data-id="<?php echo esc_attr( $revoice_scheduled_id ); ?>" data-post-id="<?php echo esc_attr( $post->ID ); ?>" data-event="<?php echo esc_attr( get_the_title( $revoice_scheduled_id ) ); ?>" data-bathroom-emoji="<?php echo esc_attr( $bathroom_emoji ); ?>" data-garage-emoji="<?php echo esc_attr( $garage_emoji ); ?>"  data-post-type="<?php echo esc_attr( $current_post_type ); ?>" data-address="<?php echo esc_attr( $listing_details['map_address'] ); ?>" data-listing-link="<?php echo esc_attr( $listing_details['listing_link'] ); ?>" data-bedroom="<?php echo esc_attr( $listing_details['bedroom'] ); ?>" data-bathroom="<?php echo esc_attr( $listing_details['bathroom'] ); ?>" data-garage="<?php echo esc_attr( $listing_details['garage'] ); ?>" data-image="<?php echo esc_url( $featured_img_url ); ?>" data-schedule-id="<?php echo esc_attr( $revoice_scheduled_id ); ?>" data-id="<?php echo esc_attr( $post->ID ); ?>" data-title="<?php echo esc_attr( get_the_title( $post_id ) ); ?>" data-listing-details='<?php echo esc_attr( $js_code ); ?>' data-content-page="<?php esc_attr( 'content' ); ?>" data-parent-content="<?php echo esc_attr( $listing_details['listing_desc'] ); ?>" data-desc="<?php echo wp_kses_post( $post_content->post_content ); ?>" ><?php esc_html_e( 'Edit', 'the-real-estate-voice' ); ?></button>
    347 
    348                    <?php } else { ?>
    349                     <button class="button button-primary map_share_btn" data-bedroom-emoji="<?php echo esc_attr( $bedroom_emoji ); ?>" data-bathroom-emoji="<?php echo esc_attr( $bathroom_emoji ); ?>" data-garage-emoji="<?php echo esc_attr( $garage_emoji ); ?>"    data-post-type="<?php echo esc_attr( $current_post_type ); ?>" data-address="<?php echo esc_attr( $listing_details['map_address'] ); ?>" data-listing-link="<?php echo esc_url( $listing_details['listing_link'] ); ?>" data-bedroom="<?php echo esc_attr( $listing_details['bedroom'] ); ?>" data-bathroom="<?php echo esc_attr( $listing_details['bathroom'] ); ?>" data-garage="<?php echo esc_attr( $listing_details['garage'] ); ?>" data-image="<?php echo esc_url( $featured_img_url ); ?>" data-schedule-id="<?php echo esc_attr( $revoice_scheduled_id ); ?>" data-id="<?php echo esc_attr( $post->ID ); ?>" data-title="<?php echo esc_attr( get_the_title( $post_id ) ); ?>" data-listing-details='<?php echo esc_attr( $js_code ); ?>' data-plugin-version="<?php esc_attr_e( $version_status ); ?>" data-desc="<?php echo esc_html( strip_tags( $get_content ) ); ?>" ><?php esc_html_e( 'Share', 'the-real-estate-voice' ); ?></button>
    350 
    351                 <?php } ?>
    352 
    353                 </div> 
    354 
    355             </div>
     482            <div class="blog_item <?php echo esc_attr($post_id)?>">
     483
     484                <div class="blog_image">
     485                    <img class="map_image" src="<?php echo esc_url( $featured_img_url ); ?>"></div> 
     486                    <h3 class="map_date">
     487
     488
     489                        <?php
     490                        if ( ! empty( $last_shared ) && $last_shared != '' ) {
     491                            ?>
     492                            <span><?php esc_html_e( 'Last Shared: ', 'the-real-estate-voice' ); ?> <?php echo esc_html( $last_shared ); ?></span>
     493                            <span class="saperater">  <?php esc_html_e( '| ', 'the-real-estate-voice' ); ?> </span>
     494                        <?php } ?>
     495
     496                        <?php
     497                        if ( $status != '' || ! empty( $status ) ) {
     498                            ?>
     499                            <span> <?php esc_html_e( 'Status: ', 'the-real-estate-voice' ); ?><?php echo esc_html( $status ); ?></span>
     500                        <?php } ?>
     501                    </h3>
     502
     503                    <div class="blog_description social-media-desc">
     504
     505                        <h3 class="map_title">
     506                            <a href="<?php echo esc_url( $permalink ); ?>" class="" target="_blank">
     507                                <?php echo esc_html( $title ); ?>
     508                            </a>
     509                        </h3>       
     510                        <?php
     511                       
     512                        if($agentPoint){
     513
     514                            $qry_property = "SELECT property_type FROM $properties WHERE id=".$post_id;
     515
     516                            $res_property = $wpdb->get_results( $qry_property );
     517                            ?>
     518
     519                            <div class="map_category">
     520                                <?php echo esc_html( $res_property[0]->property_type ); ?>
     521                            </div>
     522
     523                        <?php
     524                         }else{
     525                         
     526                            if ( is_array( $categories ) ) {
     527                                foreach ( $categories as $cat ) {
     528                                    ?>
     529                                    <div class="map_category">
     530                                        <?php
     531                                        if($siteloft){
     532                                            echo esc_html( $cat );
     533                                        }else{
     534                                            echo esc_html( $cat->name );
     535                                        }?>
     536                                    </div>
     537                                    <?php
     538                                }
     539                            }   
     540                        }
     541
     542
     543
     544                           
     545                                               
     546
     547                        ?>
     548
     549
     550                        <div class="map_desc test">
     551                            <?php
     552
     553                            if($agentPoint){
     554                                $get_content = $description;
     555                                echo wp_kses_post($description);
     556
     557
     558                            }else{
     559
     560                                $get_content = $post->post_excerpt;
     561
     562                                if ( ! empty( $get_content ) ) {
     563
     564                                    echo wp_kses_post( $get_content );
     565
     566                                } else {
     567
     568                                    $get_content = apply_filters( 'the_content', $post->post_content );
     569                                    $get_content = preg_replace( '~(?:\[/?)[^/\]]+/?\]~s', '', $get_content );
     570
     571                                    echo wp_kses_post( $get_content );
     572                                }
     573
     574                            }
     575               
     576
     577                            ?>
     578
     579                        </div>
     580                        <div class="map_content" style="display:none;">
     581
     582                            <?php
     583                                if($agentPoint){
     584                                    echo wp_kses_post( $description );
     585                                }else{
     586                                    echo wp_kses_post( $post->post_content );       
     587                                }
     588                              ?></div>
     589
     590
     591                    </div>   
     592
     593
     594                    <div class="blog_action">
     595                        <?php
     596
     597                        if ( isset($status) && 'Currently scheduled' == $status && trev_csmap_is_pro_license_plugin() ) {
     598                            ?>
     599
     600                            <button class="button button-primary edit_schedule edit_post_cl" data-bedroom-emoji="<?php echo esc_attr( $bedroom_emoji ); ?>" data-event_time="<?php echo esc_attr( $scheduled ); ?>" data-pageid="<?php echo esc_attr( $page_ids ); ?>" data-id="<?php echo esc_attr( $revoice_scheduled_id ); ?>" data-post-id="<?php echo esc_attr( $post_id ); ?>" data-event="<?php echo esc_attr(  $title  ); ?>" data-bathroom-emoji="<?php echo esc_attr( $bathroom_emoji ); ?>" data-garage-emoji="<?php echo esc_attr( $garage_emoji ); ?>"  data-post-type="<?php echo esc_attr( $current_post_type ); ?>" data-address="<?php echo esc_attr( $listing_details['map_address'] ); ?>" data-listing-link="<?php echo esc_attr( $listing_details['listing_link'] ); ?>" data-bedroom="<?php echo esc_attr( $listing_details['bedroom'] ); ?>" data-bathroom="<?php echo esc_attr( $listing_details['bathroom'] ); ?>" data-garage="<?php echo esc_attr( $listing_details['garage'] ); ?>" data-image="<?php echo esc_url( $featured_img_url ); ?>" data-schedule-id="<?php echo esc_attr( $revoice_scheduled_id ); ?>" data-id="<?php echo esc_attr( $post_id ); ?>" data-title="<?php echo esc_attr( $title ); ?>" data-listing-details='<?php echo esc_attr( $js_code ); ?>' data-content-page="<?php esc_attr( 'content' ); ?>" data-parent-content="<?php echo esc_attr( $listing_details['listing_desc'] ); ?>" data-desc="<?php echo wp_kses_post( $post_content->post_content ); ?>" ><?php esc_html_e( 'Edit', 'the-real-estate-voice' ); ?></button>
     601
     602                        <?php } else { ?>
     603                            <button class="button button-primary map_share_btn" data-bedroom-emoji="<?php echo esc_attr( $bedroom_emoji ); ?>" data-bathroom-emoji="<?php echo esc_attr( $bathroom_emoji ); ?>" data-garage-emoji="<?php echo esc_attr( $garage_emoji ); ?>"    data-post-type="<?php echo esc_attr( $current_post_type ); ?>" data-address="<?php echo esc_attr( $listing_details['map_address'] ); ?>" data-listing-link="<?php echo esc_url( $listing_details['listing_link'] ); ?>" data-bedroom="<?php echo esc_attr( $listing_details['bedroom'] ); ?>" data-bathroom="<?php echo esc_attr( $listing_details['bathroom'] ); ?>" data-garage="<?php echo esc_attr( $listing_details['garage'] ); ?>" data-image="<?php echo esc_url( $featured_img_url ); ?>" data-schedule-id="<?php echo esc_attr( $revoice_scheduled_id ); ?>" data-id="<?php echo esc_attr( $post_id ); ?>" data-title="<?php echo esc_attr($title ); ?>" data-listing-details='<?php echo esc_attr( $js_code ); ?>' data-plugin-version="<?php esc_attr_e( $version_status ); ?>" data-desc="<?php echo esc_html( strip_tags( $get_content ) ); ?>" ><?php esc_html_e( 'Share', 'the-real-estate-voice' ); ?></button>
     604
     605                        <?php } ?>
     606
     607                    </div> 
     608
     609                </div>
    356610
    357611            <?php
     
    393647
    394648    if ( $page < $num_pages ) {
     649
    395650        $page          = $page + 1;
     651
    396652        $paginationUrl = add_query_arg(
    397653            array(
     
    404660            admin_url( 'admin.php' )
    405661        );
     662
    406663        ?>
    407664
  • the-real-estate-voice/trunk/js/trev-csmap-revoice.js

    r2745011 r2749653  
    3030    }
    3131
    32 });
    33 
     32
     33});
    3434
    3535
     
    372372            revoice_scheduled_id = jQuery(this).attr('data-schedule-id');
    373373
    374             if (post_type == 'listing') {
     374            if (post_type == 'listing' || post_type == 'listings' || post_type == 'property') {
    375375                listing_detail['bedroom'] = listing_detail_back.bedroom;
    376376                listing_detail['bathroom'] = listing_detail_back.bathroom;
     
    529529    revoice_scheduled_id = jQuery(this).attr('data-schedule-id');
    530530
    531     if (post_type == 'listing') {
     531    if (post_type == 'listing' || post_type == 'listings' || post_type == 'property') {
    532532        listing_detail['bedroom'] = jQuery(this).data('bedroom');
    533533        listing_detail['bathroom'] = jQuery(this).data('bathroom');
     
    619619
    620620function schedule_share_post_popup(desc, title, image, id, revoice_scheduled_id = '', listing_detail = '') {
    621 
    622     fb_page_load.forEach(function (item) {
     621 if(fb_page_select.length == 0){
     622        fb_page_load.forEach(function (item) {
    623623
    624624         fb_page_select.push(item.id);
    625625    });
    626    
     626 
     627 }
     628       
    627629               
    628630    var listing_detail_obj = {};
     
    659661
    660662
    661     if (revoiceDataAjax.is_listing_tab && revoiceDataAjax.plugin_version == false && post_type == 'listing') {
     663    if (revoiceDataAjax.is_listing_tab && revoiceDataAjax.plugin_version == false && ( post_type == 'listing' || post_type == 'listings' || post_type == 'property' ) ) {
    662664        trev_csmap_subscription_popup();
    663665        return false;
     
    911913    jQuery('body').addClass('open-overlay');
    912914
    913     desc = jQuery(this).attr('data-desc');
     915    desc  = jQuery(this).attr('data-desc');
    914916    title = jQuery(this).attr('data-title');
    915917    image = jQuery(this).attr('data-image');
     
    932934    }
    933935
    934     if (revoiceDataAjax.is_listing_tab && revoiceDataAjax.plugin_version == false && post_type == 'listing') {
     936    if (revoiceDataAjax.is_listing_tab && revoiceDataAjax.plugin_version == false && ( post_type == 'listing' || post_type == 'property') ) {
    935937        trev_csmap_subscription_popup();
    936938        return false;
     
    947949    }
    948950
    949     if (post_type == 'listing') {
     951    if (post_type == 'listing' || post_type == 'property' || post_type == 'listings' ) {
    950952        listing_detail = jQuery(this).data('listing-details');
    951953    }
     
    986988    var listing_detail_show = '';
    987989
    988     if (post_type == 'listing') {
     990    if (post_type == 'listing' || post_type == 'property' || post_type == 'listings') {
    989991        if (listing_detail) {
    990992            list_data = bedroom + ' ' + bedroom_emoji + nullSpace + bathroom + ' ' + bathroom_emoji + nullSpace + garage + ' ' + garage_emoji;
  • the-real-estate-voice/trunk/readme.txt

    r2745011 r2749653  
    55Tested up to: 6.0
    66Requires PHP: 5.6
    7 Stable tag: 1.1.8
     7Stable tag: 1.1.9
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    9393== Changelog ==
    9494
     95= 1.1.9 =
     96* Fixed issue of siteloft plugin's listing image
     97* Added categories to category dropdown in siteloft plugin's listing page
     98* Added placeholder to Instagram default hashtags area in Instagram setting
     99
    95100= 1.1.8 =
    96101* Fixed issue of facebook sharing twice
  • the-real-estate-voice/trunk/the-real-estate-voice.php

    r2745011 r2749653  
    379379            if ( ! empty( $instagram_option ) ) {
    380380                $logo_id  = ! empty( $instagram_option['logo'] ) ? $instagram_option['logo'] : '';
    381                 $hashtags = $instagram_option['hashtags'];
     381                if(isset($instagram_option['hashtags'])){
     382                    $hashtags = $instagram_option['hashtags']; 
     383                }
     384               
    382385            }
    383386
     
    568571
    569572        if ( isset( $general_tab_option_name['website_platform'] ) && 'SiteLoft' == $general_tab_option_name['website_platform'] ) {
     573           
    570574            $listing = 'listings';
    571575        }
    572576        elseif ( isset( $general_tab_option_name['website_platform'] ) && 'Easy Property Listings' == $general_tab_option_name['website_platform'] ) {
     577
    573578            $listing = 'property';
     579
    574580        }else {
     581
    575582            $listing = 'listing';
     583
    576584        }
    577585
     
    642650    $auto_social_option = get_option( 'auto_social_option_name');
    643651
    644     $instagram_option   = get_option( 'instagram_tab_option_name' );
    645 
    646     if( isset( $instagram_option['hashtags'] ) && empty( $instagram_option['hashtags'] ) ){
    647 
    648         $instagram_option['hashtags'] = '#realestate #voicerealestate #iloverealestate
    649        
    650 Voice Real Estate
    651 📞 9999 99999
    652 💻 www.voicerealestate.com
    653 LINK IN BIO';   
    654     }
    655    
    656652    $revcp_settings['post_status_2'] = 'publish';
    657653    $revcp_settings['attribute_posts_to_this_user_1'] = 1;
     
    659655    $auto_post_settings['auto_attribute_posts_to_this_user_2'] = 1;
    660656    $auto_post_settings['auto_post_status_3']                  = 'publish';
     657
     658    $auto_social_option['add_open_graph_tags_1'] = 1;
     659
     660    $revcp_settings['pro_version'] = 0;
     661
    661662   
    662 
    663     $auto_social_option['add_open_graph_tags_1'] = 1;
    664 
    665 
    666 
    667     $revcp_settings['pro_version'] = 0;
    668 
    669663    if ( is_array($get_pro_url) && ! empty( $get_pro_url ) ) {
    670 
    671664        $revcp_settings['pro_version'] = 1;
    672665        $library_cats                  = trev_csmap_article_library_categories();
    673666        $auto_post_settings['auto_maximum_posts_per_check_4']      = 2;
    674667        $temp = array();
     668       
    675669        foreach ( $library_cats as $cat_id => $cat_name ) {
    676670            $temp[ $cat_name ] = $cat_id;
     
    678672
    679673        $revcp_settings['library_cats'] = $temp;
    680 
    681674    }
    682675
     
    684677    update_option( 'auto_post_option_name', $auto_post_settings );
    685678    update_option( 'auto_social_option_name', $auto_social_option );
    686     update_option( 'instagram_tab_option_name', $instagram_option );
     679   
    687680}
    688681
Note: See TracChangeset for help on using the changeset viewer.