Exemplo n.º 1
0
function tampa_custom_home_listing_list($listing_html, $listing_data)
{
    // pls_dump($listing_data);
    ob_start();
    ?>
		<section class="list-unit">

			<section class="lu-left">
				<?php 
    if (isset($listing_data['images']) && is_array($listing_data['images'])) {
        ?>
		      	<?php 
        echo PLS_Image::load($listing_data['images'][0]['url'], array('resize' => array('w' => 144, 'h' => 93, 'method' => 'crop'), 'fancybox' => true));
        ?>
					<?php 
    } else {
        ?>
					<?php 
        echo PLS_Image::load('', array('resize' => array('w' => 144, 'h' => 93, 'method' => 'crop'), 'fancybox' => true));
        ?>
		     <?php 
    }
    ?>

     		<?php 
    if (isset($listing_data['rets']['mls_id']) && $listing_data['rets']['mls_id']) {
        ?>
       		<p class="mls"><span>MLS #:</span> <?php 
        echo $listing_data['rets']['mls_id'];
        ?>
</p>
       		<?php 
    }
    ?>

			</section>	

			<section class="lu-right">
				<div class="lu-address">
					<h4><a href="<?php 
    echo $listing_data['cur_data']['url'];
    ?>
"><?php 
    echo $listing_data['location']['address'];
    ?>
</a></h4>
					<p class="area"><?php 
    echo $listing_data['location']['locality'];
    ?>
, <?php 
    echo $listing_data['location']['region'];
    ?>
</p>
				</div><!--lu-address-->

				<div class="lu-price">
					<p class="price"><strong><?php 
    echo PLS_Format::number($listing_data['cur_data']['price'], array('abbreviate' => false, 'add_currency_sign' => true));
    ?>
</strong><?php 
    if ($listing_data['cur_data']['lse_trms'] != null) {
        echo $listing_data['cur_data']['lse_trms'];
    }
    ?>
</p>
					<p class="rent-label"><?php 
    if (isset($listing_data['purchase_types'][0])) {
        echo ucwords($listing_data['purchase_types'][0]);
    }
    ?>
</p>
				</div><!--lu-price-->

				<div class="lu-main">
				<?php 
    if (isset($listing_data['cur_data']['desc'])) {
        echo '<p>';
        if (strlen($listing_data['cur_data']['desc']) < 200) {
            echo $listing_data['cur_data']['desc'];
        } else {
            $position = strrpos(substr($listing_data['cur_data']['desc'], 0, 200), ' ');
            echo substr($listing_data['cur_data']['desc'], 0, $position) . '...';
        }
        echo '</p>';
    }
    ?>
					<p class="info"><span><?php 
    echo $listing_data['cur_data']['beds'];
    ?>
</span> Bedrooms | <span><?php 
    echo $listing_data['cur_data']['baths'];
    ?>
</span> Bathrooms 
						<?php 
    if ($listing_data['cur_data']['sqft'] != null) {
        echo '| <span>' . PLS_Format::number($listing_data['cur_data']['sqft'], array('abbreviate' => false, 'add_currency_sign' => false)) . '</span> sqft';
    }
    ?>
</p>
					<!-- <a class="fav" href="#">Add to Favorites</a> -->					
				<?php 
    $api_whoami = PLS_Plugin_API::get_user_details();
    ?>

				<?php 
    if (pls_get_option('pls-user-email')) {
        ?>
					<a class="info-bt" href="mailto:<?php 
        echo pls_get_option('pls-user-email');
        ?>
" target="_blank"><?php 
        _e('Request Information', 'tampa');
        ?>
</a>
				<?php 
    } else {
        ?>
					<a class="info-bt" href="mailto:<?php 
        echo $api_whoami['user']['email'];
        ?>
" target="_blank"><?php 
        _e('Request Information', 'tampa');
        ?>
</a>
				<?php 
    }
    ?>
					<a class="see-details-link details-bt" href="<?php 
    echo $listing_data['cur_data']['url'];
    ?>
"><?php 
    _e('See Details', 'tampa');
    ?>
</a>
				</div><!--lu-main-->
			</section><!--lu-right-->
    <?php 
    PLS_Listing_Helper::get_compliance(array('context' => 'inline_search', 'agent_name' => $listing_data['rets']['aname'], 'office_name' => $listing_data['rets']['oname'], 'office_phone' => PLS_Format::phone($listing_data['contact']['phone']), 'agent_license' => isset($listing_data['rets']['alicense']) ? $listing_data['rets']['alicense'] : false, 'co_agent_name' => isset($listing_data['rets']['aconame']) ? $listing_data['rets']['aconame'] : false, 'co_office_name' => isset($listing_data['rets']['oconame']) ? $listing_data['rets']['oconame'] : false));
    ?>
			<div class="clr"></div>

		</section><!--list-unit-->
     <?php 
    $listing_html = ob_get_clean();
    return $listing_html;
}
Exemplo n.º 2
0
"><?php 
    bloginfo('name');
    ?>
</a></h1>
					<p id="slogan"><?php 
    bloginfo('description');
    ?>
</p>
				<?php 
}
?>

			</section>

			<?php 
$api_whoami = PLS_Plugin_API::get_user_details();
?>

			<?php 
if ($email || $phone) {
    ?>

			<section class="contact-info">

				<?php 
    if ($email) {
        ?>

				<section class="email"><?php 
        _e('Email', 'manchester');
        ?>
Exemplo n.º 3
0
function ajax_placester_contact()
{
    if (!empty($_POST)) {
        $error = "";
        $message = "A prospective client wants to get in touch with you. \n\n";
        // Check to make sure that the name field is not empty
        if (trim($_POST['name']) == '' || trim($_POST['name']) == 'Name') {
            $error .= "Your name is required<br/>";
        } else {
            $message .= "Name: " . trim($_POST['name']) . " \n";
        }
        // Check to make sure sure that a valid email address is submitted
        if (trim($_POST['email']) == '' || trim($_POST['email']) == 'Email Address') {
            $error .= "An email address is required<br/>";
        } else {
            if (!preg_match("/^[A-Z0-9._%-]+@[A-Z0-9._%-]+\\.[A-Z]{2,4}\$/i", trim($_POST['email']))) {
                $error .= "A valid email address is required<br/>";
            } else {
                $message .= "Email Address: " . trim($_POST['email']) . " \n";
            }
        }
        // Check to make sure that the phone number field is not empty
        if (isset($_POST['phone'])) {
            if (trim($_POST['phone']) == '' || trim($_POST['phone']) == 'Phone Number') {
                $error .= "Your phone number is required<br/>";
            } else {
                $message .= "Phone Number: " . trim($_POST['phone']) . " \n";
            }
        }
        // Check the subject field
        if (isset($_POST['subject'])) {
            if (trim($_POST['subject']) == '') {
                // $message .= "They did not include a subject \n\n ";
                $subject = '';
            } else {
                $message .= "Subject: " . trim($_POST['subject']) . " \n";
                $subject = ': ' . trim($_POST['subject']);
            }
        }
        // Check the departments field
        if (isset($_POST['department'])) {
            if (trim($_POST['department']) == '') {
                // $message .= "They didn't select a department \n\n ";
            } else {
                $message .= "Requested Departments: " . trim($_POST['department']) . " \n";
            }
        }
        // Check the question field
        if (trim($_POST['question']) == '') {
            $message .= "They left no comment nor question. \n\n ";
        } else {
            $message .= "Questions: " . trim($_POST['question']) . " \n";
        }
        if (empty($_POST['id'])) {
            // $message .= "Listing ID: No specific listing \n";
        } else {
            $message .= "Listing ID: " . trim($_POST['id']) . " \n";
        }
        if (trim($_POST['fullAddress']) == '') {
            // $message .= "Listing Address: No specific listing \n";
        } else {
            $message .= "Listing Address: " . $_POST['fullAddress'] . " \n";
        }
        $message .= "\n";
        $message .= "This message was sent from the contact form at: \n" . $_SERVER['HTTP_REFERER'] . " \n";
        if (empty($error)) {
            $api_whoami = PLS_Plugin_API::get_user_details();
            $user_email = @pls_get_option('pls-user-email');
            // Check what email to send the form to...
            if (!empty($user_email)) {
                $email = $user_email;
            } elseif (!empty($api_whoami['user']['email'])) {
                $email = $api_whoami['user']['email'];
            } else {
                $email = $api_whoami['email'];
            }
            if (trim($_POST['send_to_email']) == true) {
                $email = $_POST['send_to_email'];
            }
            $headers = array();
            if (!empty($_POST['cc_value'])) {
                $headers[] = 'Cc: ' . $_POST['cc_value'];
            }
            if (!empty($_POST['bcc_value'])) {
                $headers[] = 'Bcc: ' . $_POST['bcc_value'];
            }
            // Append form title
            if (!empty($_POST['form_title'])) {
                $message .= "This message was sent from the contact form named: \n" . $_POST['form_title'];
            }
            // Append form's custom link
            if (!empty($_POST['custom_link'])) {
                $message .= "The visitor was sent to: \n" . $_POST['custom_link'];
            }
            if (trim($_POST['email_confirmation']) == true) {
                wp_mail($email, 'Email confirmation was sent to ' . $_POST['email'] . ' from ' . home_url(), $message, $headers);
            } elseif ($email) {
                $placester_Mail = wp_mail($email, 'Prospective client from ' . home_url(), $message, PLS_Plugin_API::merge_bcc_forwarding_addresses_for_sending($headers));
            }
            $name = $_POST['name'];
            PLS_Plugin_API::create_person(array('metadata' => array('name' => $name, 'email' => $_POST['email'])));
            // Send a email confirmation
            if (trim($_POST['email_confirmation']) == true) {
                ob_start();
                include get_template_directory() . '/custom/contact-form-email.php';
                $message_to_submitter = ob_get_clean();
                wp_mail($_POST['email'], 'Form Submitted' . $subject, $message_to_submitter);
            }
            // As long as there are no errors we'll allow custom links to override
            // the normal form submission.
            if (!empty($_POST['custom_link'])) {
                return false;
            }
            echo "sent";
        } else {
            echo $error;
        }
        die;
    }
}
Exemplo n.º 4
0
function manchester_custom_home_listing_list($listing_html, $listing_data)
{
    // pls_dump($listing_data);
    ob_start();
    ?>

<section class="list-item">                                                  
	
	<section class="list-pic">

		<div class="thumbs">
			<?php 
    if (isset($listing_data['images']) && is_array($listing_data['images'])) {
        ?>
        	<?php 
        echo PLS_Image::load($listing_data['images'][0]['url'], array('resize' => array('w' => 144, 'h' => 93, 'method' => 'crop'), 'fancybox' => true));
        ?>
    	
				<?php 
    } else {
        ?>
				<?php 
        echo PLS_Image::load('', array('resize' => array('w' => 144, 'h' => 93, 'method' => 'crop'), 'fancybox' => true));
        ?>
       <?php 
    }
    ?>
		</div>

		<?php 
    if (isset($listing_data['rets']['mls_id'])) {
        ?>
  		<p class="nrm-txt"><?php 
        _e('MLS', 'manchester');
        ?>
 #: <?php 
        echo $listing_data['rets']['mls_id'];
        ?>
</p>
  	<?php 
    }
    ?>

	</section>

	<section class="list-txt">

		<section class="list-info">

			<h5><a href="<?php 
    echo $listing_data['cur_data']['url'];
    ?>
"><?php 
    echo $listing_data['location']['address'];
    ?>
</a></h5>
			<h6><?php 
    echo $listing_data['location']['locality'];
    ?>
, <?php 
    echo $listing_data['location']['region'];
    ?>
</h6>
				<?php 
    if (isset($listing_data['cur_data']['desc'])) {
        echo '<p class="nrm-txt">';
        if (strlen($listing_data['cur_data']['desc']) < 150) {
            echo $listing_data['cur_data']['desc'];
        } else {
            $position = strrpos(substr($listing_data['cur_data']['desc'], 0, 150), ' ');
            echo substr($listing_data['cur_data']['desc'], 0, $position) . '...';
        }
        echo '</p>';
    }
    ?>

			<p class="nrm-txt">
				<b><?php 
    echo $listing_data['cur_data']['beds'];
    ?>
</b> <span class="beds-n-baths"><?php 
    _e('Beds', 'manchester');
    ?>
</span> | 
				<b><?php 
    echo $listing_data['cur_data']['baths'];
    ?>
</b> <span class="beds-n-baths"><?php 
    _e('Baths', 'manchester');
    ?>
</span> 
				<?php 
    if (isset($listing_data['cur_data']['sqft'])) {
        echo '| <b>' . PLS_Format::number($listing_data['cur_data']['sqft'], array('abbreviate' => false, 'add_currency_sign' => false)) . '</b><span class="beds-n-baths"> ' . __('sqft', 'manchester') . '</span>';
    }
    ?>
			</p>

		</section><!-- /list-info -->

		<section class="list-price">
			
			<span class="green"><b><?php 
    echo PLS_Format::number($listing_data['cur_data']['price'], array('abbreviate' => false));
    ?>
</b>
			<?php 
    if ($listing_data['cur_data']['lse_trms'] != null) {
        // translate lease terms to human form
        echo PLS_Format::translate_lease_terms($listing_data);
    }
    ?>
			</span><br />
			
			<span class="nrm-txt">
				<?php 
    if ($listing_data['property_type'] == "fam_home") {
        echo __("Single Family Home", 'manchester');
    } else {
        $prop_type_frmttd = is_array($listing_data['property_type']) ? implode($listing_data['property_type']) : $listing_data['property_type'];
        echo ucwords($prop_type_frmttd);
    }
    ?>
			</span>

		</section><!-- /list-price -->

		<section class="list-links">

			<!-- <section class="list-fav"><a href="#">Add to favorites</a></section> -->
			<?php 
    $api_whoami = PLS_Plugin_API::get_user_details();
    if (pls_get_option('pls-user-email')) {
        ?>
			<section class="list-req">
				<a href="mailto:<?php 
        echo pls_get_option('pls-user-email');
        ?>
" target="_blank"><?php 
        _e('Request more info', 'manchester');
        ?>
</a>
			</section>
			<?php 
    } else {
        ?>
			<section class="list-req">
				<a href="mailto:<?php 
        echo $api_whoami['user']['email'];
        ?>
"><?php 
        _e('Request more info', 'manchester');
        ?>
</a>
			</section>
			<?php 
    }
    ?>

			<section class="list-btn1">
				<div class="img_btn">
					<a href="<?php 
    echo $listing_data['cur_data']['url'];
    ?>
"><input type="submit" Value="<?php 
    _e('See Details', 'manchester');
    ?>
" class="button b-blue medium" /></a>
				</div>
			</section>

		</section><!-- /list-links -->

	</section><!-- /list-text -->

    <?php 
    PLS_Listing_Helper::get_compliance(array('context' => 'inline_search', 'agent_name' => $listing_data['rets']['aname'], 'office_name' => $listing_data['rets']['oname'], 'office_phone' => PLS_Format::phone($listing_data['contact']['phone']), 'agent_license' => isset($listing_data['rets']['alicense']) ? $listing_data['rets']['alicense'] : false, 'co_agent_name' => isset($listing_data['rets']['aconame']) ? $listing_data['rets']['aconame'] : false, 'co_office_name' => isset($listing_data['rets']['oconame']) ? $listing_data['rets']['oconame'] : false));
    ?>
	
</section><!-- /list-item -->

<div class="separator-1-sma"></div>

<?php 
    // END FOR EACH
    ?>

     <?php 
    $listing_html = ob_get_clean();
    return $listing_html;
}
Exemplo n.º 5
0
    public function widget($args, $instance)
    {
        // Widget output
        ?>
		<?php 
        extract($args);
        ?>

    <?php 
        $agent = PLS_Plugin_API::get_user_details();
        ?>
   
		<section class="widget pls-map widget-pls-map" itemscope itemtype="http://schema.org/LocalBusiness">
			<?php 
        $title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']);
        ?>
			<?php 
        $subtitle = empty($instance['subtitle']) ? ' ' : apply_filters('subtitle', $instance['subtitle']);
        ?>
			<?php 
        $street_address = empty($instance['street_address']) ? ' ' : apply_filters('street_address', $instance['street_address']);
        ?>
			<?php 
        $city_state_zip = empty($instance['city_state_zip']) ? ' ' : apply_filters('city_state_zip', $instance['city_state_zip']);
        ?>
			<?php 
        $lat = empty($instance['lat']) ? ' ' : apply_filters('lat', $instance['lat']);
        ?>
			<?php 
        $lng = empty($instance['lng']) ? ' ' : apply_filters('lng', $instance['lng']);
        ?>
			<?php 
        $width = empty($instance['width']) ? ' ' : apply_filters('width', $instance['width']);
        ?>
			<?php 
        $height = empty($instance['height']) ? ' ' : apply_filters('height', $instance['height']);
        ?>

			<h3><?php 
        echo $title;
        ?>
</h3>

			<section id="map-widget">

        <script src="http://maps.googleapis.com/maps/api/js?sensor=false" type="text/javascript"></script>

				<script type="text/javascript">
					jQuery(document).ready(function () {

								var myOptions = {
									center: new google.maps.LatLng(<?php 
        echo $lat;
        ?>
, <?php 
        echo $lng;
        ?>
),
									zoom: 12,
									mapTypeId: google.maps.MapTypeId.ROADMAP
								};
							
								var map = new google.maps.Map(document.getElementById("simple_map"),
									myOptions);
							
								var position = new google.maps.LatLng(<?php 
        echo $lat;
        ?>
, <?php 
        echo $lng;
        ?>
);
								var marker = new google.maps.Marker({
									position: position,
									map: map,
								});
						});
				</script>

			<div id="simple_map" style="width: <?php 
        echo $width;
        ?>
px; height: <?php 
        echo $height;
        ?>
px;"></div>

        <span itemprop="name" style="display:none;"><?php 
        echo $agent['provider']['name'];
        ?>
</span>
				<p class="office p4" itemprop="description"><?php 
        echo $subtitle;
        ?>
</p>
				<p class="address h5" itemprop="address"><?php 
        echo $street_address;
        ?>
 <br><?php 
        echo $city_state_zip;
        ?>
</p>

			</section><!-- /#map-widget -->

		</section><!-- /.widget-pls-quick-search -->
		<?php 
    }
Exemplo n.º 6
0
 /**
  * Outputs and filters the widget.
  * 
  * The widget connects to the plugin using the framework plugin api class. 
  * If the class returns false, this means that either the plugin is 
  * missing, either the it has no API key set.
  *
  * @since 0.0.1
  */
 public function widget($args, $instance)
 {
     list($args, $instance) = self::process_defaults($args, $instance);
     /** Extract the arguments into separate variables. */
     extract($args, EXTR_SKIP);
     /** Get the agent information from the plugin. */
     $agent = PLS_Plugin_API::get_user_details();
     $agent_array = array();
     // pls_dump($agent);
     /** If the plugin is active, and has an API key set... */
     if ($agent) {
         /* Output the theme's $before_widget wrapper. */
         echo $before_widget;
         /* If a title was input by the user, display it. */
         $widget_title = '';
         if (!empty($instance['title'])) {
             $widget_title = $before_title . apply_filters('widget_title', $instance['title'], $instance, $this->id_base) . $after_title;
         }
         /** This array will hold the html for the agent info sections and will be passed to the filters. */
         $agent_html = $instance;
         unset($agent_html['title']);
         // Add Name
         if (!empty($instance['name_custom'])) {
             // if admin set custom name
             $agent_html['name'] = self::checkForCustom($instance, 'name');
             $agent_array['name'] = $instance['name_custom'];
         } else {
             // otherwise use admin's name
             if (!empty($instance['name']) && (!empty($agent['user']['first_name']) || !empty($agent['user']['last_name']))) {
                 $agent_html['name'] = pls_h_p(trim($agent['user']['first_name'] . ' ' . $agent['user']['last_name']), array('class' => 'fn h5', 'itemprop' => 'name'));
                 $agent_array['name'] = $agent['user']['first_name'] . ' ' . $agent['user']['last_name'];
             } else {
                 $agent_html['name'] = '';
                 $agent_array['name'] = '';
             }
         }
         // Add Email
         if (!empty($instance['email_custom'])) {
             // if admin set custom email
             $agent_html['email'] = self::checkForCustom($instance, 'email');
             $agent_array['email'] = $instance['email_custom'];
         } else {
             // otherwise use admin's email
             if (!empty($instance['email']) && !empty($agent['user']['email'])) {
                 $agent_html['email'] = pls_h_p(pls_h_a("mailto:{$agent['user']['email']}", $agent['user']['email']), array('class' => 'email', 'itemprop' => 'email'));
                 $agent_array['email'] = $agent['user']['email'];
             } else {
                 $agent_html['email'] = '';
                 $agent_array['email'] = '';
             }
         }
         // Add Phone
         if (!empty($instance['phone_custom'])) {
             // if admin set custom phone
             $agent_html['phone'] = self::checkForCustom($instance, 'phone');
             $agent_array['phone'] = $instance['phone_custom'];
         } else {
             // otherwise use admin's phone
             if (!empty($instance['phone']) && !empty($agent['user']['phone'])) {
                 $agent_html['phone'] = pls_h_p(PLS_Format::phone($agent['user']['phone']), array('class' => 'phone', 'itemprop' => 'phone'));
                 $agent_array['phone'] = PLS_Format::phone($agent['user']['phone'], array('class' => 'phone', 'itemprop' => 'phone'));
             } else {
                 $agent_html['phone'] = '';
                 $agent_array['phone'] = '';
             }
         }
         // Add Description
         if (!empty($instance['description_custom'])) {
             // if admin set custom description
             $agent_html['description'] = self::checkForCustom($instance, 'description');
             $agent_array['description'] = $instance['description_custom'];
         } else {
             // otherwise use admin's descriptions
             if (!empty($instance['description']) && pls_get_option('pls-user-description')) {
                 $agent_bio = pls_get_option('pls-user-description');
                 $agent_html['description'] = pls_h_p($agent_bio, array('class' => 'desc p4', 'itemprop' => 'description'));
                 $agent_array['description'] = $agent_bio;
             } else {
                 $agent_html['description'] = '';
                 $agent_array['description'] = '';
             }
         }
         // Add Photo
         if (!empty($instance['image_uri'])) {
             // if admin set custom photo
             self::checkForCustom($instance, 'photo');
             $agent_array['photo'] = $instance['image_uri'];
         } else {
             // otherwise use admin's photo
             $user_image_option = pls_get_option('pls-user-image');
             if (!empty($instance['photo']) && !empty($user_image_option)) {
                 $agent_html['photo'] = pls_h_img(@pls_get_option('pls-user-image'), trim($agent['user']['first_name'] . ' ' . $agent['user']['last_name']), array('class' => 'photo', 'itemprop' => 'image') + array() + array());
                 $agent_array['photo'] = $user_image_option;
             } else {
                 if (isset($agent['user']['headshot'])) {
                     $agent_html['photo'] = pls_h_img($agent['user']['headshot'], trim($agent['user']['first_name'] . ' ' . $agent['user']['last_name']), array('class' => 'photo', 'itemprop' => 'image') + array() + array());
                     $agent_array['photo'] = $agent['user']['headshot'];
                 } else {
                     $agent_array['photo'] = '';
                 }
             }
         }
         // Form the HTML elements
         // photo
         $agent_html['photo'] = '<img class="pls-agent-phone" src="' . esc_url($instance['image_uri']) . '" />';
         // texts
         $agent_info = array('name', 'email', 'phone', 'description');
         foreach ($agent_info as $value) {
             $agent_html[$value] = pls_h_p($agent_html[$value], array('class' => 'pls-agent-' . $value));
         }
         /** Combine the agent information. */
         $widget_body = $agent_html['photo'] . $agent_html['name'] . $agent_html['email'] . $agent_html['phone'] . $agent_html['description'];
         /** Wrap the agent information in a section element. */
         $widget_body = apply_filters('pls_widget_agent_inner', $widget_body, $agent_html, $agent_array, $instance, $agent, $widget_id);
         /** Apply a filter on the whole widget */
         echo apply_filters('pls_widget_agent', $widget_title . $widget_body, $widget_title, $before_title, $after_title, $widget_body, $agent_html, $agent, $instance, $widget_id);
         /* Close the theme's widget wrapper. */
         if ($args['clearfix']) {
             echo '<div class="clearfix"></div>';
         }
         echo $after_widget;
     } elseif (current_user_can('administrator')) {
         /** Display an error message if the user is admin. */
         // echo pls_get_no_plugin_placeholder( $widget_id );
     }
 }
Exemplo n.º 7
0
function custom_side_agent_widget_html($post_item, $post_html)
{
    //pls_dump($post_html);
    $agent = PLS_Plugin_API::get_user_details();
    ob_start();
    ?>

	<section class="agent">
		<?php 
    if (pls_get_option('pls-user-image')) {
        ?>
			<img src="<?php 
        echo pls_get_option('pls-user-image');
        ?>
" alt="<?php 
        _e('agent photo', 'tampa');
        ?>
" height=120>
		<?php 
    } else {
        if (isset($agent['user']['headshot']) && $agent['user']['headshot']) {
            ?>
			<img src="<?php 
            echo $agent['user']['headshot'];
            ?>
" alt="<?php 
            _e('agent photo', 'tampa');
            ?>
" height=120>
		<?php 
        }
    }
    ?>

		<?php 
    if (pls_get_option('pls-user-name')) {
        ?>
			<h4><?php 
        echo pls_get_option('pls-user-name');
        ?>
</h4>
		<?php 
    } else {
        ?>
			<h4><?php 
        echo $agent['user']['first_name'] . ' ' . $agent['user']['last_name'];
        ?>
</h4>
		<?php 
    }
    ?>

		<?php 
    if (pls_get_option('pls-user-phone')) {
        ?>
			<span><?php 
        echo pls_get_option('pls-user-phone');
        ?>
</span>
		<?php 
    } else {
        ?>
			<span><?php 
        echo $agent['user']['phone'];
        ?>
</span
		<?php 
    }
    ?>

		<?php 
    if (pls_get_option('pls-user-email')) {
        ?>
			<span><a href="mailto:<?php 
        echo pls_get_option('pls-user-email');
        ?>
"><?php 
        echo pls_get_option('pls-user-email');
        ?>
</a></span>
		<?php 
    } else {
        ?>
			<span><a href="mailto:<?php 
        echo $agent['user']['email'];
        ?>
"><?php 
        echo $agent['user']['email'];
        ?>
</a></span>
		<?php 
    }
    ?>

		<?php 
    if (pls_get_option('pls-user-description')) {
        ?>
			<p><?php 
        echo pls_get_option('pls-user-description');
        ?>
</p>
		<?php 
    }
    ?>

	</section>

<?php 
    return trim(ob_get_clean());
}
Exemplo n.º 8
0
<?php

$email = pls_get_option('pls-user-email');
$phone = pls_get_option('pls-user-phone');
$email_str = $phone_str = $contact_str = '';
$street = pls_get_option('pls-company-street');
$locality = pls_get_option('pls-company-locality');
$region = pls_get_option('pls-company-region');
$postal = pls_get_option('pls-company-postal');
$street_str = $address_str = '';
$agent = PLS_Plugin_API::get_user_details();
$email = strval($email ? $email : $agent['user']['email']);
$phone = strval($phone ? $phone : $agent['user']['phone']);
$street = strval($street ? $street : $agent['location']['address']);
$locality = strval($locality ? $locality : $agent['location']['locality']);
$region = strval($region ? $region : $agent['location']['region']);
$postal = strval($postal ? $postal : $agent['location']['postal']);
if ($email) {
    $email_str = sprintf(__('Email: <a href="mailto:%s">%s</a><br />', 'manchester'), esc_attr($email), esc_html($email));
}
if ($phone) {
    $phone_str = sprintf(__('Phone: <strong>%s</strong>', 'manchester'), esc_html($phone));
}
if ($email_str || $phone_str) {
    $contact_str = sprintf('<p class="contact">%s%s</p>', $email_str, $phone_str);
}
if ($street) {
    $street_str = esc_html($street) . '<br />';
}
if ($street || $locality || $region || $postal) {
    $address_str = sprintf('<p class="address">%s %s %s %s<br /></p>', $street_str, esc_html($locality), esc_html($region), esc_html($postal));
Exemplo n.º 9
0
function custom_side_agent_widget_html($post_item, $post_html)
{
    //pls_dump($post_html);
    $agent = PLS_Plugin_API::get_user_details();
    ob_start();
    ?>

<section class="side-bin">

	<section class="agent">

		<section class="agent-thumb">
			<?php 
    if (pls_get_option('pls-user-image')) {
        ?>
				<img src="<?php 
        echo pls_get_option('pls-user-image');
        ?>
" alt="<?php 
        _e('Agent photo', 'manchester');
        ?>
" width=90 />
			<?php 
    } elseif (!empty($agent['user']['headshot'])) {
        ?>
				<img src="<?php 
        echo $agent['user']['headshot'];
        ?>
" alt="<?php 
        _e('Agent photo', 'manchester');
        ?>
" width=90 />
			<?php 
    }
    ?>
		</section>

		<section class="agent-text">
			
			<?php 
    if (pls_get_option('pls-user-name')) {
        ?>
				<h6 class="blue"><?php 
        echo pls_get_option('pls-user-name');
        ?>
</h6>
				<?php 
    } else {
        ?>
				<h6 class="blue"><?php 
        echo $agent['user']['first_name'] . ' ' . $agent['user']['last_name'];
        ?>
</h6>
			<?php 
    }
    ?>
			
			<?php 
    if (pls_get_option('pls-user-description')) {
        ?>
				<p class="nrm-txt"><?php 
        echo pls_get_option('pls-user-description');
        ?>
</p>
			<?php 
    }
    ?>
			<div class="divider"></div>

			<p class="nrm-txt">
				<?php 
    if (pls_get_option('pls-user-email')) {
        ?>
					<a href="mailto:<?php 
        echo pls_get_option('pls-user-email');
        ?>
"><?php 
        echo pls_get_option('pls-user-email');
        ?>
</a><br />
				<?php 
    } else {
        ?>
					<a href="mailto:<?php 
        echo $agent['user']['email'];
        ?>
"><?php 
        echo $agent['user']['email'];
        ?>
</a><br />
				<?php 
    }
    ?>

				<?php 
    if (pls_get_option('pls-user-phone')) {
        ?>
					<?php 
        echo pls_get_option('pls-user-phone');
        ?>
				<?php 
    } else {
        ?>
					<?php 
        echo $agent['user']['phone'];
        ?>
				<?php 
    }
    ?>
			</p>
		
		
		</section>

	</section>

</section>

<?php 
    return trim(ob_get_clean());
}