Commit b1d85666e794ae84a5c2cbb546c2cef4b77adafa
Merge branch 'remote_work' into 'master'
add cover img in item See merge request !35
Showing
1 changed file
with
16 additions
and
8 deletions
Show diff stats
src/app/frontend/views/page/item.php
@@ -15,16 +15,26 @@ | @@ -15,16 +15,26 @@ | ||
15 | <?php | 15 | <?php |
16 | 16 | ||
17 | $data_images = ''; | 17 | $data_images = ''; |
18 | - | ||
19 | - if( !empty( $item['images'] ) ) | ||
20 | - { | 18 | + if( !empty( $item['cover'] )) { |
19 | + $data_images .= | ||
20 | + '<li class="float width_400">' . | ||
21 | + '<a href="' . $this->storage->getPhotoUrl($item['cover'], 'avatar', '800x') . '" title="' . $item['title'] . '" data-options="thumbnail: \'' . $this->storage->getPhotoUrl($item['cover'], 'avatar', '128x') . '\'" class="thumbnail">' . | ||
22 | + '<img src="' . $this->storage->getPhotoUrl($item['cover'], 'avatar', '400x') . '" alt="' . $item['title'] . '" class="image_400">' . | ||
23 | + '</a>' . | ||
24 | + '</li>'; | ||
25 | + } | ||
26 | + else if( !empty( $item['images'] ) ){ | ||
21 | $data_images .= | 27 | $data_images .= |
22 | '<li class="float width_400 '.(count($item['images'])%3==0 ? 'last' : '').'">'. | 28 | '<li class="float width_400 '.(count($item['images'])%3==0 ? 'last' : '').'">'. |
23 | - '<a href="'.$this->storage->getPhotoUrl( $item['images'][0], 'group', '800x' ).'" title="'.$item['title'].'" data-options="thumbnail: \''.$this->storage->getPhotoUrl( $item['cover'], 'avatar', '128x' ).'\'" class="thumbnail">'. | ||
24 | - '<img src="'.$this->storage->getPhotoUrl( $item['images'][0], 'group', '400x400' ).'" alt="'.$item['title'].'" class="image_400">'. | ||
25 | - '</a>'. | 29 | + '<a href="'.$this->storage->getPhotoUrl( $item['images'][0], 'group', '800x' ).'" title="'.$item['title'].'" data-options="thumbnail: \''.$this->storage->getPhotoUrl( $item['cover'], 'avatar', '128x' ).'\'" class="thumbnail">'. |
30 | + '<img src="'.$this->storage->getPhotoUrl( $item['images'][0], 'group', '400x400' ).'" alt="'.$item['title'].'" class="image_400">'. | ||
31 | + '</a>'. | ||
26 | '</li>'; | 32 | '</li>'; |
27 | 33 | ||
34 | + } | ||
35 | + if( !empty( $item['images'] ) ) | ||
36 | + { | ||
37 | + | ||
28 | foreach( $item['images'] as $k => $i ) | 38 | foreach( $item['images'] as $k => $i ) |
29 | { | 39 | { |
30 | $data_images .= | 40 | $data_images .= |
@@ -34,8 +44,6 @@ | @@ -34,8 +44,6 @@ | ||
34 | '</a>'. | 44 | '</a>'. |
35 | '</li>'; | 45 | '</li>'; |
36 | } | 46 | } |
37 | - | ||
38 | - | ||
39 | } | 47 | } |
40 | elseif( !empty( $item['cover'] ) && empty( $item['images'] ) ) | 48 | elseif( !empty( $item['cover'] ) && empty( $item['images'] ) ) |
41 | { | 49 | { |