Ignore:
Timestamp:
Jul 1, 2013, 1:27:17 PM (11 years ago)
Author:
mistic100
Message:

fix mysql error when no photos on the page, remove "create collection" link in menu

Location:
extensions/UserCollections
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/UserCollections/include/events.inc.php

    r23551 r23719  
    7373 
    7474  // the content is different on collection edition page and no button on batch downloader set edition page
    75   if ( (@$page['section'] == 'collections' and @$page['sub_section']=='edit') or @$page['section'] == 'download')
     75  if ( empty($pictures) or (@$page['section'] == 'collections' and @$page['sub_section']=='edit') or @$page['section'] == 'download')
    7676  {
    7777    return $tpl_thumbnails_var;
     
    246246   
    247247    $data['U_LIST'] = USER_COLLEC_PUBLIC;
    248     $data['U_CREATE'] = add_url_params(USER_COLLEC_PUBLIC, array('action'=>'new','col_id'=>'0','redirect'=>'true'));
    249248   
    250249    $block->set_title('<a href="'.USER_COLLEC_PUBLIC.'">'.l10n('Collections').'</a>');
  • extensions/UserCollections/include/ws_functions.inc.php

    r23552 r23719  
    8282        'default'=>array('id','name','url','path'),
    8383        'flags'=>WS_PARAM_FORCE_ARRAY,
    84         'info'=>'Available options are: id, file, name, url, path, ate_creation, collection_add_date, filesize, width, height'
     84        'info'=>'Available options are: id, file, name, url, path, date_creation, collection_add_date, filesize, width, height'
    8585        ),
    8686      ),
  • extensions/UserCollections/template/menublock.tpl

    r23551 r23719  
    11<dt>{$block->get_title()}</dt>
    22<dd>
    3   <p>
     3  <p>{strip}
    44    {if $block->data.NB_COL == 0}
    55      {'You have no collection'|@translate}
    66    {else}
    77      <a href="{$block->data.U_LIST}">{$pwg->l10n_dec('You have %d collection', 'You have %d collections', $block->data.NB_COL)}</a>
    8     {/if}</p>
     8    {/if}
     9  {/strip}</p>
    910  {if $block->data.collections}
    10   <ul>{strip}
    11                 {foreach from=$block->data.collections item=col}
     11  <ul>
     12                {foreach from=$block->data.collections item=col}{strip}
    1213                <li>
    13       <a href="{$col.u_edit}" rel="nofollow">{$col.name}</a>&nbsp;
     14      <a href="{$col.u_edit}">{$col.name}</a>&nbsp;
    1415      <span class="menuInfoCat">[<span class="nbImagesCollec-{$col.id}">{$col.nb_images}</span>]</span>
    1516    </li>
    16                 {/foreach}
     17                {/strip}{/foreach}
    1718    {if isset($block->data.MORE)}<li class="menuInfoCat"><a href="{$block->data.U_LIST}">{'%d more...'|@translate|sprintf:$block->data.MORE}</a></li>{/if}
    18         {/strip}</ul>
     19        </ul>
    1920  {/if}
    20   <p><a href="{$block->data.U_CREATE}" rel="nofollow">{'Create a new collection'|@translate}</a></p>
    2121</dd>
Note: See TracChangeset for help on using the changeset viewer.