function show_options_rightpanel()
 {
     if (!defined('STAYPRESS_HIDE_DONATIONS')) {
         echo "<div class='sidebarbox'>";
         echo '<div title="Click to toggle" class="handlediv" id="handlestatus"><br></div>';
         echo "<h2 class='rightbarheading'>" . __('Show Your Support', 'property') . "</h2>";
         echo "<div class='innersidebarbox'>";
         echo "<div class='highlightbox blue'>";
         echo "<p>";
         echo __('We don\'t take donations here. Instead, we pick a charity every month and ask you to donate directly to them if you feel the urge to give.', 'property');
         echo "</p>";
         echo "</div>";
         echo "<div class='highlightbox'>";
         echo "<p>";
         echo __('<strong>Support Bite-Back</strong><br/><br/>Bite-Back is a pioneering shark and marine conservation charity which is running successful campaigns to end the sale of shark fin soup in Britain.<br/><br/>', 'property');
         echo '<img src="' . SPPCommon::property_url('images/biteback.jpg') . '" alt="bite-back" style="margin-left: 30px;" />';
         echo "</p>";
         echo "<p>";
         echo __('To find out more about Bite-Back visit their website <a href="http://www.bite-back.com/">here</a>.<br/><br/><strong>To make a direct donation please go <a href="https://uk.virginmoneygiving.com/fundraiser-web/donate/makeDonationForCharityDisplay.action?charityId=1002357&frequencyType=S">here</a></strong>.', 'property');
         echo "</p>";
         echo "<p>";
         echo __('If you make a donation, then please let us know and we\'ll make sure we put out a big thank you on our site.', 'property');
         echo "</p>";
         echo "</div>";
         echo "<br/>";
         echo "</div> <!-- innersidebarbox -->";
         echo "</div> <!-- sidebarbox -->";
         echo "<br/>";
     }
 }
示例#2
0
 function do_propertymap_shortcode($atts, $content = null, $code = "")
 {
     $defaults = array("property" => "define", "holder" => '', "holderclass" => '', "item" => 'div', "itemclass" => '', "postfix" => '', "prefix" => '', "itemislink" => 'no', "itemlink" => '', "wrapwith" => '', "wrapwithclass" => '', "width" => '500px', "height" => '250px', "background" => '#99B3CC', "style" => '', "marker" => SPPCommon::property_url('images/mapicons/black%%.png'), "markershadow" => SPPCommon::property_url('images/mapicons/shadow.png'), "markerobfuscate" => '0', "shownear" => 'no', "shownearreadiuskm" => '25', "shownearmarker" => SPPCommon::property_url('images/mapicons/gray%%.png'), "shownearmarkershadow" => SPPCommon::property_url('images/mapicons/shadow.png'), "showneartypes" => STAYPRESS_PROPERTY_POST_TYPE, "shownearnumber" => 25);
     extract(shortcode_atts($defaults, $atts));
     if ($property == 'define' && defined('STAYPRESS_ON_PROPERTY_PAGE')) {
         $property = (int) STAYPRESS_ON_PROPERTY_PAGE;
     } elseif ($property == 'define' && $this->inshortcodelist == true && !empty($this->shortcodeproperty)) {
         $property = (int) $this->shortcodeproperty;
     } elseif ($property == 'post') {
         $property = get_the_id();
     }
     $html = '';
     if (!empty($holder)) {
         $html .= "<{$holder} class='{$holderclass}'>";
     }
     if (!empty($item)) {
         $html .= "<{$item} id='staypress_map_{$property}' class='staypress_map {$itemclass}' style='width: {$width}; height: {$height}; background: {$background}; {$style}'>";
     }
     $html .= $prefix;
     if (!empty($wrapwith)) {
         $html .= "<{$wrapwith} class='{$wrapwithclass}'>";
     }
     $html .= $content;
     if (!empty($wrapwith)) {
         $html .= "</{$wrapwith}>";
     }
     $html .= $postfix;
     if (!empty($item)) {
         $html .= "</{$item}>";
     }
     if (!empty($holder)) {
         $html .= "</{$holder}>";
     }
     // Enqueue some data
     $post = get_post($property);
     if (!empty($post)) {
         if (!empty($post->latitude)) {
             $maindata = array("ID" => $property, "post_title" => $post->post_title, "post_excerpt" => $post->post_excerpt, "latitude" => $post->latitude, "longitude" => $post->longitude);
             switch ($post->post_type) {
                 case STAYPRESS_PROPERTY_POST_TYPE:
                     $maindata['permalink'] = sp_get_permalink('property', $post);
                     break;
                 case STAYPRESS_DESTINATION_POST_TYPE:
                     // Find the location
                     $maindata['permalink'] = get_permalink($post->ID);
                     break;
                 case 'post':
                     //
                 //
                 case 'page':
                     $maindata['permalink'] = get_permalink($post->ID);
                     break;
                 default:
             }
             SPPCommon::enqueue_data('staypress_shortcode_data', 'property_' . $property, array("1" => $maindata));
             if (strtolower($shownear) == 'yes') {
                 // Need to show the nearby items
                 $nearby = $this->get_posts_near($post->latitude, $post->longitude, $shownearreadiuskm, $shownearnumber);
                 if (!empty($nearby)) {
                     $startat = 2;
                     $nears = array();
                     foreach ($nearby as $key => $near) {
                         if ($property == $near->ID) {
                             continue;
                         }
                         $nears[$startat] = array("ID" => $near->ID, "post_title" => $near->post_title, "post_excerpt" => $near->post_excerpt, "latitude" => $near->latitude, "longitude" => $near->longitude);
                         switch ($post->post_type) {
                             case STAYPRESS_PROPERTY_POST_TYPE:
                                 $nears[$startat]['permalink'] = sp_get_permalink('property', $post);
                                 break;
                             case STAYPRESS_DESTINATION_POST_TYPE:
                                 // Find the location
                                 $nears[$startat]['permalink'] = get_permalink($post->ID);
                                 break;
                             case 'post':
                                 //
                             //
                             case 'page':
                                 $nears[$startat]['permalink'] = get_permalink($post->ID);
                                 break;
                             default:
                         }
                         $startat++;
                     }
                     SPPCommon::enqueue_data('staypress_shortcode_data', 'near_' . $property, $nears);
                 }
             }
         }
     }
     // enqueue the map icon locations
     if (!empty($marker)) {
         SPPCommon::enqueue_data('staypress_shortcode_data', 'mapicon_' . $property, $marker);
         SPPCommon::enqueue_data('staypress_shortcode_data', 'mapshadow_' . $property, $markershadow);
     }
     if (!empty($shownearmarker)) {
         SPPCommon::enqueue_data('staypress_shortcode_data', 'nearicon_' . $property, $shownearmarker);
         SPPCommon::enqueue_data('staypress_shortcode_data', 'nearshadow_' . $property, $shownearmarkershadow);
     }
     return $html;
 }
 function enqueue_page_headings()
 {
     // Only need these on the public side of the site
     if (is_admin()) {
         return;
     }
     // Check if we are actually being used anywhere
     if (is_active_widget(false, false, 'sp_propertiesbyowner')) {
         // we are an active widget so add in our styles and js
         wp_enqueue_style('nearbywidgetcss', SPPCommon::property_url('css/property.nearbywidget.css'), array(), $this->build);
     }
 }