Changeset 16637


Ignore:
Timestamp:
07/12/12 00:33:33 (7 years ago)
Author:
plg
Message:

Compatibility with Piwigo 2.4

Better "zoom" feature on gallery side and admin side

Bug fixed: the "Upload Photos" link in menubar is hidden when Advanced Menu Manager is activated.

Location:
extensions/community
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • extensions/community/add_photos.php

    r12616 r16637  
    193193      ); 
    194194 
    195     // the link on thumbnail must go to the websize photo 
    196     foreach ($page['thumbnails'] as $idx => $thumbnail) 
    197     { 
    198       $page['thumbnails'][$idx]['link'] = str_replace( 
    199         'thumbnail/'.$conf['prefix_thumbnail'], 
    200         '', 
    201         $thumbnail['src'] 
     195    // find the url to the medium size 
     196    $page['thumbnails'] = array(); 
     197 
     198    $query = ' 
     199SELECT * 
     200  FROM '.IMAGES_TABLE.' 
     201  WHERE id IN ('.implode(',', $image_ids).') 
     202;'; 
     203    $result = pwg_query($query); 
     204    while ($row = pwg_db_fetch_assoc($result)) 
     205    { 
     206      $src_image = new SrcImage($row); 
     207 
     208      $page['thumbnails'][] = array( 
     209        'file' => $row['file'], 
     210        'src' => DerivativeImage::url(IMG_THUMB, $src_image), 
     211        'title' => $row['name'], 
     212        'link' => $image_url = DerivativeImage::url(IMG_MEDIUM, $src_image), 
     213        'lightbox' => true, 
    202214        ); 
    203215    } 
  • extensions/community/add_photos.tpl

    r12616 r16637  
    377377  <div> 
    378378  {foreach from=$thumbnails item=thumbnail} 
    379     <a href="{$thumbnail.link}" class="externalLink"> 
     379    <a href="{$thumbnail.link}"  class="{if isset($thumbnail.lightbox)}colorboxThumb{else}externalLink{/if}"> 
    380380      <img src="{$thumbnail.src}" alt="{$thumbnail.file}" title="{$thumbnail.title}" class="thumbnail"> 
    381381    </a> 
     
    523523 
    524524</div> <!-- photosAddContent --> 
     525 
     526{* Community specific *} 
     527{footer_script}{literal} 
     528jQuery(document).ready(function(){ 
     529  jQuery("a.colorboxThumb").colorbox({rel:"colorboxThumb"}); 
     530 
     531  jQuery("a.externalLink").click(function() { 
     532    window.open($(this).attr("href")); 
     533    return false; 
     534  }); 
     535}); 
     536{/literal}{/footer_script} 
  • extensions/community/admin_pendings.php

    r9453 r16637  
    131131    i.id, 
    132132    path, 
    133     tn_ext, 
    134133    date_creation, 
    135134    name, 
     
    141140    width, 
    142141    height, 
    143     has_high, 
    144     high_filesize, 
     142    rotation, 
    145143 
    146144    '.$conf['user_fields']['username'].' AS username 
     
    192190foreach ($rows as $row) 
    193191{ 
    194   $thumb = get_thumbnail_url( 
    195     array( 
    196       'id' => $row['image_id'], 
    197       'path' => $row['path'], 
    198       'tn_ext' => @$row['tn_ext'] 
    199       ) 
    200     ); 
    201  
     192  $src_image = new SrcImage($row); 
     193  $thumb_url = DerivativeImage::url(IMG_THUMB, $src_image); 
     194  $medium_url = DerivativeImage::url(IMG_MEDIUM, $src_image); 
     195   
    202196  // file properties 
    203197  $dimensions = null; 
     
    231225      'U_EDIT' => get_root_url().'admin.php?page=picture_modify&amp;image_id='.$row['image_id'], 
    232226      'ID' => $row['image_id'], 
    233       'TN_SRC' => $thumb, 
    234       'WEBSIZE_SRC' => $row['path'], 
     227      'TN_SRC' => $thumb_url, 
     228      'MEDIUM_SRC' => $medium_url, 
    235229      'ADDED_BY' => $row['username'], 
    236230      'ADDED_ON' => format_date($row['added_on'], true), 
    237       'NAME' => get_image_name($row['name'], $row['file']), 
     231      'NAME' => $row['name'], 
    238232      'DIMENSIONS' => $dimensions, 
    239233      'FILE' => $row['file'], 
  • extensions/community/admin_pendings.tpl

    r9372 r16637  
     1{combine_script id='jquery.colorbox' load='footer' require='jquery' path='themes/default/js/plugins/jquery.colorbox.min.js'} 
     2{combine_css path="themes/default/js/plugins/colorbox/style2/colorbox.css"} 
     3 
    14{literal} 
    25<style> 
     
    1013{literal} 
    1114<script type="text/javascript"> 
    12 $(document).ready(function(){ 
     15jQuery(document).ready(function(){ 
     16 
     17  jQuery("a.zoom").colorbox({rel:"zoom"}); 
    1318 
    1419  function checkSelectedRows() { 
     
    7883    <td> 
    7984  <div class="comment"> 
    80     <p class="commentAction" style="float:left;margin:0.5em 0 0 0.5em"><a href="{$photo.WEBSIZE_SRC}" class="externalLink">{'Zoom'|@translate}</a> &middot; <a href="{$photo.U_EDIT}" class="externalLink">{'Edit'|@translate}</a></p> 
     85    <p class="commentAction" style="float:left;margin:0.5em 0 0 0.5em"><a href="{$photo.MEDIUM_SRC}" class="zoom">{'Zoom'|@translate}</a> &middot; <a href="{$photo.U_EDIT}" class="externalLink">{'Edit'|@translate}</a></p> 
    8186    <p class="commentHeader"><strong>{$photo.ADDED_BY}</strong> - <em>{$photo.ADDED_ON}</em></p> 
    8287    <table> 
  • extensions/community/main.inc.php

    r12333 r16637  
    119119} 
    120120 
    121 add_event_handler('blockmanager_apply' , 'community_gallery_menu'); 
     121add_event_handler('blockmanager_apply' , 'community_gallery_menu', EVENT_HANDLER_PRIORITY_NEUTRAL+10); 
    122122function community_gallery_menu($menu_ref_arr) 
    123123{ 
Note: See TracChangeset for help on using the changeset viewer.