Commit 456a897cf1fcba81bc34a4b116a1dbcfb5766a16

Authored by Dima
1 parent 9257002b

add cover img in item

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 15 <?php
16 16  
17 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 27 $data_images .=
22 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 32 '</li>';
27 33  
  34 + }
  35 + if( !empty( $item['images'] ) )
  36 + {
  37 +
28 38 foreach( $item['images'] as $k => $i )
29 39 {
30 40 $data_images .=
... ... @@ -34,8 +44,6 @@
34 44 '</a>'.
35 45 '</li>';
36 46 }
37   -
38   -
39 47 }
40 48 elseif( !empty( $item['cover'] ) && empty( $item['images'] ) )
41 49 {
... ...