コード例 #1
0
    public function get_l_price()
    {
        if ('property' == $this->post_type || 'land' == $this->post_type || 'rural' == $this->post_type) {
            if ('sold' == $this->get_property_meta('property_status')) {
                $l_price = '<li class="page-price sold-status">' . $this->label_sold . '</li>';
            } elseif ('' != $this->get_property_price_display() && 'yes' == $this->get_property_meta('property_price_display')) {
                // Property
                $l_price = '<li class="page-price">' . $this->get_property_price_display() . '</li>';
            } else {
                if (!empty($this->epl_settings) && isset($this->epl_settings['label_poa'])) {
                    $price_plain_value = $this->epl_settings['label_poa'];
                }
                $l_price = '<li class="page-price">' . $price_plain_value . '</li>';
            }
            if ('yes' == $this->get_property_meta('property_under_offer') && 'sold' != $this->get_property_meta('property_status')) {
                $l_price = '<li class="page-price under-offer-status">' . $this->label_under_offer . '</li>';
            }
        } elseif ('rental' == $this->post_type) {
            if ('' != $this->get_property_rent() && 'yes' == $this->get_property_meta('property_rent_display') && 'leased' != $this->get_property_meta('property_status')) {
                $l_price = '<li class="page-price-rent">
							<span class="page-price" style="margin-right:0;">' . $this->get_property_rent() . '</span>
							<span class="rent-period">/' . $this->get_property_meta('property_rent_period') . '</span>
						</li>';
            } elseif ('leased' == $this->get_property_meta('property_status')) {
                $l_price = '<li class="page-price sold-status">' . $this->label_leased . '</li>';
            }
        } elseif ('commercial' == $this->post_type || 'business' == $this->post_type || 'commercial_land' == $this->post_type) {
            $rent_lease_type = $this->get_property_meta('property_com_rent_period') != '' ? epl_listing_load_meta_commercial_rent_period_value($this->get_property_meta('property_com_rent_period')) : 'P.A.';
            if ('sold' == $this->get_property_meta('property_status')) {
                $l_price = '<li class="status-sticker sold">' . $this->label_sold . '</li>';
            } elseif ('' != $this->get_property_price_display() && 'yes' == $this->get_property_meta('property_price_display')) {
                // Property
                $l_price = '<li class="page-price"><span class="page-price-prefix">' . apply_filters('epl_commercial_for_sale_label', __('For Sale', 'epl')) . '</span> ' . $this->get_property_price_display() . $this->get_property_tax() . '</li>';
            } else {
                $price_plain_value = '';
                if (!empty($this->epl_settings) && isset($this->epl_settings['label_poa'])) {
                    $price_plain_value = $this->epl_settings['label_poa'];
                }
                $l_price = '<li class="page-price">' . $price_plain_value . '</li>';
            }
            if ('yes' == $this->get_property_meta('property_under_offer') && 'sold' != $this->get_property_meta('property_status')) {
                $l_price = '<li class="page-price under-offer-status">' . $this->label_under_offer . '</li>';
            }
            if ($this->get_property_com_rent() != '' && $this->get_property_meta('property_com_listing_type') == 'both') {
                $l_price .= '<li class="page-price"><span class="page-price-prefix">' . apply_filters('epl_commercial_for_lease_label', __('For Lease', 'epl')) . '</span> ' . $this->get_property_com_rent() . ' ' . __($rent_lease_type, 'epl') . '</li>';
            } elseif ($this->get_property_com_rent() != '' && $this->get_property_meta('property_com_listing_type') == 'lease') {
                $l_price = '<li class="page-price"><span class="page-price-prefix">' . apply_filters('epl_commercial_for_lease_label', __('For Lease', 'epl')) . '</span> ' . $this->get_property_com_rent() . ' ' . __($rent_lease_type, 'epl') . '</li>';
            }
        }
        return $l_price;
    }
コード例 #2
0
    /**
     * Manage Admin Business Post Type Columns: Row Contents
     *
     * @since 1.0
     */
    function epl_manage_business_columns_value($column, $post_id)
    {
        global $post, $property, $epl_settings;
        switch ($column) {
            /* If displaying the 'Featured' image column. */
            case 'property_thumb':
                do_action('epl_manage_listing_column_property_thumb_before');
                do_action('epl_manage_listing_column_property_thumb');
                do_action('epl_manage_listing_column_property_thumb_after');
                break;
            case 'listing':
                /* Get the post meta. */
                $property_address_suburb = get_the_term_list($post->ID, 'location', '', ', ', '');
                $heading = get_post_meta($post_id, 'property_heading', true);
                $category = get_post_meta($post_id, 'property_commercial_category', true);
                $homeopen = get_post_meta($post_id, 'property_inspection_times', true);
                $outgoings = get_post_meta($post_id, 'property_com_outgoings', true);
                $return = get_post_meta($post_id, 'property_com_return', true);
                $land = get_post_meta($post_id, 'property_land_area', true);
                $land_unit = get_post_meta($post_id, 'property_land_area_unit', true);
                if (empty($heading)) {
                    echo '<strong>' . __('Important! Set a Heading', 'epl') . '</strong>';
                } else {
                    echo '<div class="type_heading"><strong>', $heading, '</strong></div>';
                }
                if (!empty($category)) {
                    echo '<div class="epl_meta_category">Category: ', $category, '</div>';
                }
                echo '<div class="type_suburb">', $property_address_suburb, '</div>';
                if (!empty($outgoings)) {
                    echo '<div class="epl_meta_outgoings">Outgoings: ', epl_currency_formatted_amount($outgoings), '</div>';
                }
                if (!empty($return)) {
                    echo '<div class="epl_meta_baths">Return: ', $return, '%</div>';
                }
                if (!empty($land)) {
                    echo '<div class="epl_meta_land_details">';
                    echo '<span class="epl_meta_land">Land: ', $land, '</span>';
                    echo '<span class="epl_meta_land_unit"> ', $land_unit, '</span>';
                    echo '</div>';
                }
                if (!empty($homeopen)) {
                    $homeopen = array_filter(explode("\n", $homeopen));
                    $homeopen_list = '<ul class="epl_meta_home_open">';
                    foreach ($homeopen as $num => $item) {
                        $homeopen_list .= '<li>' . htmlspecialchars($item) . '</li>';
                    }
                    $homeopen_list .= '</ul>';
                    echo '<div class="epl_meta_home_open_label"><span class="home-open"><strong>' . $epl_settings['label_home_open'] . '</strong></span>', $homeopen_list, '</div>';
                }
                break;
                /* If displaying the 'Listing ID' column. */
            /* If displaying the 'Listing ID' column. */
            case 'listing_id':
                do_action('epl_manage_listing_column_listing_id_before');
                do_action('epl_manage_listing_column_listing_id');
                do_action('epl_manage_listing_column_listing_id_after');
                break;
                /* If displaying the 'Geocoding' column. */
            /* If displaying the 'Geocoding' column. */
            case 'geo':
                do_action('epl_manage_listing_column_geo_before');
                do_action('epl_manage_listing_column_geo');
                do_action('epl_manage_listing_column_geo_after');
                break;
                /* If displaying the 'Price' column. */
            /* If displaying the 'Price' column. */
            case 'property_price':
                $price = get_post_meta($post_id, 'property_price', true);
                $view = get_post_meta($post_id, 'property_price_view', true);
                $property_under_offer = get_post_meta($post_id, 'property_under_offer', true);
                $lease = get_post_meta($post_id, 'property_com_rent', true);
                $lease_period = get_post_meta($post_id, 'property_com_rent_period', true);
                $lease_date = get_post_meta($post_id, 'property_com_lease_end_date', true);
                $max_price = '2000000';
                if (isset($epl_settings['epl_max_graph_sales_price'])) {
                    $max_price = (int) $epl_settings['epl_max_graph_sales_price'];
                }
                $property_status = ucfirst(get_post_meta($post_id, 'property_status', true));
                $property_authority = get_post_meta($post_id, 'property_authority', true);
                $sold_price = get_post_meta($post_id, 'property_sold_price', true);
                if (!empty($property_under_offer) && 'yes' == $property_under_offer) {
                    $class = 'bar-under-offer';
                } elseif ($property_status == 'Current') {
                    $class = 'bar-home-open';
                } elseif ($property_status == 'Sold' || $property_status == 'Leased') {
                    $class = 'bar-home-sold';
                } else {
                    $class = '';
                }
                if ($sold_price != '') {
                    $barwidth = $max_price == 0 ? 0 : $sold_price / $max_price * 100;
                } else {
                    $barwidth = $max_price == 0 ? 0 : $price / $max_price * 100;
                }
                echo '
					<div class="epl-price-bar ' . $class . '">
						<span style="width:' . $barwidth . '%"></span>
					</div>';
                if (!empty($property_under_offer) && 'yes' == $property_under_offer) {
                    echo '<div class="type_under_offer">' . $property->label_under_offer . '</div>';
                }
                if (empty($view)) {
                    echo '<div class="epl_meta_search_price">' . __('Sale', 'epl') . ': ', epl_currency_formatted_amount($price), '</div>';
                } else {
                    echo '<div class="epl_meta_price">', $view, '</div>';
                }
                if (!empty($lease)) {
                    if (empty($lease_period)) {
                        $lease_period = 'annual';
                    }
                    echo '<div class="epl_meta_lease_price">Lease: ', epl_currency_formatted_amount($lease), ' ', epl_listing_load_meta_commercial_rent_period_value($lease_period), '</div>';
                }
                if (!empty($lease_date)) {
                    echo '<div class="epl_meta_lease_date">' . __('Lease End', 'epl') . ': ', $lease_date, '</div>';
                }
                if ($property_authority == 'auction') {
                    _e('Auction ', 'epl');
                    echo '<br>' . $property->get_property_auction(true);
                }
                break;
                /* If displaying the 'Commercial Listing Type' column. */
            /* If displaying the 'Commercial Listing Type' column. */
            case 'listing_type':
                /* Get the post meta. */
                $listing_type = get_post_meta($post_id, 'property_com_listing_type', true);
                /* If no duration is found, output a default message. */
                if (!empty($listing_type)) {
                    echo $listing_type;
                }
                break;
                /* If displaying the 'property_status' column. */
            /* If displaying the 'property_status' column. */
            case 'property_status':
                do_action('epl_manage_listing_column_property_status_before');
                do_action('epl_manage_listing_column_property_status');
                do_action('epl_manage_listing_column_property_status_after');
                break;
            case 'agent':
                do_action('epl_manage_listing_column_agent_before');
                do_action('epl_manage_listing_column_agent');
                do_action('epl_manage_listing_column_agent_after');
                break;
                /* Just break out of the switch statement for everything else. */
            /* Just break out of the switch statement for everything else. */
            default:
                break;
        }
    }