Esempio n. 1
0
 /**
  * Listing Contact activity. It's for contacting to a listing agent.
  * @author Howard <*****@*****.**>
  * @static
  * @param array $params
  * @return boolean
  */
 public static function contact_agent($params)
 {
     $replacements = $params[0];
     $notification = new wpl_notifications('email');
     $notification->prepare(2, $replacements);
     /** Disabled **/
     if (!$notification->notification_data['enabled']) {
         return false;
     }
     $property_id = $params[0]['property_id'];
     $property = wpl_property::get_property_raw_data($property_id);
     $user = wpl_users::get_user($property['user_id']);
     $property_title = wpl_property::update_property_title($property);
     $replacements['listing_id'] = '<a href="' . wpl_property::get_property_link(NULL, $property_id) . '">' . $property['mls_id'] . ' (' . $property_title . ')</a>';
     $notification->replacements = $notification->set_replacements($replacements);
     $notification->rendered_content = $notification->render_notification_content();
     $notification->recipients = $notification->set_recipients(array($user->data->user_email));
     $notification->send();
     return true;
 }
Esempio n. 2
0
echo wpl_global::get_wpl_asset_url('img/ajax-loader3.gif');
?>
" /></div>
                <div id="wpl_slide_container_id10000_after_save" class="hide">
                    <div class="after-finilize-wp">
                        <div class="finilize-icon"></div>
                        <div class="message-wp">
                            <span>
                                <?php 
echo __('Your property successfully finalized!', WPL_TEXTDOMAIN);
?>
                            </span>
                            <div class="finilize-btn-wp">
                                <?php 
$listing_target_page = wpl_global::get_client() == 1 ? wpl_global::get_setting('backend_listing_target_page') : NULL;
$property_link = wpl_property::get_property_link('', $this->property_id, $listing_target_page);
$new_link = wpl_global::remove_qs_var('pid', wpl_global::get_full_url());
if ($this->kind) {
    $new_link = wpl_global::add_qs_var('kind', $this->kind, $new_link);
}
if (wpl_global::get_client() == 1) {
    $manager_link = wpl_global::add_qs_var('kind', $this->kind, wpl_global::get_wpl_admin_menu('wpl_admin_listings'));
} else {
    $manager_link = wpl_global::add_qs_var('kind', $this->kind, wpl_global::remove_qs_var('wplmethod', wpl_global::remove_qs_var('pid')));
}
?>
                                <a class="wpl-button button-2" target="_blank" href="<?php 
echo $property_link;
?>
"><?php 
echo __('View this listing', WPL_TEXTDOMAIN);
Esempio n. 3
0
 /**
  * Returns all WPL item links (Used in sitemap feature)
  * @author Howard <*****@*****.**>
  * @static
  * @since 1.8.0
  * @param array $exclude
  * @return array
  */
 public static function get_wpl_item_links($exclude = array())
 {
     $links = array();
     /** WPL Properties **/
     $properties = wpl_property::select_active_properties(NULL, '`id`');
     foreach ($properties as $property) {
         /** exclude **/
         if (isset($exclude['properties']) and in_array($property['id'], $exclude['properties'])) {
             continue;
         }
         $property_data = wpl_db::select("SELECT `id`,`alias`,`last_modified_time_stamp` FROM `#__wpl_properties` WHERE `id`='" . $property['id'] . "'", 'loadAssoc');
         $link = wpl_property::get_property_link($property_data);
         $links[] = array('link' => $link, 'time' => strtotime($property_data['last_modified_time_stamp']));
     }
     /** WPL Profiles **/
     $profiles = wpl_users::get_wpl_users();
     foreach ($profiles as $profile) {
         /** exclude **/
         if (isset($exclude['profiles']) and in_array($profile->ID, $exclude['profiles'])) {
             continue;
         }
         $link = wpl_users::get_profile_link($profile->ID);
         $links[] = array('link' => $link, 'time' => strtotime($profile->last_modified_time_stamp));
     }
     return $links;
 }
Esempio n. 4
0
                        <input class="js-pcheckbox" type="checkbox" id="<?php 
    echo $property['data']['id'];
    ?>
" />    
                    </div>

                    <div class="property-image">
                        <?php 
    /** load position3 **/
    wpl_activity::load_position('pmanager_position3', array('wpl_properties' => $this->wpl_properties));
    ?>
                        <?php 
    $listing_target_page = wpl_global::get_client() == 1 ? wpl_global::get_setting('backend_listing_target_page') : NULL;
    ?>
                        <a class="p-links" href="<?php 
    echo wpl_property::get_property_link('', $property['data']['id'], $listing_target_page);
    ?>
"><?php 
    echo __('View this listing', WPL_TEXTDOMAIN);
    ?>
</a>
                    </div>
                    <div class="info-action-wp">
                        <div class="property-detailes">
                            
                            <?php 
    if (isset($property['property_title']) and trim($property['property_title'])) {
        ?>
							<span class="detail p-title"><span class="value"><?php 
        echo $property['property_title'];
        ?>
Esempio n. 5
0
} elseif ($type == 'parent' and !$done_this) {
    if (trim($value)) {
        $return['field_id'] = $field->id;
        $return['type'] = $field->type;
        $return['name'] = __($field->name, WPL_TEXTDOMAIN);
        $parents_ids = wpl_render::render_parent($value, isset($options['key']) ? $options['key'] : 'parent', true);
        $value_str = '';
        $parents = array_reverse(explode(',', $parents_ids));
        foreach ($parents as $parent) {
            $value_str .= '<a href="' . wpl_property::get_property_link(NULL, $parent) . '">' . trim(wpl_property::update_property_title(NULL, $parent), ', ') . '</a> / ';
        }
        $return['value'] = trim($value_str, '/ ');
        $parents_html_str = '';
        $parents = array_reverse(explode(',', $parents_ids));
        foreach ($parents as $parent) {
            $parents_html_str .= '<a href="' . wpl_property::get_property_link(NULL, $parent) . '"><b>' . trim(wpl_property::update_property_title(NULL, $parent), ', ') . '</b></a> / ';
        }
        $return['html'] = trim($parents_html_str, '/ ');
    }
    $done_this = true;
} elseif ($type == 'date' and !$done_this) {
    if (trim($value)) {
        $return['field_id'] = $field->id;
        $return['type'] = $field->type;
        $return['name'] = __($field->name, WPL_TEXTDOMAIN);
        $return['value'] = wpl_render::render_date($value);
    }
    $done_this = true;
} elseif ($type == 'datetime' and !$done_this) {
    if (trim($value)) {
        $return['field_id'] = $field->id;