Пример #1
0
    if (isset($gallery["items"]["gallery"][0])) {
        $params = array();
        $params['image_name'] = $gallery["items"]["gallery"][0]->item_name;
        $params['image_parentid'] = $gallery["items"]["gallery"][0]->parent_id;
        $params['image_parentkind'] = $gallery["items"]["gallery"][0]->parent_kind;
        $params['image_source'] = wpl_global::get_upload_base_path() . $params['image_parentid'] . DS . $params['image_name'];
        $image_title = wpl_property::update_property_title($gallery['raw']);
        if (isset($gallery['items']['gallery'][0]->item_extra2) and trim($gallery['items']['gallery'][0]->item_extra2) != '') {
            $image_alt = $gallery['items']['gallery'][0]->item_extra2;
        } else {
            $image_alt = $gallery['raw']['meta_keywords'];
        }
        $image_description = $gallery["items"]["gallery"][0]->item_extra2;
        if ($gallery["items"]["gallery"][0]->item_cat != 'external') {
            $image_url = wpl_images::create_gallary_image($image_width, $image_height, $params);
            $thumbnail_url = wpl_images::create_gallary_image($thumbnail_width, $thumbnail_height, $params);
        } else {
            $image_url = $gallery["items"]["gallery"][0]->item_extra3;
            $thumbnail_url = $gallery["items"]["gallery"][0]->item_extra3;
        }
        $larg_images .= '
		<li>
            <img itemprop="image" src="' . $image_url . '" alt="' . $image_alt . '" style="width: ' . $image_width . 'px; height: ' . $image_height . 'px;" />
            <div class="ei-title">
                <h2>' . $image_title . '</h2>
                <h3>' . $gallery["rendered"][10]["value"] . ' - ' . $gallery["location_text"] . '</h3>
                <a itemprop="url" class="more_info" href="' . $gallery["property_link"] . '">' . __('More info', WPL_TEXTDOMAIN) . '</a>
            </div>
        </li>';
        $thumbnail .= '<li><a href="#">' . $image_title . '</a><img src="' . $thumbnail_url . '" alt="' . $image_alt . '" width="' . $thumbnail_width . '" height="' . $thumbnail_height . '" style="width: ' . $thumbnail_width . 'px; height: ' . $thumbnail_height . 'px;" /></li>';
    }
Пример #2
0
    echo '<div class="no_image_box"></div>';
} else {
    $image_url = $gallery[0]['url'];
    if (isset($gallery[0]['item_extra2'])) {
        $image_alt = $gallery[0]['item_extra2'];
    } elseif (isset($wpl_properties['current']['raw']['meta_keywords'])) {
        $image_alt = $wpl_properties['current']['raw']['meta_keywords'];
    }
    if ($this->resize and $this->image_width and $this->image_height and $this->img_category != 'external') {
        /** set resize method parameters **/
        $params = array();
        $params['image_name'] = $gallery[0]['raw']['item_name'];
        $params['image_parentid'] = $gallery[0]['raw']['parent_id'];
        $params['image_parentkind'] = $gallery[0]['raw']['parent_kind'];
        $params['image_source'] = $gallery[0]['path'];
        /** resize image if does not exist **/
        $image_url = wpl_images::create_gallary_image($this->image_width, $this->image_height, $params, $this->watermark, $this->rewrite);
    }
    echo '<img itemprop="image" id="wpl_gallery_image' . $this->property_id . '" src="' . $image_url . '" class="wpl_gallery_image ' . $this->image_class . '" alt="' . $image_alt . '" width="' . $this->image_width . '" height="' . $this->image_height . '" style="width: ' . $this->image_width . 'px; height: ' . $this->image_height . 'px;" />';
}
?>

    <div class="wpl-listing-tags-wp">
        <div class="wpl-listing-tags-cnt">
            <?php 
/* Property tags */
echo $features . $hot_offer . $open_house . $forclosure;
?>
        </div>
    </div>
</div>
Пример #3
0
	<div id="main_infowindow">
		<div class="main_infowindow_l">
			<?php 
    if (isset($property['items']['gallery'])) {
        $i = 0;
        $images_total = count($property['items']['gallery']);
        foreach ($property['items']['gallery'] as $key1 => $image) {
            /** set resize method parameters **/
            $params = array();
            $params['image_name'] = $image->item_name;
            $params['image_parentid'] = $image->parent_id;
            $params['image_parentkind'] = $image->parent_kind;
            $params['image_source'] = wpl_global::get_upload_base_path() . $image->parent_id . DS . $image->item_name;
            /** resize image if does not exist **/
            if (isset($image->item_cat) and $image->item_cat != 'external') {
                $image_url = wpl_images::create_gallary_image($image_width, $image_height, $params);
            } else {
                $image_url = $image->item_extra3;
            }
            echo '<img itemprop="image" id="wpl_gallery_image' . $property_id . '_' . $i . '" src="' . $image_url . '" class="wpl_gallery_image" onclick="wpl_Plisting_slider(' . $i . ',' . $images_total . ',' . $property_id . ');" width="' . $image_width . '" height="' . $image_height . '" style="width: ' . $image_width . 'px; height: ' . $image_height . 'px;" />';
            $i++;
        }
    } else {
        echo '<div class="no_image_box"></div>';
    }
    ?>
		</div>
		<div class="main_infowindow_r">
			<div class="main_infowindow_r_t">
				<?php 
    echo '<a itemprop="url" class="main_infowindow_title" href="' . $property['property_link'] . '">' . $property['property_title'] . '</a>';
Пример #4
0
 /**
  * Render gallery of a property based on custom sizes
  * @author Howard R <*****@*****.**>
  * @static
  * @param int $property_id
  * @param array $images
  * @param array $custom_sizes
  * @return array
  */
 public static function render_gallery_custom_sizes($property_id, $images = '', $custom_sizes = array())
 {
     $kind = wpl_property::get_property_kind($property_id);
     if (!$images) {
         $images = wpl_items::get_items($property_id, 'gallery', $kind);
     }
     /** no image gallery **/
     if (!count($images)) {
         return array();
     }
     $return = array();
     foreach ($custom_sizes as $custom_size) {
         $custom_size = str_replace('*', '_', $custom_size);
         list($x, $y) = explode('_', $custom_size);
         if (trim($x) == '' or trim($y) == '') {
             continue;
         }
         if (!is_numeric($x) or !is_numeric($y)) {
             continue;
         }
         $i = 0;
         foreach ($images as $image) {
             /** force to array **/
             $image = (array) $image;
             $source_path = self::get_path($image['parent_id'], $image['parent_kind']) . $image['item_name'];
             $source_url = self::get_folder($image['parent_id'], $image['parent_kind']) . $image['item_name'];
             $params = array('image_name' => $image['item_name'], 'image_source' => $source_path, 'image_parentid' => $image['parent_id'], 'image_parentkind' => $image['parent_kind']);
             /** taking care for external images **/
             if ($image['item_cat'] != 'external') {
                 $dest_url = wpl_images::create_gallary_image($x, $y, $params, 0, 0);
                 $pathinfo = @pathinfo($dest_url);
                 $dest_path = self::get_path($image['parent_id'], $image['parent_kind']) . $pathinfo['basename'];
             } else {
                 $dest_url = $source_url;
                 $pathinfo = @pathinfo($dest_url);
                 $dest_path = $source_path;
             }
             $return[$custom_size][$i]['item_id'] = $image['id'];
             $return[$custom_size][$i]['custom_size'] = $custom_size;
             $return[$custom_size][$i]['path'] = $dest_path;
             $return[$custom_size][$i]['url'] = $dest_url;
             $return[$custom_size][$i]['size'] = @filesize($dest_path);
             $return[$custom_size][$i]['title'] = (string) $image['item_extra1'];
             $return[$custom_size][$i]['description'] = (string) $image['item_extra2'];
             $return[$custom_size][$i]['category'] = $image['item_cat'];
             $return[$custom_size][$i]['ext'] = $pathinfo['extension'];
             $return[$custom_size][$i]['raw'] = $image;
             $i++;
         }
     }
     return $return;
 }
Пример #5
0
        $image_thumbnail_url = $image['url'];
        if (isset($image['item_extra2'])) {
            $image_alt = $image['item_extra2'];
        } else {
            $image_alt = $wpl_properties['current']['raw']['meta_keywords'];
        }
        if ($this->resize and $this->image_width and $this->image_height and $image['category'] != 'external') {
            /** set resize method parameters **/
            $params = array();
            $params['image_name'] = $image['raw']['item_name'];
            $params['image_parentid'] = $image['raw']['parent_id'];
            $params['image_parentkind'] = $image['raw']['parent_kind'];
            $params['image_source'] = $image['path'];
            /** resize image if does not exist and add watermark **/
            $image_url = wpl_images::create_gallary_image($this->image_width, $this->image_height, $params, $this->watermark, $this->rewrite);
            $image_thumbnail_url = wpl_images::create_gallary_image(100, 80, $params, $this->watermark, $this->rewrite);
        }
        /** start loading images **/
        echo '<li><img src="' . $image_url . '" itemprop="image" class="wpl_gallery_image ' . $this->image_class . '" id="wpl_gallery_image' . $image['raw']['id'] . '" width="' . $this->image_width . '" height="' . $this->image_height . '" alt="' . $image_alt . '" /></li>';
        $pager_box .= '<a data-slide-index="' . $i . '" href=""><img src="' . $image_thumbnail_url . '" width="100" height="80" style="width: 100px; height: 80px;" itemprop="image" alt="' . $image_alt . '" /></a>';
        $i++;
    }
    echo '</ul>';
    ?>
    <div id="bx-pager">
        <?php 
    echo '<div id="img_count">' . count($this->gallery) . '</div>' . $pager_box;
    ?>
    </div>
    <?php 
}
Пример #6
0
    $image_folder = wpl_items::get_folder($item_id, $this->kind);
    $image_path = wpl_items::get_path($item_id, $this->kind);
    $image_categories = wpl_items::get_item_categories('gallery', $this->kind);
    $max_img_index = 0;
    foreach ($gall_items as $image) {
        $image->index = intval($image->index);
        if ($max_img_index < $image->index) {
            $max_img_index = $image->index;
        }
        /** set resize method parameters **/
        $params = array();
        $params['image_name'] = $image->item_name;
        $params['image_parentid'] = $image->parent_id;
        $params['image_parentkind'] = $image->parent_kind;
        $params['image_source'] = $image_path . $image->item_name;
        $image_thumbnail_url = wpl_images::create_gallary_image(80, 60, $params, 1, 0);
        if ($image->item_cat == 'external') {
            $image_thumbnail_url = $image->item_extra3;
        }
        ?>

            <li class="ui-state-default" id="ajax_gallery<?php 
        echo $image->index;
        ?>
" >
                <input type="hidden" class="gal_name" value="<?php 
        echo $image->item_name;
        ?>
" />
                <div class="image-box-wp">
                    <div class="image-wp">