Esempio n. 1
0
 public function get_qr_image($qrfile_prefix = 'qr_', $size = 4, $outer_margin = 2)
 {
     $url = wpl_global::get_full_url();
     $file_name = $qrfile_prefix . md5($url) . '.png';
     $file_path = wpl_global::get_upload_base_path() . 'qrcode' . DS . $file_name;
     if (!wpl_file::exists($file_path)) {
         if (!wpl_file::exists(dirname($file_path))) {
             wpl_folder::create(dirname($file_path));
         }
         $QRcode = new QRcode();
         $QRcode->png($url, $file_path, 'L', $size, $outer_margin);
     }
     return wpl_global::get_upload_base_url() . 'qrcode/' . $file_name;
 }
Esempio n. 2
0
	if(!confirmed)
	{
		message = "Are you sure you want to remove this listing? ";
		message += '<span class="wpl_actions" onclick="wpl_discard(\''+item_id+'\', 1);">Yes</span>&nbsp;<span class="wpl_actions" onclick="wpl_remove_message(\'' + message_path + '\');">No</span>';
		
		wpl_show_messages(message, message_path);
		return false;
	}
	else if(confirmed) wpl_remove_message(message_path);
	
	Realtyna.ajaxLoader.show("#wpl_listing_discard_loading", 'tiny', 'rightOut');
   	
	request_str = "wpl_format=b:listings:ajax&wpl_function=purge_property&pid="+item_id;
    
    ajax = wpl_run_ajax_query('<?php 
    echo wpl_global::get_full_url();
    ?>
', request_str);
    ajax.success(function(data)
	{
		if(data.success == 1)
		{
			window.location = "<?php 
    echo $manager_link;
    ?>
";
		}
		else if(data.success != 1)
		{
			wpl_show_messages(data.message, '.wpl_listing_list .wpl_show_message', 'wpl_red_msg');
		}
			{
				/** remove form element **/
				wplj("#wpl' . $widget_id . '_search_widget_location_level_container"+i).remove();
			}
		}
		
		/** load zipcodes **/
		if(next_level > ' . $location_settings['zipcode_parent_level'] . ') next_level = "zips";
		
		wplj("#wpl' . $widget_id . '_search_fields_location_' . $field['id'] . '").append(\'<div class="wpl_search_widget_location_level_container" id="wpl' . $widget_id . '_search_widget_location_level_container\'+next_level+\'"></div>\');
		wplj("#wpl' . $widget_id . '_search_widget_location_level_container"+next_level).html(\'<img src="' . wpl_global::get_wpl_asset_url('img/ajax-loader3.gif') . '" />\');
		
		request_str = "wpl_format=f:property_listing:ajax&wpl_function=get_locations&location_level="+next_level+"&current_location_id="+id+"&parent="+parent+"&widget_id=' . $widget_id . '";
		
		/** run ajax query **/
		ajax = wpl_run_ajax_query("' . wpl_global::get_full_url() . '", request_str);
		ajax.success(function(data)
		{
			if(data.success == 1)
			{
				wplj("#wpl' . $widget_id . '_search_widget_location_level_container"+next_level).html("");
				
				html += \'<label class="wpl_search_widget_location_level_label" for="sf' . $widget_id . '_select_location\'+next_level+\'_id">\'+data.keyword+\'</label>\';
				html += data.html;
				wplj("#wpl' . $widget_id . '_search_widget_location_level_container"+next_level).html(html);
                
                setTimeout(function()
                {
                    if(wplj.fn.chosen != "undefined")
                    {
                        wplj("#wpl' . $widget_id . '_search_widget_location_level_container"+next_level+" select").chosen();
Esempio n. 4
0
 /**
  * Checks Realtyna billing credentials
  * @author Howard <*****@*****.**>
  * @static
  * @return array
  */
 public static function check_realtyna_credentials()
 {
     /** import settings library **/
     _wpl_import('libraries.settings');
     $current_url = wpl_global::get_full_url();
     $domain = wpl_global::domain($current_url);
     $settings = wpl_global::get_settings();
     $phpver = phpversion();
     $wplversion = wpl_global::wpl_version();
     $wpversion = wpl_global::wp_version();
     $username = $settings['realtyna_username'];
     $password = $settings['realtyna_password'];
     $POST = array('domain' => $domain, 'wpversion' => $wpversion, 'wplversion' => $wplversion, 'phpver' => $phpver, 'username' => urlencode($username), 'password' => urlencode($password), 'command' => 'check_credentials', 'format' => 'json');
     $io_handler = 'http://billing.realtyna.com/io/io.php';
     $result = wpl_global::get_web_page($io_handler, $POST);
     $answer = json_decode($result, true);
     /** saving status **/
     $status = isset($answer['status']) ? $answer['status'] : 0;
     wpl_settings::save_setting('realtyna_verified', $status, 1);
     $message = $status ? __('Credentials verified.', WPL_TEXTDOMAIN) : __('Invalid credentials!', WPL_TEXTDOMAIN);
     $success = 1;
     return array('success' => $success, 'message' => $message, 'status' => $status);
 }
Esempio n. 5
0
 /**
  * Get notification sender
  * @author Howard R <*****@*****.**>
  * @static
  * @return array|string
  */
 public static function get_sender()
 {
     $wpl_sender_email = wpl_global::get_setting('wpl_sender_email');
     $wpl_sender_name = wpl_global::get_setting('wpl_sender_name');
     if (trim($wpl_sender_email) == '') {
         $domain = wpl_global::domain(wpl_global::get_full_url());
         $wpl_sender_email = 'info@' . $domain;
     }
     if (trim($wpl_sender_name) == '') {
         return $wpl_sender_email;
     } else {
         return array($wpl_sender_name, $wpl_sender_email);
     }
 }
Esempio n. 6
0
<?php

/** no direct access **/
defined('_WPLEXEC') or die('Restricted access');
/** set params **/
$html_element_id = isset($params['html_element_id']) ? $params['html_element_id'] : '';
$root_url = isset($params['root_url']) ? $params['root_url'] : wpl_global::get_full_url();
$element_class = isset($params['element_class']) ? $params['element_class'] : 'location_breadcrumb';
$separator = isset($params['separator']) ? $params['separator'] : ' > ';
$location_level = isset($params['location_level']) ? $params['location_level'] : 1;
$location_id = isset($params['location_id']) ? $params['location_id'] : '';
$load_zipcodes = isset($params['load_zipcodes']) ? $params['load_zipcodes'] : 0;
$location_tree = wpl_locations::get_location_tree($location_id, $location_level - 1);
$levels = count($location_tree) + 1;
$breadcrumb_str = "";
$i = 1;
foreach ($location_tree as $branch) {
    if (trim($branch['name']) == '') {
        continue;
    }
    $link = wpl_global::add_qs_var('level', $levels, $root_url);
    $link = wpl_global::add_qs_var('sf_select_parent', $branch['id'], $link);
    if ($load_zipcodes and $i == 1) {
        $link = wpl_global::add_qs_var('load_zipcodes', 1, $link);
    }
    $breadcrumb_str = $separator . '<a href="' . $link . '">' . (($load_zipcodes and $i == 1) ? $branch['name'] . ' (' . __('Zipcodes', WPL_TEXTDOMAIN) . ')' : $branch['name']) . '</a>' . $breadcrumb_str;
    $levels--;
    $i++;
}
?>
<div class="<?php 
Esempio n. 7
0
/** no direct access * */
defined('_WPLEXEC') or die('Restricted access');
if ($type == 'googlemap' and !$done_this) {
    /** WPL Demographic addon **/
    $demographic_objects = array();
    if (wpl_global::check_addon('demographic')) {
        _wpl_import('libraries.addon_demographic');
        $demographic = new wpl_addon_demographic();
        $demographic_objects = wpl_items::get_items($item_id, 'demographic', $kind);
    }
    $w = 450;
    $h = 300;
    $ln_table_col = 'googlemap_ln';
    $lt_table_col = 'googlemap_lt';
    $javascript = (object) array('param1' => 'wpl-googlemap-api3', 'param2' => 'http' . (stristr(wpl_global::get_full_url(), 'https://') != '' ? 's' : '') . '://maps.google.com/maps/api/js?libraries=places,drawing&sensor=false', 'external' => true);
    wpl_extensions::import_javascript($javascript);
    ?>
<script type="text/javascript">
wplj(document).ready(function()
{
	try
	{
		wplj(".wpl_listing_all_location_container_locations, .wpl_c_field_42, .wpl_c_post_code, .wpl_c_street_no").change(function()
		{
			wpl_address_creator();
			wpl_code_address(wplj("#wpl_map_address<?php 
    echo $field->id;
    ?>
").val());
		});
Esempio n. 8
0
 /**
  * Sets Dublin Core Meta Tags
  * @author Howard <*****@*****.**>
  * @return boolean
  */
 public function dublincore()
 {
     $settings = wpl_global::get_settings();
     $dc_status = isset($settings['dc_status']) ? $settings['dc_status'] : false;
     /** check status of geo tags **/
     if (!$dc_status) {
         return false;
     }
     $current_link_url = wpl_global::get_full_url();
     $html = wpl_html::getInstance();
     /** WPL views and WordPress views (Page/Post) **/
     if (trim($this->view) != '' and $dc_status == 2 or $dc_status == 1) {
         if (trim($settings['dc_coverage']) != '') {
             $html->set_custom_tag('<meta name="DC.coverage" content="' . $settings['dc_coverage'] . '" />');
         }
         if (trim($settings['dc_contributor']) != '') {
             $html->set_custom_tag('<meta name="DC.contributor" content="' . $settings['dc_contributor'] . '" />');
         }
         if (trim($settings['dc_publisher']) != '') {
             $html->set_custom_tag('<meta name="DC.publisher" content="' . $settings['dc_publisher'] . '" />');
         }
         if (trim($settings['dc_copyright']) != '') {
             $html->set_custom_tag('<meta name="DC.rights" content="' . $settings['dc_copyright'] . '" />');
         }
         if (trim($settings['dc_source']) != '') {
             $html->set_custom_tag('<meta name="DC.source" content="' . $settings['dc_source'] . '" />');
         }
         if (trim($settings['dc_relation']) != '') {
             $html->set_custom_tag('<meta name="DC.relation" content="' . $settings['dc_relation'] . '" />');
         }
         $html->set_custom_tag('<meta name="DC.type" content="Text" />');
         $html->set_custom_tag('<meta name="DC.format" content="text/html" />');
         $html->set_custom_tag('<meta name="DC.identifier" content="' . $current_link_url . '" />');
         $locale = apply_filters('plugin_locale', get_locale(), WPL_TEXTDOMAIN);
         $html->set_custom_tag('<meta name="DC.language" scheme="RFC1766" content="' . $locale . '" />');
     }
     if ($this->view == 'property_show') {
         $proeprty_id = wpl_request::getVar('pid');
         $property_data = wpl_property::get_property_raw_data($proeprty_id);
         $user_data = (array) wpl_users::get_user($property_data['user_id']);
         $html->set_custom_tag('<meta name="DC.title" content="' . $this->property_page_title . '" />');
         $html->set_custom_tag('<meta name="DC.subject" content="' . $this->property_page_title . '" />');
         $html->set_custom_tag('<meta name="DC.description" content="' . $this->property_description . '" />');
         $html->set_custom_tag('<meta name="DC.date" content="' . $property_data['add_date'] . '" />');
         $html->set_custom_tag('<meta name="DC.creator" content="' . $user_data['data']->user_login . '" />');
     } elseif ($this->view == 'profile_show') {
         $user_id = wpl_request::getVar('uid');
         $user_data = (array) wpl_users::get_user($user_id);
         $html->set_custom_tag('<meta name="DC.title" content="' . $this->user_title . '" />');
         $html->set_custom_tag('<meta name="DC.subject" content="' . $this->user_title . '" />');
         $html->set_custom_tag('<meta name="DC.description" content="' . $this->user_description . '" />');
         $html->set_custom_tag('<meta name="DC.date" content="' . $user_data['data']->user_registered . '" />');
         $html->set_custom_tag('<meta name="DC.creator" content="' . $user_data['data']->user_login . '" />');
     } elseif (is_single()) {
         $post_author_id = wpl_global::get_post_field('post_author');
         $author_username = wpl_global::get_the_author_meta('user_login', $post_author_id);
         $html->set_custom_tag('<meta name="DC.title" content="' . wpl_global::get_the_title() . '" />');
         $html->set_custom_tag('<meta name="DC.subject" content="' . wpl_global::get_the_title() . '" />');
         $html->set_custom_tag('<meta name="DC.date" content="' . wpl_global::get_the_date() . '" />');
         $html->set_custom_tag('<meta name="DC.creator" content="' . $author_username . '" />');
     }
 }
Esempio n. 9
0
 public function get_target_page($target_id = NULL)
 {
     if (trim($target_id) and $target_id == '-1') {
         $target_page = wpl_global::get_full_url();
     } else {
         $target_page = wpl_property::get_property_listing_link($target_id);
     }
     return $target_page;
 }
Esempio n. 10
0
 public static function get_pagination($num_result, $page_size = '', $show_options = false)
 {
     if (!$page_size) {
         $page_size = 20;
     }
     $p = new wpl_pagination();
     $p->items($num_result);
     $p->limit($page_size);
     // Limit entries per page
     $p->target(wpl_global::get_full_url());
     $p->currentPage(wpl_request::getVar('wplpage'));
     // Gets and validates the current page
     $p->calculate();
     // Calculates what to show
     $p->parameterName('wplpage');
     $p->adjacents(1);
     //No. of page away from the current page
     //making next and previous keyword to be translated
     $p->nextLabel(__("Next", WPL_TEXTDOMAIN));
     $p->prevLabel(__("Previous", WPL_TEXTDOMAIN));
     /** validation for page **/
     if (!wpl_request::getVar('wplpage')) {
         $p->page = 1;
     } else {
         $p->page = wpl_request::getVar('wplpage');
     }
     $p->max_page = ceil($num_result / $page_size);
     if ($p->page <= 0 or $p->page > $p->max_page) {
         $p->page = 1;
     }
     //Query for limit paging
     $p->limit_query = "LIMIT " . ($p->page - 1) * $p->limit . ", " . $p->limit;
     if ($show_options) {
         $p->show_total = true;
         $p->show_page_size = true;
     }
     return $p;
 }
Esempio n. 11
0
{
    wplj('#wpl_gallery_external_cnt').show();
}

function wpl_gallery_external_save()
{
    var external_link = wplj('#gallery_external_link').val();
    
    ajax = wpl_run_ajax_query('<?php 
    echo wpl_global::get_full_url();
    ?>
', "wpl_format=b:listing:gallery&wpl_function=save_external_images&pid=<?php 
    echo $item_id;
    ?>
&kind=<?php 
    echo $this->kind;
    ?>
&links="+external_link);
	ajax.success(function (data)
    {
        var url = '<?php 
    echo wpl_global::add_qs_var('pid', $item_id, wpl_global::get_full_url());
    ?>
';
        window.location = url;
	});
}
</script>
<?php 
    $done_this = true;
}