/
functions.php
221 lines (192 loc) · 4.85 KB
/
functions.php
1
<?php/*****//*** Agent Page*/function get_agent_page(){ echo '<div id="ajax_rep_div" class="primary content" >'; include 'agent_listings/agenstlistings.php'; echo '</div>'; }add_shortcode('agent_page','get_agent_page');/***Individual Agent View*/function get_agent_view(){ echo '<div id="ajax_rep_div" class="primary content" >'; include 'agent_listings/agtview.php'; echo '</div>'; //include (TEMPLATEPATH . '/agtview.php'); }add_shortcode('agent_view_page','get_agent_view');//header functionfunction get_agent_view_item(){ if(isset($_GET['agtvwid'])){ session_start(); $ag_id = $_GET['agtvwid']; $_SESSION['aid'] = $ag_id; $location = get_site_url()."/agtview/"; wp_redirect($location); } }add_action('get_header', 'get_agent_view_item');/***Viewproperty Page*/function get_property_view(){ //print_r($_SESSION); echo "<script> var $ = jQuery.noConflict(); $(document).ready( function($){ // buttons for next and previous item var buttons = { previous:$('#jslidernews1 .button-previous') , next:$('#jslidernews1 .button-next') }; $('#jslidernews1').lofJSidernews( { interval : 4000, direction : 'opacitys', easing : 'easeInOutExpo', duration : 1200, auto : true, maxItemDisplay : 4, navPosition : 'horizontal', // horizontal navigatorHeight : 32, navigatorWidth : 80, mainWidth : 500, buttons : buttons } ); }); </script>"; wp_view_details();}function add_session(){ session_start(); }//add_action('get_header','add_session');add_shortcode('property_view_page','get_property_view');//header functionfunction get_property_view_item(){ if(isset($_GET['mls'])){ // session_start(); $mlsNo = $_GET['mls']; $_SESSION['mlsnum'] = $mlsNo; if(isset($_GET['side'])){ $_SESSION['side']='y'; //die('-----------------'); }else{ unset($_SESSION['side']); } //die($_SESSION['mlsnum'].'------'); $location = get_site_url()."/propertyview/"; wp_redirect($location); exit; }}add_action('get_header','get_property_view_item');/***Print View Page*/function get_property_print_view(){ session_start(); get_header(); echo ' <script language="Javascript1.2"> <!-- function printpage() { window.print(); } //--> var $ = jQuery.noConflict(); window.onload = function() { printpage(); }; /*$(document).ready( function(){ printpage(); });*/ </script> '; get_sidebar(); wp_view_details_print(); get_footer();}add_shortcode('property_print_view','get_property_print_view');/***Map View Page*/function get_property_map_view(){ include 'mcontent.php';}add_shortcode('property_map_view','get_property_map_view');/***Header Hooks*loading image, CSS styles*/function add_some_to_header(){ echo ' <script> var loadimg="<img src=\"'. get_bloginfo("url") .'/wp-content/plugins/amerisale-re/images/ajax-loader.gif\" alt=\"loading...\" width=\"100px\">"; var $js = jQuery.noConflict(); function getprice(){ // alert(id); var typeval = $js("#typeval").val(); var minprc = $js("#min_price").val(); var maxprc = $js("#max_price").val(); if(typeval == ""){ typeval = "all"; } if(minprc=="" && maxprc==""){ alert("Please enter a minium and maximum price"); return false; }else{ get_ntreis_pages(typeval,"1",minprc,maxprc); return false; } } function gettype(typeval){ //alert("test"); //var orderid = $js("#orderval").val(); var minprc = $js("#min_price").val(); var maxprc = $js("#max_price").val(); if(minprc == "" && maxprc == ""){ minprc="0"; } /*if(orderid == ""){ orderid = "ASC"; }*/ get_ntreis_pages(typeval,"1",minprc,maxprc); } function get_ntreis_pages(proptype,pageid,minprc,maxprc){ dropdown_val = $js("#typeval").val(); var city = "'.$_GET['city'].'" $js("#imge_load").html(loadimg); $js("#ajax_rep_div").fadeOut("slow"); var url = "'.content_url().'/plugins/amerisale-re/netriesdetail/ntreis_pagination.php"; $js.post( url,{proptype : proptype, pageid : pageid, minprc : minprc, maxprc : maxprc, city :city}, function( data ) { //alert(data); $js("#ajax_rep_div").html(data); $js("#imge_load").html(""); $js("#ajax_rep_div").fadeIn("slow"); $js("#typeval").val(dropdown_val); } ); } </script> <style> .price_div_hr{ float: right; width:560px; } .price_div_hr label{ color: #000000; float: left; font-size: 14px; padding: 0 10px; } #selectbxs{ float:left; } .tooldivclass{float:left;} </style> ';}add_action('wp_head','add_some_to_header'); // Load it after the jQuery is called?>