Changeset 17828


Ignore:
Timestamp:
Sep 9, 2012, 4:36:02 PM (8 years ago)
Author:
flop25
Message:

adding a new option : restrict heigth by using the 'thumbnail width' parameter
auto managment of pano photos : set pano on three columns
Thx to JJF and his work on White S&C
ToDo : medium pano on 2 columns

Location:
extensions/stripped_black_bloc
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • extensions/stripped_black_bloc/admin/admin.inc.php

    r13895 r17828  
    3333        $config_send['starting_to']=(isset($_POST['f_starting_to'])) ? $_POST['f_starting_to'] : 1;
    3434        $config_send['catthumb']=(isset($_POST['f_catthumb'])) ? $_POST['f_catthumb'] : 'none';
     35        $config_send['portrait_limitation']=(isset($_POST['f_portrait_limitation'])) ? $_POST['f_portrait_limitation'] : 'none';
    3536        conf_update_param('stripped_black_bloc', pwg_db_real_escape_string(serialize($config_send)));
    3637
  • extensions/stripped_black_bloc/admin/admin.tpl

    r13894 r17828  
    4545    <li>
    4646      <br><br>
     47      <label>{'About portrait pictures :'|@translate}</label>
     48      <br><br>
     49     <label>
     50        <input type="radio" name="f_portrait_limitation" id="portrait_limitation" value="none"  {if $options.portrait_limitation=="none"}checked{/if}>
     51        &nbsp;{'No Maximum Height, the width is the one set above'|@translate}</label>
     52      <br>
     53      <label>
     54        <input type="radio" name="f_portrait_limitation" id="portrait_limitation" value="yes" {if $options.portrait_limitation=="yes"}checked{/if}>
     55        &nbsp;{'Use the width parameter above as a maximum heigth'|@translate}</label>
     56      <br>
     57    </li>
     58    <li>
     59      <br><br>
    4760        <label for="thumbnail">{'About big thumbnails, for the albums :'|@translate}</label>
    4861      <br><br>
  • extensions/stripped_black_bloc/admin/maintain.inc.php

    r13895 r17828  
    1313        'every_x'                                               => 20,
    1414        'starting_to'                                           => 1,
    15   'catthumb'         => 'none' //none - same - all
     15  'catthumb'         => 'none', //none - same - all
     16  'portrait_limitation'         => 'none' //none - yes
    1617      );
    1718     
  • extensions/stripped_black_bloc/admin/upgrade.inc.php

    r13895 r17828  
    1313  'every_x'           => 20,
    1414  'starting_to'           => 1,
    15   'catthumb'         => 'none' //none - same - all
     15  'catthumb'         => 'none', //none - same - all
     16  'portrait_limitation'         => 'none' //none - yes
    1617  );
    1718  $query = "
     
    2122  load_conf_from_db();
    2223}
    23 elseif (count(unserialize( $conf['stripped_black_bloc'] ))!=6)
     24elseif (count(unserialize( $conf['stripped_black_bloc'] ))!=7)
    2425{
     26  $conff=unserialize($conf['stripped_black_bloc']);
    2527  $config = array(
    26   'color_main'            => 'E6554F',
    27   'column_width'            => 170,
    28   'thumbnail_width'           => 150,
    29   'every_x'           => 20,
    30   'starting_to'           => 1,
    31   'catthumb'         => 'none' //none - same - all
    32   );
    33   conf_update_param('stripped_black_bloc', pwg_db_real_escape_string(serialize($config)));
    34   load_conf_from_db();
    35 }
    36 elseif ($conff=unserialize($conf['stripped_black_bloc']) and ( !isset($conff['catthumb']) or empty($conff['catthumb'])) )
    37 {
    38   $config = array(
    39   'color_main'            => $conff['color_main'],
    40   'column_width'            => $conff['column_width'],
    41   'thumbnail_width'           => $conff['thumbnail_width'],
    42   'every_x'           => $conff['every_x'],
    43   'starting_to'           => $conff['starting_to'],
    44   'catthumb'         => 'none' //none - same - all
     28  'color_main'            => (isset($conff['color_main'])) ? $conff['color_main'] :'E6554F',
     29  'column_width'            => (isset($conff['column_width'])) ? $conff['column_width'] :170,
     30  'thumbnail_width'           => (isset($conff['thumbnail_width'])) ? $conff['thumbnail_width'] :150,
     31  'every_x'           => (isset($conff['every_x'])) ? $conff['every_x'] : 20,
     32  'starting_to'           => (isset($conff['starting_to'])) ? $conff['starting_to'] :1,
     33  'catthumb'         => (isset($conff['catthumb'])) ? $conff['catthumb'] :'none', //none - same - all
     34  'portrait_limitation'         => (isset($conff['portrait_limitation'])) ? $conff['portrait_limitation'] :'none' //none - yes
    4535  );
    4636  conf_update_param('stripped_black_bloc', pwg_db_real_escape_string(serialize($config)));
  • extensions/stripped_black_bloc/local_head.tpl

    r16790 r17828  
    99        max-width: {/literal}{if $stripped_black_bloc.thumbnail_width}{$stripped_black_bloc.thumbnail_width}{/if}{literal}px;
    1010}
    11 .bloc a{
     11.bloc a {
    1212        max-width:{/literal}{if $stripped_black_bloc.thumbnail_width}{$stripped_black_bloc.thumbnail_width}{/if}{literal}px;
    1313}
     
    1717.bloc_big a {
    1818        max-width:{/literal}{if $stripped_black_bloc.thumbnail_width}{$stripped_black_bloc.thumbnail_width+$stripped_black_bloc.column_width}{/if}{literal}px;
     19}
     20.bloc_wide {
     21        max-width: {/literal}{if $stripped_black_bloc.thumbnail_width}{$stripped_black_bloc.thumbnail_width+$stripped_black_bloc.column_width+$stripped_black_bloc.column_width}{/if}{literal}px;
     22}
     23.bloc_wide a {
     24        max-width:{/literal}{if $stripped_black_bloc.thumbnail_width}{$stripped_black_bloc.thumbnail_width+$stripped_black_bloc.column_width+$stripped_black_bloc.column_width}{/if}{literal}px;
    1925}
    2026.content_block, .bloc_stuff, .two_columns {
  • extensions/stripped_black_bloc/template/mainpage_categories.tpl

    r13894 r17828  
    11{define_derivative name='derivative_stripped_black_bloc' width=$stripped_black_bloc.thumbnail_width height=9999 crop=false}
    22{define_derivative name='derivative_stripped_black_bloc_big' width=$stripped_black_bloc.thumbnail_width+$stripped_black_bloc.column_width height=9999 crop=false}
     3{define_derivative name='derivative_stripped_black_bloc_wide' width=$stripped_black_bloc.thumbnail_width+$stripped_black_bloc.column_width+$stripped_black_bloc.column_width height=9999 crop=false}
     4{define_derivative name='derivative_stripped_black_bloc_vert' width=$stripped_black_bloc.thumbnail_width height=$stripped_black_bloc.thumbnail_width crop=false}
     5{define_derivative name='derivative_stripped_black_bloc_big_vert' width=$stripped_black_bloc.thumbnail_width+$stripped_black_bloc.column_width height=$stripped_black_bloc.thumbnail_width+$stripped_black_bloc.column_width crop=false}
     6
    37{foreach from=$category_thumbnails item=cat}
    4   {if $cat.TN_CLASS=="bloc_big" and $stripped_black_bloc.catthumb=="same"}
    5     {assign var=derivative value=$pwg->derivative($derivative_stripped_black_bloc_big, $cat.representative.src_image)}
    6   {elseif $stripped_black_bloc.catthumb=="all"}
    7     {assign var=derivative value=$pwg->derivative($derivative_stripped_black_bloc_big, $cat.representative.src_image)}
     8{assign var=triplehigh value= $cat.representative.height+$cat.representative.height+$cat.representative.height}
     9  {if $cat.representative.width gt $triplehigh}
     10    {assign var=derivative value=$pwg->derivative($derivative_stripped_black_bloc_wide, $cat.representative.src_image)}
     11    {assign var='size' value=$derivative->get_size()}
     12        <div class="bloc_big album">
     13                        <a href="{$cat.URL}" style="background: url({$derivative->get_url()}) no-repeat scroll center center transparent; height: {$size[1]}px; width: {$size[0]}px; opacity: 0.75;" >
     14                                {$cat.NAME}
     15                        </a>
     16                                <div class="title">{$cat.NAME}</div>
     17        </div>
    818  {else}
    9     {assign var=derivative value=$pwg->derivative($derivative_stripped_black_bloc, $cat.representative.src_image)}
    10   {/if}
    11   {assign var='size' value=$derivative->get_size()}
     19    {if $cat.representative.width < $cat.representative.height and $stripped_black_bloc.catthumb=="yes"}
     20      {if $cat.TN_CLASS=="bloc_big" and $stripped_black_bloc.catthumb=="same"}
     21        {assign var=derivative value=$pwg->derivative($derivative_stripped_black_bloc_big_vert, $cat.representative.src_image)}
     22      {elseif $stripped_black_bloc.catthumb=="all"}
     23        {assign var=derivative value=$pwg->derivative($derivative_stripped_black_bloc_big_vert, $cat.representative.src_image)}
     24      {else}
     25        {assign var=derivative value=$pwg->derivative($derivative_stripped_black_bloc_vert, $cat.representative.src_image)}
     26      {/if}
     27    {else}
     28      {if $cat.TN_CLASS=="bloc_big" and $stripped_black_bloc.catthumb=="same"}
     29        {assign var=derivative value=$pwg->derivative($derivative_stripped_black_bloc_big, $cat.representative.src_image)}
     30      {elseif $stripped_black_bloc.catthumb=="all"}
     31        {assign var=derivative value=$pwg->derivative($derivative_stripped_black_bloc_big, $cat.representative.src_image)}
     32      {else}
     33        {assign var=derivative value=$pwg->derivative($derivative_stripped_black_bloc, $cat.representative.src_image)}
     34        {/if}
     35    {/if}
     36    {assign var='size' value=$derivative->get_size()}
    1237        <div class="{if $stripped_black_bloc.catthumb=="all"}bloc_big{else}{$cat.TN_CLASS}{/if} album">
    1338                        <a href="{$cat.URL}" style="background: url({$derivative->get_url()}) no-repeat scroll center center transparent; height: {$size[1]}px; width: {$size[0]}px; opacity: 0.75;" >
     
    1641                                <div class="title">{$cat.NAME}</div>
    1742        </div>
     43  {/if}
    1844  {/foreach}
  • extensions/stripped_black_bloc/template/thumbnails.tpl

    r17740 r17828  
    33{define_derivative name='derivative_stripped_black_bloc' width=$stripped_black_bloc.thumbnail_width height=9999 crop=false}
    44{define_derivative name='derivative_stripped_black_bloc_big' width=$stripped_black_bloc.thumbnail_width+$stripped_black_bloc.column_width height=9999 crop=false}
     5{define_derivative name='derivative_stripped_black_bloc_wide' width=$stripped_black_bloc.thumbnail_width+$stripped_black_bloc.column_width+$stripped_black_bloc.column_width height=9999 crop=false}
     6{define_derivative name='derivative_stripped_black_bloc_vert' width=$stripped_black_bloc.thumbnail_width height=$stripped_black_bloc.thumbnail_width crop=false}
     7{define_derivative name='derivative_stripped_black_bloc_big_vert' width=$stripped_black_bloc.thumbnail_width+$stripped_black_bloc.column_width height=$stripped_black_bloc.thumbnail_width+$stripped_black_bloc.column_width crop=false}
    58{if !empty($thumbnails)}
    69  {foreach from=$thumbnails item=thumbnail}
    7     {if $thumbnail.TN_CLASS=="bloc"}
    8       {assign var=derivative value=$pwg->derivative($derivative_stripped_black_bloc, $thumbnail.src_image)}
     10   {assign var=triplehigh value=$thumbnail.height+$thumbnail.height+$thumbnail.height}
     11   {if ($thumbnail.width > $triplehigh) }
     12    {assign var=derivative value=$pwg->derivative($derivative_stripped_black_bloc_wide, $thumbnail.src_image)}
     13    {assign var='size' value=$derivative->get_size()}
     14  <div class="bloc bloc_wide">
     15    <a href="{$thumbnail.URL}" style="background: url({if $derivative->is_cached()}{$derivative->get_url()}{else}{$ROOT_URL}{$themeconf.img_dir}/loading.gif{/if}) no-repeat scroll center center transparent; height: {$size[1]}px; width: {$size[0]}px; opacity: 0.75;" {if !$derivative->is_cached()}data-src="{$derivative->get_url()}"{/if}>
     16    {if isset($thumbnail.NAME)}{$thumbnail.NAME}{else}{$thumbnail.TN_TITLE}{/if}
     17    </a>
     18    {if $SHOW_THUMBNAIL_CAPTION }
     19    <div class="title">{if isset($thumbnail.NAME)}{$thumbnail.NAME}{/if}</div>
     20    {/if}
     21  </div>
     22  {else}
     23    {if (($thumbnail.width < $thumbnail.height) and $stripped_black_bloc.portrait_limitation=="yes")}
     24      {if $thumbnail.TN_CLASS=="bloc"}
     25        {assign var=derivative value=$pwg->derivative($derivative_stripped_black_bloc_vert, $thumbnail.src_image)}
     26      {else}
     27        {assign var=derivative value=$pwg->derivative($derivative_stripped_black_bloc_big_vert, $thumbnail.src_image)}
     28      {/if}
    929    {else}
    10       {assign var=derivative value=$pwg->derivative($derivative_stripped_black_bloc_big, $thumbnail.src_image)}
    11     {/if}
    12     {assign var='size' value=$derivative->get_size()}
    13 <div class="{$thumbnail.TN_CLASS}">
    14   <a href="{$thumbnail.URL}" style="background: url({if $derivative->is_cached()}{$derivative->get_url()}{else}{$ROOT_URL}{$themeconf.img_dir}/loading.gif{/if}) no-repeat scroll center center transparent; height: {$size[1]}px; width: {$size[0]}px; opacity: 0.75;" {if !$derivative->is_cached()}data-src="{$derivative->get_url()}"{/if}>
     30      {if $thumbnail.TN_CLASS=="bloc"}
     31       {assign var=derivative value=$pwg->derivative($derivative_stripped_black_bloc, $thumbnail.src_image)}
     32      {else}
     33       {assign var=derivative value=$pwg->derivative($derivative_stripped_black_bloc_big, $thumbnail.src_image)}
     34      {/if}
     35  {/if}
     36     {assign var='size' value=$derivative->get_size()}
     37     <div class="{$thumbnail.TN_CLASS}">
     38<a href="{$thumbnail.URL}" style="background: url({if $derivative->is_cached()}{$derivative->get_url()}{else}{$ROOT_URL}{$themeconf.img_dir}/loading.gif{/if}) no-repeat scroll center center transparent; height: {$size[1]}px; width: {$size[0]}px; opacity: 0.75;" {if !$derivative->is_cached()}data-src="{$derivative->get_url()}"{/if}>
    1539    {if isset($thumbnail.NAME)}{$thumbnail.NAME}{else}{$thumbnail.TN_TITLE}{/if}
    16   </a>
    17   {if $SHOW_THUMBNAIL_CAPTION }
     40    </a>
     41          {if $SHOW_THUMBNAIL_CAPTION }
    1842  <div class="title">{if isset($thumbnail.NAME)}{$thumbnail.NAME}{/if}</div>
    1943  {/if}
    20 </div>
     44  </div>
     45   {/if}
    2146  {/foreach}
    2247{/if}
Note: See TracChangeset for help on using the changeset viewer.