Advertisement
Guest User

Untitled

a guest
Jul 11th, 2013
331
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 23.49 KB | None | 0 0
  1. <?php
  2.  
  3. function twitterWidget() {
  4.     $settings = get_option("widget_twitterwidget");
  5.     $tweetid = $settings['tweetid'];
  6.     $tweetnum = $settings['tweetnum'];
  7.         ?>
  8.  
  9.     <aside class="widget left">
  10.     <?php twitter(); ?>
  11.     <h4>Latest From Twitter</h4>
  12.     <div id="twitter"></div>
  13.     </aside>
  14.  
  15.     <div class="clear"></div>
  16.  
  17.     <?php }
  18.  
  19. function twitterWidgetAdmin() {
  20.  
  21.     $settings = get_option("widget_twitterwidget");
  22.         // check if anything's been sent
  23.  
  24.     if (isset($_POST['update_twitter'])) {
  25.         $settings['tweetid'] = strip_tags(stripslashes($_POST['twitter_id']));
  26.         $settings['tweetnum'] = strip_tags(stripslashes($_POST['twitter_num']));
  27.     update_option("widget_twitterwidget",$settings);
  28.     }
  29.  
  30.     echo '<p> <label for="twitter_id">Twitter ID:
  31.     <input id="twitter_id" name="twitter_id" type="text" class="widefat" value="'.$settings['tweetid'].'" /></label></p>';
  32.  
  33.     echo '<p> <label for="twitter_num">Number of Tweets to Display:
  34.         <input id="twitter_num" name="twitter_num" type="text" class="widefat" value="'.$settings['tweetnum'].'" /></label></p>';
  35.  
  36.     echo '<input type="hidden" id="update_twitter" name="update_twitter" value="1" />';
  37.  
  38.     }
  39.  
  40.     register_sidebar_widget('Twitter', 'twitterWidget');
  41.     register_widget_control('Twitter', 'twitterWidgetAdmin', 400, 200);
  42.  
  43.  
  44.     // Latest Widget
  45.  
  46.     function latestWidget() {
  47.         $settings = get_option("widget_latestwidget");
  48.         $title = $settings['title'];
  49.         $number = $settings['number'];
  50.  
  51.     ?>
  52.  
  53.     <aside id="latestposts" class="widget left">
  54.     <h4><?php echo $title ?></h4>
  55.         <?php  query_posts( array(
  56.             'posts_per_page' => $number )
  57.             ); 
  58.         if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
  59.  
  60.         <li>
  61.         <h5><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h5>
  62.                 <p class="description"><?php the_excerpt(); ?></p>
  63.  
  64.             <div class="clear"></div>
  65.         </li>
  66.  
  67.         <?php endwhile; endif; ?>
  68.         <?php wp_reset_query(); ?>
  69.          </aside>
  70.     <?php }
  71.  
  72.  
  73.     function latestWidgetAdmin() {
  74.         $settings = get_option("widget_latestwidget");
  75.  
  76.     // check if anything's been sent
  77.         if (isset($_POST['update_latest'])) {
  78.         $settings['title'] = strip_tags(stripslashes($_POST['latest_title']));
  79.         $settings['number'] = strip_tags(stripslashes($_POST['latest_number']));
  80.         update_option("widget_latestwidget",$settings);
  81.  
  82.         }
  83.  
  84.     echo '<p> <label for="latest_title">Title:
  85.         <input id="latest_title" name="latest_title" type="text" class="widefat" value="'.$settings['title'].'" /></label></p>';
  86.    
  87.     echo '<p> <label for="latest_number">Number of posts:
  88.         <input id="latest_number" name="latest_number" type="text" class="widefat" value="'.$settings['number'].'" /></label></p>';
  89.    
  90.     echo '<input type="hidden" id="update_latest" name="update_latest" value="1" />';
  91.  
  92.     }
  93.  
  94.     register_sidebar_widget('Latest Posts', 'latestWidget');
  95.  
  96.     register_widget_control('Latest Posts', 'latestWidgetAdmin', 400, 200);
  97.  
  98.  
  99.     // Flickr Widget
  100.  
  101.     function flickrWidget() {
  102.         $settings = get_option("widget_flickrwidget");
  103.         $id = $settings['id'];
  104.         $number = $settings['number'];
  105.         ?>
  106.  
  107.     <aside id="flickr" class="widget left">
  108.     <h4>Latest On Flickr</h4>
  109.  
  110.      <script type="text/javascript" src="http://www.flickr.com/badge_code_v2.gne?count=<?php echo $number; ?>&amp;display=latest&amp;size=s&amp;layout=x&amp;source=user&amp;user=<?php echo $id; ?>">      </script>
  111.  
  112.     <div class="clear"></div>
  113.     </aside>
  114.  
  115.      <div class="clear"></div>
  116.     <?php }
  117.  
  118.  
  119.     function flickrWidgetAdmin() {
  120.         $settings = get_option("widget_flickrwidget");
  121.     // check if anything's been sent
  122.  
  123.     if (isset($_POST['update_flickr'])) {
  124.         $settings['id'] = strip_tags(stripslashes($_POST['flickr_id']));
  125.         $settings['number'] = strip_tags(stripslashes($_POST['flickr_number']));
  126.         update_option("widget_flickrwidget",$settings);
  127.  
  128.         }
  129.  
  130.     echo '<p> <label for="flickr_id">Flickr ID (<a href="http://www.idgettr.com">idGettr</a>):
  131.     <input id="flickr_id" name="flickr_id" type="text" class="widefat" value="'.$settings['id'].'" /></label></p>';
  132.  
  133.     echo '<p> <label for="flickr_number">Number of photos:
  134.     <input id="flickr_number" name="flickr_number" type="text" class="widefat" value="'.$settings['number'].'" /></label></p>';
  135.  
  136.     echo '<input type="hidden" id="update_flickr" name="update_flickr" value="1" />';
  137.  
  138.     }
  139.  
  140.     register_sidebar_widget('Flickr', 'flickrWidget');
  141.     register_widget_control('Flickr', 'flickrWidgetAdmin', 400, 200);
  142.  
  143.  
  144.     // Ad widget
  145.  
  146.     function adsWidget() { ?>
  147.  
  148.         <aside id="ct-ads" class="widget left">
  149.     <?php if(get_option("ct_custom_ad1_url", "ct_custom_ad1_imgurl", "ct_custom_ad1_alt", $single = true) !="") { ?>
  150.     <a href="<?php echo get_option("ct_custom_ad1_url", $single = true); ?>"><img class="smsqad left" src="<?php echo get_option("ct_custom_ad1_imgurl", $single = true); ?>" height="125" width="125" alt="<?php echo get_option("ct_custom_ad1_alt", $single = true); ?>" /></a>
  151.     <?php } else { ?>
  152.  
  153.     <a href="#"><img class="smsqad left" src="<?php bloginfo('template_directory'); ?>/images/ads/tf_125x125_v5.gif" height="125" width="125" alt="125x125 ad" /></a>
  154.  
  155.     <?php } ?>
  156.  
  157.     <?php if(get_option("ct_custom_ad2_url", "ct_custom_ad2_imgurl", "ct_custom_ad2_alt", $single = true) !="") { ?>
  158.  
  159.     <a href="<?php echo get_option("ct_custom_ad2_url", $single = true); ?>"><img class="smsqad left last" src="<?php echo get_option("ct_custom_ad2_imgurl", $single = true); ?>" height="125" width="125" alt="<?php echo get_option("ct_custom_ad2_alt", $single = true); ?>" /></a>
  160.  
  161.     <?php } else { ?>
  162.  
  163.     <a href="#"><img class="smsqad left last" src="<?php bloginfo('template_directory'); ?>/images/ads/gr_125x125_v4.gif" height="125" width="125" alt="125x125 ad" /></a>
  164.     <?php } ?>
  165.  
  166.     <?php if(get_option("ct_custom_ad3_url", "ct_custom_ad3_imgurl", "ct_custom_ad3_alt", $single = true) !="") { ?>
  167.     <a href="<?php echo get_option("ct_custom_ad3_url", $single = true); ?>"><img class="smsqad left" src="<?php echo get_option("ct_custom_ad3_imgurl", $single = true); ?>" height="125" width="125" alt="<?php echo get_option("ct_custom_ad3_alt", $single = true); ?>" /></a>
  168.  
  169.     <?php } else { ?>
  170.  
  171.     <a href="#"><img class="smsqad left" src="<?php bloginfo('template_directory'); ?>/images/ads/ad_125x125_v4.gif" height="125" width="125" alt="125x125 ad" /></a>
  172.  
  173.     <?php } ?>
  174.  
  175.     <?php if(get_option("ct_custom_ad4_url", "ct_custom_ad4_imgurl", "ct_custom_ad4_alt", $single = true) !="") { ?>
  176.     <a href="<?php echo get_option("ct_custom_ad4_url", $single = true); ?>"><img class="smsqad left last" src="<?php echo get_option("ct_custom_ad4_imgurl", $single = true); ?>" height="125" width="125" alt="<?php echo get_option("ct_custom_ad4_alt", $single = true); ?>" /></a>
  177.  
  178.     <?php } else { ?>
  179.        
  180.      <a href="#"><img class="smsqad left last" src="<?php bloginfo('template_directory'); ?>/images/ads/vh_125x125_2.gif" height="125" width="125" alt="125x125 ad" /></a>
  181.  
  182.      <?php } ?>
  183.  
  184.     <?php if(get_option("ct_custom_ad5_url", "ct_custom_ad5_imgurl", "ct_custom_ad5_alt", $single = true) !="") { ?>
  185.  
  186.     <a href="<?php echo get_option("ct_custom_ad5_url", $single = true); ?>"><img class="smsqad left" src="<?php echo get_option("ct_custom_ad5_imgurl", $single = true); ?>" height="125" width="125" alt="<?php echo get_option("ct_custom_ad5_alt", $single = true); ?>" /></a>
  187.  
  188.      <?php } else { ?>
  189.  
  190.     <!--  do nothing -->
  191.  
  192.     <?php } ?>
  193.  
  194.     <?php if(get_option("ct_custom_ad6_url", "ct_custom_ad6_imgurl", "ct_custom_ad6_alt", $single = true) !="") { ?>
  195.  
  196.     <a href="<?php echo get_option("ct_custom_ad6_url", $single = true); ?>"><img class="smsqad left last" src="<?php echo get_option("ct_custom_ad6_imgurl", $single = true); ?>" height="125" width="125" alt="<?php echo get_option("ct_custom_ad6_alt", $single = true); ?>" /></a>
  197.  
  198.      <?php } else { ?>
  199.  
  200.     <!--  do nothing -->
  201.  
  202.  
  203.  
  204.     <?php } ?>
  205.  
  206.     <div class="clear"></div>
  207.      <?php if(get_option("ct_custom_advertise_url", $single = true) !="") { ?>
  208.     <p id="advertise"><a href="<?php echo get_option("ct_custom_advertise_url", $single = true); ?>">Advertise Here</a></p>
  209.  
  210.      <?php } else { ?>
  211.  
  212.     <p id="advertise"><a href="#">Advertise Here</a></p>
  213.     <?php } ?>
  214.  
  215.     </aside>
  216.  
  217.     <div class="clear"></div>
  218.     <?php }
  219.  
  220.     register_sidebar_widget('Ads', 'adsWidget');
  221.  
  222.     function popWidget($args) {
  223.  
  224.         global $wpdb;
  225.         $settings = get_option("widget_popWidget");
  226.         $pop_num = $settings['popnumber'];
  227.         $now = gmdate("Y-m-d H:i:s",time());
  228.         $lastmonth = gmdate("Y-m-d H:i:s",gmmktime(date("H"), date("i"), date("s"), date("m")-12,date("d"),date("Y")));
  229.         $popularposts = "SELECT ID, post_title, post_date, COUNT($wpdb->comments.comment_post_ID) AS 'stammy' FROM $wpdb->posts, $wpdb->comments WHERE comment_approved = '1' AND $wpdb->posts.ID=$wpdb->comments.comment_post_ID AND post_status = 'publish' AND post_date < '$now' AND post_date > '$lastmonth' AND comment_status = 'open' GROUP BY $wpdb->comments.comment_post_ID ORDER BY stammy DESC LIMIT ".$pop_num;
  230.  
  231.         $posts = $wpdb->get_results($popularposts);
  232.         $popular = '';
  233.  
  234.     echo $args['before_widget'];
  235.     echo $args['before_title'] .'Popular Posts'. $args['after_title'];
  236.  
  237.         if($posts){ ?>
  238.  
  239.         <ul>
  240.         <?php foreach($posts as $post){
  241.             $post_title = stripslashes($post->post_title);
  242.             $post_date = $post->post_date;
  243.             $post_date = mysql2date('F j, Y', $post_date, false);
  244.             $permalink = get_permalink($post->ID);
  245.             $meta_image = get_post_meta($post->ID, "image_value", true);
  246.     if(!$meta_image){
  247.             $meta_image = get_template_directory_uri() .'/images/empty_tn.png';
  248.  
  249.             }else{
  250.     $meta_image = get_template_directory_uri() .'/img_resize/timthumb.php?src=' .$meta_image. '&amp;w=60&amp;h=60&amp;zc=1&amp;q=100';
  251.     } ?>
  252.         <li><a href="<?php echo $permalink; ?>" title="<?php echo $post_title; ?>"><h6><?php echo $post_title; ?></h6><p class="meta"><?php echo $post_date; ?></p></a><div class="clear"></div></li>
  253.     <?php } ?>
  254.     </ul>
  255.     <?php }
  256.         echo $args['after_widget'];
  257.     }
  258.  
  259.  
  260.     function popWidgetAdmin() {
  261.         $settings = get_option("widget_popWidget");
  262.  
  263.             // check if anything's been sent
  264.  
  265.     if (isset($_POST['update_pop'])) {
  266.         $settings['popnumber'] = strip_tags(stripslashes($_POST['pop_number']));
  267.         update_option("widget_popWidget",$settings);
  268.  
  269.     }
  270.  
  271.  
  272.         echo '<p> <label for="pop_number">Number of posts:
  273.             <input id="pop_number" name="pop_number" type="text" class="widefat" value="'.$settings['popnumber'].'" /></label></p>';
  274.  
  275.         echo '<input type="hidden" id="update_pop" name="update_pop" value="1" />';
  276.  
  277.     }
  278.  
  279.     register_sidebar_widget('Popular Posts', 'popWidget');
  280.     register_widget_control('Popular Posts', 'popWidgetAdmin', 400, 200);
  281.  
  282.  
  283.  
  284.     function listingsWidget() { ?>
  285.  
  286.         <aside id="agent-other-listings" class="widget left">
  287.          <h4><?php _e('Agent\'s Other Listings', 'theme_textdomain'); ?></h4>
  288.     <ul id="newlistings">
  289.  
  290.      <?php
  291.         $author = get_the_author_meta('ID');
  292.          query_posts( array(
  293.             'post_type' => 'listings',
  294.             'author' => $author,
  295.              'posts_per_page' => 3 )
  296.              );
  297.  
  298.     if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
  299.  
  300.          <li>
  301.             <?php ct_status_sm(); ?>
  302.              <?php ct_first_image_tn_left(); ?>
  303.             <h5><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h5>
  304.             <p class="location"><?php city(); ?>, <?php state(); ?> <?php zipcode(); ?></p>
  305.             <p class="propinfo"><?php beds(); ?> <?php _e('Bed', 'theme_textdomain'); ?>, <?php baths(); ?> <?php _e('Bath', 'theme_textdomain'); ?></p>
  306.  
  307.         <div class="clear"></div>
  308.  
  309.         </li>
  310.  
  311.              <?php endwhile; endif; ?>
  312.  
  313.         <?php wp_reset_query(); ?>
  314.         </ul>
  315.      </aside>
  316.         <?php }
  317.  
  318.     register_sidebar_widget('Agents Other Listings', 'listingsWidget');
  319.  
  320. function listingsInSameAreaWidget() { ?>
  321.  
  322.     <aside id="other-listings-in-same-area" class="widget left">
  323.     <h4><?php _e('Other Listings in Same Area', 'theme_textdomain'); ?></h4>
  324.     <ul id="newlistings">
  325.     <?php
  326.     $author = get_the_author_meta('ID');
  327.     $city = get_the_term_list(ID, 'city');
  328.     $post_id = get_post($post->ID)->ID;
  329.  
  330.            
  331.      $args = array(
  332.     'post_type' => 'listings',
  333.     'city' => $city,
  334.     'post__not_in' =>$post->ID,
  335.     'posts_per_page' => 3
  336.         );
  337.  
  338.             //query_posts($args);
  339.  
  340.             query_posts( array(
  341.         'post_type' => 'listings',
  342.         'city' => $city,
  343.         'post__not_in' =>$post->ID,
  344.         'posts_per_page' => 3, )
  345.  
  346.             );  
  347.  
  348.                  if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
  349.  
  350.  
  351.  
  352.                  <li>
  353.              <?php ct_status_sm(); ?>
  354.              <?php ct_first_image_tn_left(); ?>
  355.              <h5><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h5>
  356.  
  357.                     <p class="location"><?php city_and_state(); ?></p>
  358.  
  359.                     <p class="propinfo"><?php beds(); ?> <?php _e('Bed', 'theme_textdomain'); ?>, <?php baths(); ?> <?php _e('Bath', 'theme_textdomain'); ?></p>
  360.  
  361.                         <div class="clear"></div>
  362.  
  363.                 </li>
  364.  
  365.            
  366.  
  367.             <?php endwhile; endif; ?>
  368.  
  369.         <?php wp_reset_query(); ?>
  370.  
  371.         </ul>
  372.  
  373.     </aside>
  374.  
  375. <?php }
  376.  
  377. register_sidebar_widget('Other Listings in Same Area', 'listingsInSameAreaWidget');
  378.  
  379.  
  380.  
  381.  
  382.  
  383. function moreinfoWidget() { ?>
  384.  
  385.     <aside id="contact-agent" class="widget left">
  386.     <h4><?php _e('Request More Details', 'theme_textdomain'); ?></h4>
  387.     <?php contact_us_validation(); ?>
  388.  
  389.     <form id="contactform" class="formular" method="post">
  390.     <fieldset>
  391.  
  392.         <input type="text" name="name" id="name" class="validate[required,custom[onlyLetter]] text-input" value="<?php _e('Name', 'theme_textdomain'); ?>" onfocus="if(this.value=='<?php _e('Name', 'theme_textdomain'); ?>')this.value = '';" onblur="if(this.value=='')this.value = '<?php _e('Name', 'theme_textdomain'); ?>';" />
  393.  
  394.         <input type="text" name="email" id="email" class="validate[required,custom[email]] text-input" value="<?php _e('Email', 'theme_textdomain'); ?>" onfocus="if(this.value=='<?php _e('Email', 'theme_textdomain'); ?>')this.value = '';" onblur="if(this.value=='')this.value = '<?php _e('Email', 'theme_textdomain'); ?>';" />
  395.  
  396.         <textarea class="validate[required,length[2,500]] text-input" name="message" id="message" rows="5" cols="10" onfocus="if(this.value=='<?php _e('Message', 'theme_textdomain'); ?>')this.value = '';" onblur="if(this.value=='')this.value = '<?php _e('Message', 'theme_textdomain'); ?>';">Message</textarea>
  397.  
  398.         <input type="hidden" id="ctyouremail" name="ctyouremail" value="<?php the_author_meta('user_email'); ?>" />
  399.  
  400.         <input type="hidden" id="ctsubject" name="ctsubject" value="<?php echo get_option("ct_subject", $single = true); ?>" />
  401.  
  402.             <input type="hidden" id="ctproperty" name="ctproperty" value="<a href=<?php the_permalink(); ?>><?php the_title(); ?></a>" />
  403.  
  404.                 <input type="submit" name="Submit" value="<?php _e('Submit', 'theme_textdomain'); ?>" id="submit" class="btn" />  
  405.  
  406.     </fieldset>
  407.  
  408.     </form>
  409.  
  410.     </aside>
  411.  
  412.  
  413.  
  414. <?php }
  415.  
  416.  
  417.  
  418.   register_sidebar_widget('Request More Info Form', 'moreinfoWidget');
  419.   register_sidebar_widget('Request More Info Form', 'jtplMoreInfoWidget');
  420.  
  421.  
  422.  
  423. function jtplMoreInfoWidget() { ?>
  424.  
  425.     <aside id="contact-agent" class="widget left">
  426.     <h4><?php _e('Request More Details', 'theme_textdomain'); ?></h4>
  427.     <?php insert_cform('Request more details')    ; ?>
  428.     </aside>
  429.  
  430.     <?php }
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438. function loancalcWidget() {
  439.  
  440.  
  441.  
  442. ?>
  443.  
  444.  
  445.  
  446. <aside id="loancalc" class="widget left">
  447.  
  448.  
  449.  
  450.     <a name="calc"></a>
  451.  
  452.  
  453.  
  454.     <h4><?php _e('Mortgage Calculator', 'theme_textdomain'); ?></h4>
  455.  
  456.  
  457.  
  458.     <form id="loancalc">
  459.  
  460.  
  461.  
  462.         <fieldset>
  463.  
  464.  
  465.  
  466.           <input type="text" name="mcPrice" id="mcPrice" class="mortgageField text-input" value="<?php _e('Sale price ($)', 'theme_textdomain'); ?>" onfocus="if(this.value=='<?php _e('Sale price ($)', 'theme_textdomain'); ?>')this.value = '';" onblur="if(this.value=='')this.value = '<?php _e('Sale price ($)', 'theme_textdomain'); ?>';" />
  467.  
  468.  
  469.  
  470.           <input type="text" name="mcDown" id="mcDown" class="mortgageField text-input" value="<?php _e('Down payment (%)', 'theme_textdomain'); ?>" onfocus="if(this.value=='<?php _e('Down payment (%)', 'theme_textdomain'); ?>')this.value = '';" onblur="if(this.value=='')this.value = '<?php _e('Down payment (%)', 'theme_textdomain'); ?>';" />
  471.  
  472.  
  473.  
  474.           <input type="text" name="mcRate" id="mcRate" class="mortgageField text-input" value="<?php _e('Interest Rate (%)', 'theme_textdomain'); ?>" onfocus="if(this.value=='<?php _e('Interest Rate (%)', 'theme_textdomain'); ?>')this.value = '';" onblur="if(this.value=='')this.value = '<?php _e('Interest Rate (%)', 'theme_textdomain'); ?>';" />
  475.  
  476.  
  477.  
  478.           <input type="text" name="mcTerm" id="mcTerm" class="mortgageField text-input" value="<?php _e('Term (years)', 'theme_textdomain'); ?>" onfocus="if(this.value=='<?php _e('Term (years)', 'theme_textdomain'); ?>')this.value = '';" onblur="if(this.value=='')this.value = '<?php _e('Term (years)', 'theme_textdomain'); ?>';" />
  479.  
  480.  
  481.  
  482.           <button class="btn" id="mortgageCalc" onclick="return false"><?php _e('Calculate Monthly Payment', 'theme_textdomain'); ?></button>
  483.  
  484.  
  485.  
  486.           <input type="text" name="mcPayment" id="mcPayment" class="mortgageAnswer text-input" value="$" />
  487.  
  488.  
  489.  
  490.         </fieldset>
  491.  
  492.  
  493.  
  494.     </form>
  495.  
  496.  
  497.  
  498.     <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/loancalc.js"></script>
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506. </aside>
  507.  
  508.  
  509.  
  510. <?php }
  511.  
  512.  
  513.  
  514. register_sidebar_widget('Mortgage Calculator', 'loancalcWidget');
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522. function propsearchWidget() {  
  523.  
  524.  
  525.  
  526. ?>
  527.  
  528.  
  529.  
  530. <aside id="propsearch" class="widget left">
  531.  
  532. <?php
  533.  
  534. /*
  535.  
  536. <form id="advanced_search" name="property-search" action="<?php bloginfo('url'); ?>">
  537.  
  538.  
  539.  
  540.     <h4><?php _e('Find your new home', 'theme_textdomain'); ?></h4>
  541.  
  542.  
  543.  
  544.     <p><?php $count_posts = wp_count_posts('listings'); $published_listings = $count_posts->publish; ?><?php echo $published_listings ?>  Real Estate Listings, Homes for Sale &amp; Rental Properties.</p>
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.     <div id="prop-type" class="left">
  553.  
  554.  
  555.  
  556.         <label for="ct_type"><?php _e('Type', 'theme_textdomain'); ?></label>
  557.  
  558.  
  559.  
  560.         <?php ct_search_form_select('property_type'); ?>
  561.  
  562.  
  563.  
  564.     </div>
  565.  
  566.  
  567.  
  568.    
  569.  
  570.  
  571.  
  572.         <div class="clear"></div>
  573.  
  574.  
  575.  
  576.    
  577.  
  578.  
  579.  
  580.     <div id="beds" class="left">
  581.  
  582.  
  583.  
  584.         <label for="ct_beds"><?php _e('Beds', 'theme_textdomain'); ?></label>
  585.  
  586.  
  587.  
  588.         <?php ct_search_form_select('beds'); ?>
  589.  
  590.  
  591.  
  592.     </div>
  593.  
  594.  
  595.  
  596.    
  597.  
  598.  
  599.  
  600.     <div id="baths" class="left">
  601.  
  602.  
  603.  
  604.         <label for="ct_baths"><?php _e('Baths', 'theme_textdomain'); ?></label>
  605.  
  606.  
  607.  
  608.         <?php ct_search_form_select('baths'); ?>
  609.  
  610.  
  611.  
  612.     </div>
  613.  
  614.  
  615.  
  616.    
  617.  
  618.  
  619.  
  620.     <div id="city" class="left">
  621.  
  622.  
  623.  
  624.         <label for="ct_city"><?php _e('City', 'theme_textdomain'); ?></label>
  625.  
  626.  
  627.  
  628.         <?php ct_search_form_select('city'); ?>
  629.  
  630.  
  631.  
  632.     </div>
  633.  
  634.  
  635.  
  636.    
  637.  
  638.  
  639.  
  640.     <div id="state" class="left">
  641.  
  642.  
  643.  
  644.         <label for="ct_state"><?php _e('State', 'theme_textdomain'); ?></label>
  645.  
  646.  
  647.  
  648.         <?php ct_search_form_select('state'); ?>
  649.  
  650.  
  651.  
  652.     </div>
  653.  
  654.  
  655.  
  656.    
  657.  
  658.  
  659.  
  660.     <div id="zipcode" class="left">
  661.  
  662.  
  663.  
  664.         <label for="ct_zipcode"><?php _e('Zipcode', 'theme_textdomain'); ?></label>
  665.  
  666.  
  667.  
  668.         <?php ct_search_form_select('zipcode'); ?>
  669.  
  670.  
  671.  
  672.     </div>
  673.  
  674.  
  675.  
  676.    
  677.  
  678.  
  679.  
  680.     <div id="status" class="left">
  681.  
  682.  
  683.  
  684.         <label for="ct_status"><?php _e('Status', 'theme_textdomain'); ?></label>
  685.  
  686.  
  687.  
  688.         <?php ct_search_form_select('status'); ?>
  689.  
  690.  
  691.  
  692.     </div>
  693.  
  694.  
  695.  
  696.    
  697.  
  698.  
  699.  
  700.     <div id="addfeat" class="left">
  701.  
  702.  
  703.  
  704.         <label for="ct_additional_features"><?php _e('Addtional Features', 'theme_textdomain'); ?></label>
  705.  
  706.  
  707.  
  708.         <?php ct_search_form_select('additional_features'); ?>
  709.  
  710.  
  711.  
  712.     </div>
  713.  
  714.  
  715.  
  716.    
  717.  
  718.  
  719.  
  720.     <input type="hidden" name="property-search" value="true" />
  721.  
  722.  
  723.  
  724.     <input id="submit" class="btn right" type="submit" value="Search" />
  725.  
  726.  
  727.  
  728.    
  729.  
  730.  
  731.  
  732.         <div class="clear"></div>
  733.  
  734.  
  735.  
  736. </form>
  737.  
  738. */
  739.  
  740. ?>
  741.  
  742. <form id="advanced_search" name="property-search-widget" action="<?php bloginfo('url'); ?>">
  743.  
  744.             <h2><?php _e('Find your new Property', 'theme_textdomain'); ?></h2>
  745.  
  746.             <?php /*
  747.  
  748.             <p><?php $count_posts = wp_count_posts('listings'); $published_listings = $count_posts->publish; ?><?php echo $published_listings ?>  Properties for Sale &amp Rent </p>
  749.  
  750.             */ ?>
  751.  
  752.            
  753.  
  754.             <div class="top-row left">
  755.  
  756.                 <label for="ct_status"><?php _e('Type', 'theme_textdomain'); ?></label>
  757.  
  758.                 <?php jtpl_ct_search_form_select('status'); ?>
  759.  
  760.             </div>
  761.  
  762.            
  763.  
  764.             <div class="left">
  765.  
  766.                 <label for="ct_type"><?php _e('Property Type', 'theme_textdomain'); ?></label>
  767.  
  768.                 <?php ct_search_form_select('property_type'); ?>
  769.  
  770.             </div>
  771.  
  772.            
  773.  
  774.             <div class="left">
  775.  
  776.                 <label for="ct_city"><?php _e('City', 'theme_textdomain'); ?></label>
  777.  
  778.                 <?php jtpl_ct_city_form_select('city'); ?>
  779.  
  780.             </div>
  781.  
  782.            
  783.  
  784.             <div class="left">
  785.  
  786.                 <label for="ct_min_price"><?php _e('Min Price', 'theme_textdomain'); ?></label>
  787.                 <?php if($_REQUEST['ct_min_price']){
  788.                 $minprice = $_REQUEST['ct_min_price'];
  789.                 }
  790.                 ?>
  791.                 <?php /* jtpl_ct_search_form_select('min_price'); */ ?>
  792.                 <input name="ct_min_price" type="text" id="ct_min_price" size="8" maxlength="8" placeholder="Any" value="<?php echo $minprice; ?>" />
  793.             </div>
  794.  
  795.            
  796.  
  797.             <div class="left">
  798.                <label for="ct_max_price"><?php _e('Max Price', 'theme_textdomain'); ?></label>
  799.                <?php if($_REQUEST['ct_max_price']){
  800.                 $maxprice = $_REQUEST['ct_max_price'];
  801.                 }
  802.                 ?>
  803.                 <?php /* jtpl_ct_search_form_select('max_price'); */ ?>
  804.                 <input name="ct_max_price" type="text" id="ct_max_price" size="8" maxlength="8" placeholder="Any"  value="<?php echo $maxprice; ?>" />             
  805.             </div>
  806.  
  807.              <div class="left">
  808.             <label for="sort_by">Sort By</label>
  809.             <?php if($_REQUEST['sort_by']){
  810.                 $sortby = $_REQUEST['sort_by'];
  811.                 }
  812.                 ?>
  813.             <select id="sort_by" name="sort_by" size="1">
  814.               <option value="1" <?php if($sortby == '1'){ ?>selected="selected"<?php } ?>>Price ( high to low )</option>
  815.               <option value="3" <?php if($sortby == '3'){ ?>selected="selected"<?php } ?>>Price ( low to high )</option>
  816.               <option value="2" <?php if($sortby == '2'){ ?>selected="selected"<?php } ?>>Newest</option>
  817.             </select>
  818.             </div>
  819.  
  820.            
  821.  
  822.             <div class="clear"></div>
  823.  
  824.             <input type="hidden" name="property-search-widget" value="true" />
  825.  
  826.             <input id="submit" class="btn center" type="submit" value="Search" />
  827.  
  828.                 <div class="clear"></div>
  829.  
  830.         </form>
  831.  
  832.  
  833.  
  834. </aside>
  835.  
  836.  
  837.  
  838. <?php }
  839.  
  840.  
  841.  
  842. register_sidebar_widget('Property Search', 'propsearchWidget');
  843.  
  844.  
  845.  
  846. function view_more_listings() {    
  847.  
  848.     $post_id = get_post($post->ID)->ID;
  849.  
  850. ?>
  851.  
  852. <aside id="view_more_listings" class="widget left">
  853.  
  854.      <div id="viewmore">
  855.  
  856.             <div class="left">
  857.  
  858.                 <?php previous_post_link('%link','<span>Previous</span>'); ?>
  859.  
  860.             </div>
  861.  
  862.             <div class="right">
  863.  
  864.                 <?php next_post_link('%link','<span>Next</span>'); ?>
  865.  
  866.             </div>
  867.  
  868.                 <div class="clear"></div>
  869.  
  870.         </div>
  871.  
  872. </aside>
  873.  
  874. <?php }
  875.  
  876. register_sidebar_widget('View More Listings', 'view_more_listings');
  877.  
  878.  
  879.  
  880.  
  881.  
  882. /*
  883.  
  884. function sidebarMenuWidget() {    
  885.  
  886. ?>
  887.  
  888. <aside id="sidebar-menu-widget" class="widget left">
  889.  
  890. <h4><?php _e('Explore the Site', 'theme_textdomain'); ?></h4>
  891.  
  892. <?php wp_nav_menu(array('menu' => 'sidebar-menu', 'menu_class'=>'sidebar_menu')); ?></aside>
  893.  
  894. <?php }
  895.  
  896. register_sidebar_widget('Sidebar Menu', 'sidebarMenuWidget');
  897.  
  898. */
  899.  
  900.  
  901.  
  902. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement