Changeset 11699


Ignore:
Timestamp:
07/10/11 16:36:46 (8 years ago)
Author:
flop25
Message:

omg i did it ! dynamic generation of thumbnails.tpl
admin page for width and this dynamic generation

Location:
extensions/stripped_black_bloc
Files:
8 added
6 edited

Legend:

Unmodified
Added
Removed
  • extensions/stripped_black_bloc/language/en_UK/theme.lang.php

    r11696 r11699  
    11<?php 
    22 
     3$lang['Stripped & Columns Theme Configuration'] = 'Stripped & Columns, Configuration Page'; 
    34$lang['Page'] = 'Page'; 
     5$lang['Displaying options'] = "Display options"; 
     6$lang['Width of columns'] = "Width of columns"; 
     7$lang['Width of thumbnails'] = "Width of thumbnails"; 
     8$lang['it need to be inferior than the width of columns'] = "it needs to be strictly inferior than the width of columns"; 
     9$lang['The thumbnails can be generated by the theme'] = "The thumbnails can be generated by the theme"; 
     10$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"; 
     11$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)"; 
     12$lang['option thumbnail piwigo'] = "generate nothing: thumbnails will be the ones of Piwigo"; 
    413?> 
  • extensions/stripped_black_bloc/language/fr_FR/theme.lang.php

    r11696 r11699  
    11<?php 
    22 
     3$lang['Stripped & Columns Theme Configuration'] = 'Stripped & Columns, Page de configuration'; 
    34$lang['Page'] = 'Page'; 
     5$lang['Displaying options'] = "Options d'affichage"; 
     6$lang['Width of columns'] = "Largeur des colonnes"; 
     7$lang['Width of thumbnails'] = "Largeur des miniatures"; 
     8$lang['it need to be inferior than the width of columns'] = "cette largeur doit être strictement inférieure à celle des colonnes"; 
     9$lang['The thumbnails can be generated by the theme'] = "Les miniatures peuvent être générées par le thème"; 
     10$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"; 
     11$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"; 
     12$lang['option thumbnail piwigo'] = "ne rien générer : les miniatures seront celles de Piwigo"; 
    413?> 
  • extensions/stripped_black_bloc/local_head.tpl

    r11679 r11699  
    11{if ($BODY_ID=='theCategoryPage')} 
    22{combine_script id='jquery.masonry' load='header' require='jquery' path='themes/stripped_black_bloc/js/masonry.js'} 
    3 {html_head}{literal}  
     3{html_head}{literal} 
     4<style> 
     5.bloc { 
     6        width: {/literal}{if $stripped_black_bloc.thumbnail_width}{$stripped_black_bloc.thumbnail_width}{/if}{literal}px; 
     7} 
     8.bloc a { 
     9        max-width:{/literal}{if $stripped_black_bloc.thumbnail_width}{$stripped_black_bloc.thumbnail_width}{/if}{literal}px; 
     10} 
     11</style> 
     12 
    413<script type="text/javascript"> 
    514/** 
     
    4453    return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null; 
    4554}; 
     55 
     56    // MASONRY 
     57 
    4658function tnb_resize() { 
    4759        $('#subcontent').masonry({ 
    48                 columnWidth: 170,  
     60                columnWidth: {/literal} {if $stripped_black_bloc.column_width}{$stripped_black_bloc.column_width}{/if}{literal},  
    4961                itemSelector: '.bloc, .content_block, .bloc_stuff', 
    5062                isAnimated: true 
    5163        }); 
    5264} 
     65 
     66 
    5367jQuery(document).ready(function(jQuery){ 
     68 
     69        // fade onmouseover 
    5470        jQuery(".bloc a").hover(function() { jQuery(this).fadeTo(500, 1); }, function() { jQuery(this).fadeTo(500, 0.75);  }); 
     71 
     72        // sidemenu managment 
    5573        var sidemenu = jQuery.cookie('side-menu'); 
    5674        var isdisplayed; 
  • extensions/stripped_black_bloc/template/thumbnails.tpl

    r10851 r11699  
    22  {foreach from=$thumbnails item=thumbnail} 
    33  <div class="bloc"> 
    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; max-width:150px;" > 
     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;" > 
    55          {if isset($thumbnail.NAME)}{$thumbnail.NAME}{else}{$thumbnail.TN_TITLE}{/if} 
    66        </a> 
  • extensions/stripped_black_bloc/theme.css

    r11679 r11699  
    7171.bloc .title { 
    7272    left: 6px; 
    73     max-width: 138px !important; 
     73    max-width: 138px; 
    7474    padding: 7px 10px 6px; 
    7575    position: absolute; 
  • extensions/stripped_black_bloc/themeconf.inc.php

    r11697 r11699  
    2323load_language('theme.lang', PHPWG_THEMES_PATH.'stripped_black_bloc/'); 
    2424 
     25// Need upgrade? 
    2526 
     27global $conf; 
     28 
     29if (!isset($conf['stripped_black_bloc'])) 
     30  include(PHPWG_THEMES_PATH.'stripped_black_bloc/admin/upgrade.inc.php'); 
     31 
     32add_event_handler('loc_begin_page_header', 'set_config_values_stripped_black_bloc'); 
     33 
     34function set_config_values_stripped_black_bloc() 
     35{ 
     36        global $conf, $template; 
     37        $config = unserialize( $conf['stripped_black_bloc'] ); 
     38        $template->assign( 'stripped_black_bloc', $config ); 
     39} 
     40 
     41/// EVENT 
    2642add_event_handler('loc_end_index_category_thumbnails', 'MY'); 
    2743add_event_handler('loc_end_index_thumbnails', 'MY'); 
    2844function MY($tpl_thumbnails_var) 
    2945{ 
    30     global $template; 
     46    global $template, $conf; 
     47                $config = unserialize( $conf['stripped_black_bloc'] ); 
    3148                $new_tplvar=array(); 
    3249                foreach ($tpl_thumbnails_var as $tplvar) 
     
    3552                        $tplvar['TN_WIDTH']=$width; 
    3653                        $tplvar['TN_HEIGHT']=$height; 
     54                        if (isset($config['thumbnail'])) 
     55                        { 
     56                                switch ($config['thumbnail']) 
     57                                { 
     58                                        case 'generated': 
     59                                                $tplvar['TN_SRC']=PHPWG_THEMES_PATH."stripped_black_bloc/library/timthumb.php?src=".$tplvar['TN_SRC']."&w=".$config['thumbnail_width']; 
     60                                                $tplvar['TN_HEIGHT']=floor($tplvar['TN_HEIGHT']*($config['thumbnail_width']/$tplvar['TN_WIDTH'])); 
     61                                                $tplvar['TN_WIDTH']=$config['thumbnail_width']; 
     62                                        break; 
     63                                        case 'auto': 
     64                                                if($tplvar['TN_WIDTH']<=$config['thumbnail_width']) 
     65                                                { 
     66                                                        $tplvar['TN_SRC']=PHPWG_THEMES_PATH."stripped_black_bloc/library/timthumb.php?src=".$tplvar['TN_SRC']."&w=".$config['thumbnail_width']; 
     67                                                        $tplvar['TN_HEIGHT']=floor($tplvar['TN_HEIGHT']*($config['thumbnail_width']/$tplvar['TN_WIDTH'])); 
     68                                                        $tplvar['TN_WIDTH']=$config['thumbnail_width']; 
     69                                                } 
     70                                        break; 
     71                                        case 'piwigo':break; 
     72                                } 
     73                        } 
    3774                        $new_tplvar[]=$tplvar; 
    3875                } 
Note: See TracChangeset for help on using the changeset viewer.