Changeset 13894


Ignore:
Timestamp:
04/04/12 17:47:23 (8 years ago)
Author:
flop25
Message:

updated for 2.4 :
-deleted timthumb
-deleted config for auto-generation

features added :
-representative thumbs can be big : always, as the "Every x thumb" config or never

bug corrected :
-big thumbs didn't have rounded corners

Translations uk_UA needed for new keys

Location:
extensions/stripped_black_bloc
Files:
1 deleted
10 edited

Legend:

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

    r12048 r13894  
    55global $conf; 
    66 
    7 if (!isset($conf['stripped_black_bloc'])) 
    8   include(PHPWG_THEMES_PATH.'stripped_black_bloc/admin/upgrade.inc.php'); 
     7include(PHPWG_THEMES_PATH.'stripped_black_bloc/admin/upgrade.inc.php'); 
    98 
    109load_language('theme.lang', PHPWG_THEMES_PATH.'stripped_black_bloc/'); 
     
    3332        $config_send['every_x']=(isset($_POST['f_every_x'])) ? $_POST['f_every_x'] : 20; 
    3433        $config_send['starting_to']=(isset($_POST['f_starting_to'])) ? $_POST['f_starting_to'] : 1; 
    35         $config_send['thumbnail']=(isset($_POST['f_thumbnail'])) ? $_POST['f_thumbnail'] : 'piwigo'; 
     34        $config_send['catthumb']=(isset($_POST['f_catthumb'])) ? $_POST['f_catthumb'] : 'none'; 
    3635        conf_update_param('stripped_black_bloc', pwg_db_real_escape_string(serialize($config_send))); 
    3736 
  • extensions/stripped_black_bloc/admin/admin.tpl

    r12048 r13894  
     1{html_style}{literal} 
     2FORM.properties SPAN.property { 
     3    float: left; 
     4    font-weight: bold; 
     5    margin: 0; 
     6    padding: 0 0.5em 0 0; 
     7    text-align: right; 
     8    width: auto; 
     9} 
     10{/literal}{/html_style} 
     11 
    112<div class="titrePage"> 
    213  <h2>{'Stripped & Columns Theme Configuration'|@translate}</h2> 
     
    1526      <label for="column_width"><span class="property">{'Width of columns'|@translate}</span>&nbsp;</label> 
    1627      <input type="text" id="column_width" name="f_column_width" size="4" maxlength="4" value="{$options.column_width}" style="text-align:center;"> 
    17       &nbsp;px 
     28      &nbsp;{'pixels'|@translate} 
    1829    </li> 
    1930    <li> 
    2031      <label for="column_width"><span class="property">{'Width of thumbnails'|@translate}</span>&nbsp;</label> 
    2132      <input type="text" id="column_width" name="f_thumbnail_width" size="4" maxlength="4" value="{$options.thumbnail_width}" style="text-align:center;"> 
    22       &nbsp;px&nbsp;{'it need to be inferior than the width of columns'|@translate} 
     33      &nbsp;{'pixels'|@translate}&nbsp;{'(it need to be inferior than the width of columns)'|@translate} 
    2334    </li> 
    2435    <li> 
     
    3344    </li> 
    3445    <li> 
    35       <label for="thumbnail">{'The thumbnails can be generated by the theme'|@translate}</label> 
    36       </p> 
     46      <br><br> 
     47        <label for="thumbnail">{'About big thumbnails, for the albums :'|@translate}</label> 
     48      <br><br> 
    3749      <label> 
    38         <input type="radio" name="f_thumbnail" id="thumbnail" value="generated"  {if $options.thumbnail=="generated"}checked{/if}> 
    39         &nbsp;{'option thumbnail generated'|@translate}</label> 
     50        <input type="radio" name="f_catthumb" id="catthumb" value="none"  {if $options.catthumb=="none"}checked{/if}> 
     51        &nbsp;{'don\'t generate big thumbnails'|@translate}</label> 
    4052      <br> 
    4153      <label> 
    42         <input type="radio" name="f_thumbnail" id="thumbnail" value="auto" {if $options.thumbnail=="auto"}checked{/if}> 
    43         &nbsp;{'option thumbnail auto'|@translate}</label> 
     54        <input type="radio" name="f_catthumb" id="catthumb" value="same" {if $options.catthumb=="same"}checked{/if}> 
     55        &nbsp;{'use the same config as above'|@translate}</label> 
    4456      <br> 
    4557      <label> 
    46         <input type="radio" name="f_thumbnail" id="thumbnail" value="piwigo" {if $options.thumbnail=="piwigo"}checked{/if}> 
    47         &nbsp;{'option thumbnail piwigo'|@translate}</label> 
     58        <input type="radio" name="f_catthumb" id="catthumb" value="all" {if $options.catthumb=="all"}checked{/if}> 
     59        &nbsp;{'always generate big thumbnails'|@translate}</label> 
    4860      <br> 
    4961    </li> 
  • extensions/stripped_black_bloc/admin/upgrade.inc.php

    r12048 r13894  
    1313  'every_x'           => 20, 
    1414  'starting_to'           => 1, 
    15   'thumbnail'         => 'piwigo' //generated - auto - piwigo 
    16       ); 
    17      $query = " 
     15  'catthumb'         => 'none' //none - same - all 
     16  ); 
     17  $query = " 
    1818INSERT INTO " . CONFIG_TABLE . " (param,value,comment) 
    1919VALUES ('stripped_black_bloc' , '".pwg_db_real_escape_string(serialize($config))."' , 'color_main#column_width#thumbnail_width#thumbnail(generated - auto - piwigo)');"; 
    20       
    21  
    22     pwg_query($query); 
    23     load_conf_from_db(); 
     20  pwg_query($query); 
     21  load_conf_from_db(); 
    2422} 
    2523elseif (count(unserialize( $conf['stripped_black_bloc'] ))!=6) 
     
    3129  'every_x'           => 20, 
    3230  'starting_to'           => 1, 
    33   'thumbnail'         => 'piwigo' //generated - auto - piwigo 
    34       ); 
    35        
    36  
     31  'catthumb'         => 'none' //none - same - all 
     32  ); 
    3733  conf_update_param('stripped_black_bloc', pwg_db_real_escape_string(serialize($config))); 
    38     load_conf_from_db(); 
     34  load_conf_from_db(); 
     35} 
     36elseif ($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 
     45  ); 
     46  conf_update_param('stripped_black_bloc', pwg_db_real_escape_string(serialize($config))); 
     47  load_conf_from_db(); 
    3948} 
    4049?> 
  • extensions/stripped_black_bloc/language/en_UK/theme.lang.php

    r11823 r13894  
    77$lang['Width of columns'] = "Width of columns"; 
    88$lang['Width of thumbnails'] = "Width of thumbnails"; 
    9 $lang['it need to be inferior than the width of columns'] = "it needs to be strictly inferior than the width of columns"; 
    10 $lang['The thumbnails can be generated by the theme'] = "The thumbnails can be generated by the theme"; 
    11 $lang['option thumbnail generated'] = "generate all the thumbnails : they will have all the same width, the \"Width of thumbnails\", with respect to the original proportions"; 
    12 $lang['option thumbnail auto'] = "generate only the thumbnails with a width lower than that indicated in  \"Width of thumbnails\" : it allows you to generate by Piwigo thumbnails much larger to have a variation of height (much more attractive)"; 
    13 $lang['option thumbnail piwigo'] = "generate nothing: thumbnails will be the ones of Piwigo"; 
     9$lang['Create a big thumbnail every'] = "Create a big thumbnail every"; 
     10$lang['... starting to the position number'] = "... starting to the position number"; 
     11$lang['(set 0 to disable)'] = "(set 0 to disable)"; 
     12$lang['(it need to be inferior than the width of columns)'] = "(it needs to be strictly inferior than the width of columns)"; 
     13$lang['About big thumbnails, for the albums :'] = "About big thumbnails, for the albums :"; 
     14$lang['don\'t generate big thumbnails'] = "don't generate big thumbnails"; 
     15$lang['use the same config as above'] = "use the same config as above"; 
     16$lang['always generate big thumbnails'] = "always generate big thumbnails"; 
    1417?> 
  • extensions/stripped_black_bloc/language/fr_FR/theme.lang.php

    r11823 r13894  
    77$lang['Width of columns'] = "Largeur des colonnes"; 
    88$lang['Width of thumbnails'] = "Largeur des miniatures"; 
    9 $lang['it need to be inferior than the width of columns'] = "cette largeur doit être strictement inférieure à celle des colonnes"; 
    10 $lang['The thumbnails can be generated by the theme'] = "Les miniatures peuvent être générées par le thème"; 
    11 $lang['option thumbnail generated'] = "générer toutes les miniatures : elles auront toutes la largeur indiquée dans \"Largeur des miniatures\" avec les proportions d'origines conservées"; 
    12 $lang['option thumbnail auto'] = "générer uniquement les miniatures ayant une largeur inférieure à celle indiquée dans \"Largeur des miniatures\" : cela permet notamment de générer par Piwigo des miniatures plus grosses pour avoir une variation de hauteur"; 
    13 $lang['option thumbnail piwigo'] = "ne rien générer : les miniatures seront celles de Piwigo"; 
     9$lang['Create a big thumbnail every'] = "Créer une grosse miniature toutes les"; 
     10$lang['... starting to the position number'] = "...à commencer par la position numéro"; 
     11$lang['(set 0 to disable)'] = "(mettre 0 pour désactiver)"; 
     12$lang['(it need to be inferior than the width of columns)'] = "(cette largeur doit être strictement inférieure à celle des colonnes)"; 
     13$lang['About big thumbnails, for the albums :'] = "A propos de grosses miniatures, pour les images représentatives des albums :"; 
     14$lang['don\'t generate big thumbnails'] = "ne pas générer de grosses miniatures"; 
     15$lang['use the same config as above'] = "utiliser la config 'Créer une grosse miniature toutes les' ci-dessus"; 
     16$lang['always generate big thumbnails'] = "toujours générer des grosses miniatures"; 
    1417?> 
  • extensions/stripped_black_bloc/language/uk_UA/theme.lang.php

    r13204 r13894  
    77$lang['Width of columns'] = "Ширина стовпців"; 
    88$lang['Width of thumbnails'] = "Ширина мініатюри"; 
    9 $lang['it need to be inferior than the width of columns'] = "вона повинна суворо поступаютися ширину стовпців"; 
    10 $lang['The thumbnails can be generated by the theme'] = "Мініатюри можуть бути отримані на тему"; 
    11 $lang['option thumbnail generated'] = "створити всі ескізи: вони будуть мати все ту ж ширину, \"Ширина мініатюри\", по відношенню до оригінальних пропорцій"; 
    12 $lang['option thumbnail auto'] = "створювати тільки ескізи з шириною менше, ніж зазначено в \"Ширина мініатюри\": він дозволяє генерувати у вигляді мініатюр Piwigo набагато більше, аби зміни висоту(є більш привабливим)"; 
    13 $lang['option thumbnail piwigo'] = "генерувати нічого: мініатюри будуть одними з Piwigo"; 
     9$lang['Create a big thumbnail every'] = "Create a big thumbnail every"; 
     10$lang['... starting to the position number'] = "... starting to the position number"; 
     11$lang['(set 0 to disable)'] = "(set 0 to disable)"; 
     12$lang['(it need to be inferior than the width of columns)'] = "(вона повинна суворо поступаютися ширину стовпців)"; 
     13$lang['About big thumbnails, for the albums :'] = "Мініатюри можуть бути отримані на тему"; 
     14$lang['don\'t generate big thumbnails'] = "don't generate big thumbnails"; 
     15$lang['use the same config as above'] = "use the same config as above"; 
     16$lang['always generate big thumbnails'] = "always generate big thumbnails"; 
    1417?> 
  • extensions/stripped_black_bloc/template/mainpage_categories.tpl

    r11709 r13894  
    1   {foreach from=$category_thumbnails item=cat} 
    2         <div class="bloc album"> 
    3                         <a href="{$cat.URL}" style="background: url({$cat.TN_SRC}) no-repeat scroll center center transparent; height: {$cat.TN_HEIGHT}px; width: {$cat.TN_WIDTH}px; opacity: 0.75;" > 
     1{define_derivative name='derivative_stripped_black_bloc' width=$stripped_black_bloc.thumbnail_width height=9999 crop=false} 
     2{define_derivative name='derivative_stripped_black_bloc_big' width=$stripped_black_bloc.thumbnail_width+$stripped_black_bloc.column_width height=9999 crop=false} 
     3{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  {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()} 
     12        <div class="{if $stripped_black_bloc.catthumb=="all"}bloc_big{else}{$cat.TN_CLASS}{/if} 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;" > 
    414                                {$cat.NAME} 
    515                        </a> 
  • extensions/stripped_black_bloc/template/thumbnails.tpl

    r12048 r13894  
     1{define_derivative name='derivative_stripped_black_bloc' width=$stripped_black_bloc.thumbnail_width height=9999 crop=false} 
     2{define_derivative name='derivative_stripped_black_bloc_big' width=$stripped_black_bloc.thumbnail_width+$stripped_black_bloc.column_width height=9999 crop=false} 
    13{if !empty($thumbnails)} 
    24  {foreach from=$thumbnails item=thumbnail} 
    3   <div class="{$thumbnail.TN_CLASS}"> 
    4         <a href="{$thumbnail.URL}" style="background: url({$thumbnail.TN_SRC}) no-repeat scroll center center transparent; height: {$thumbnail.TN_HEIGHT}px; width: {$thumbnail.TN_WIDTH}px; opacity: 0.75;" > 
    5           {if isset($thumbnail.NAME)}{$thumbnail.NAME}{else}{$thumbnail.TN_TITLE}{/if} 
    6         </a> 
    7         <div class="title">{if isset($thumbnail.NAME)}{$thumbnail.NAME}{/if}</div> 
    8         </div> 
     5    {if $thumbnail.TN_CLASS=="bloc"} 
     6      {assign var=derivative value=$pwg->derivative($derivative_stripped_black_bloc, $thumbnail.src_image)} 
     7    {else} 
     8      {assign var=derivative value=$pwg->derivative($derivative_stripped_black_bloc_big, $thumbnail.src_image)} 
     9    {/if} 
     10    {assign var='size' value=$derivative->get_size()} 
     11 <div class="{$thumbnail.TN_CLASS}"> 
     12    <a href="{$thumbnail.URL}" style="background: url({$derivative->get_url()}) no-repeat scroll center center transparent; height: {$size[1]}px; width: {$size[0]}px; opacity: 0.75;" > 
     13      {if isset($thumbnail.NAME)}{$thumbnail.NAME}{else}{$thumbnail.TN_TITLE}{/if} 
     14    </a> 
     15    <div class="title">{if isset($thumbnail.NAME)}{$thumbnail.NAME}{/if}</div> 
     16  </div> 
    917  {/foreach} 
    1018{/if} 
  • extensions/stripped_black_bloc/theme.css

    r13212 r13894  
    209209    text-decoration: none; 
    210210} 
    211 .masonry-brick, .bloc .title, .nav_bulle { 
     211.masonry-brick, .bloc .title, .bloc_big .title, .nav_bulle { 
    212212        color: #FFFFFF; 
    213213        background-image: url("img/btn.png"); 
     
    222222 
    223223} 
    224 .bloc a { 
     224.bloc a, .bloc_big a { 
    225225    border-radius: 5px 5px 5px 5px; 
    226226} 
  • extensions/stripped_black_bloc/themeconf.inc.php

    r13015 r13894  
    4848  global $template, $conf; 
    4949  $config = unserialize( $conf['stripped_black_bloc'] ); 
     50  $template->assign( 'stripped_black_bloc', $config ); 
    5051  $new_tplvar=array(); 
    5152  $i=1; 
    5253  foreach ($tpl_thumbnails_var as $tplvar) 
    5354  { 
    54     list($width, $height, $type, $attr) = getimagesize( str_replace("../", "", $tplvar['TN_SRC']) ); 
    55     $tplvar['TN_WIDTH']=$width; 
    56     $tplvar['TN_HEIGHT']=$height; 
    57     if (!isset($tplvar['CAPTION_NB_IMAGES'])) 
    58     { 
    59       $conf_thumbnail_width=($i==$config['starting_to']) ? $config['column_width']+$config['thumbnail_width'] : $config['thumbnail_width']; 
    60       $tplvar['TN_CLASS']=($i==$config['starting_to']) ? "bloc_big" : "bloc"; 
    61     } 
    62     else 
    63     { 
    64       $conf_thumbnail_width=$config['thumbnail_width']; 
    65     } 
    66     if (isset($config['thumbnail'])) 
    67     { 
    68       switch ($config['thumbnail']) 
    69       { 
    70         case 'generated': 
    71           if (isset($tplvar['FILE_WIDTH'])) 
    72           { 
    73            $tplvar['TN_SRC']=get_root_url().PHPWG_THEMES_PATH."stripped_black_bloc/library/phpthumb/phpThumb.php?src=../../../../".$tplvar['FILE_PATH']."&w=".$conf_thumbnail_width; 
    74           } 
    75           else 
    76           { 
    77            $tplvar['TN_SRC']=get_root_url().PHPWG_THEMES_PATH."stripped_black_bloc/library/phpthumb/phpThumb.php?src=../../../../".str_replace("../", "", $tplvar['TN_SRC'])."&w=".$conf_thumbnail_width; 
    78           } 
    79           $tplvar['TN_HEIGHT']=floor($tplvar['TN_HEIGHT']*($conf_thumbnail_width/$tplvar['TN_WIDTH'])); 
    80           $tplvar['TN_WIDTH']=$conf_thumbnail_width; 
    81          break; 
    82          case 'auto': 
    83           if($tplvar['TN_WIDTH']<=$conf_thumbnail_width) 
    84           { 
    85             if (isset($tplvar['FILE_WIDTH'])) 
    86             { 
    87              $tplvar['TN_SRC']=get_root_url().PHPWG_THEMES_PATH."stripped_black_bloc/library/phpthumb/phpThumb.php?src=../../../../".$tplvar['FILE_PATH']."&w=".$conf_thumbnail_width; 
    88             } 
    89             else 
    90             { 
    91              $tplvar['TN_SRC']=get_root_url().PHPWG_THEMES_PATH."stripped_black_bloc/library/phpthumb/phpThumb.php?src=../../../../".str_replace("../", "", $tplvar['TN_SRC'])."&w=".$conf_thumbnail_width; 
    92             } 
    93             $tplvar['TN_HEIGHT']=floor($tplvar['TN_HEIGHT']*($conf_thumbnail_width/$tplvar['TN_WIDTH'])); 
    94             $tplvar['TN_WIDTH']=$conf_thumbnail_width; 
    95           } 
    96         break; 
    97         case 'piwigo':break; 
    98       } 
    99     } 
    100    $new_tplvar[]=$tplvar; 
    101     if ($i==$config['every_x']) 
    102     { 
    103       $i=1; 
    104     } 
    105     else { 
    106       $i++;     
    107     } 
     55    $tplvar['TN_CLASS']=($i==$config['starting_to']) ? "bloc_big" : "bloc"; 
     56    $new_tplvar[]=$tplvar; 
     57    $i= ($i==$config['every_x']) ? 1 : $i+1 ; 
    10858  } 
    10959  return $new_tplvar; 
Note: See TracChangeset for help on using the changeset viewer.