[10851] | 1 | <?php |
---|
| 2 | /* |
---|
[11679] | 3 | Theme Name: Stripped & Columns |
---|
[11680] | 4 | Version: auto |
---|
[10851] | 5 | Description: stripped_black_bloc |
---|
[11680] | 6 | Theme URI: http://piwigo.org/ext/extension_view.php?eid=568 |
---|
| 7 | Author: flop25 |
---|
| 8 | Author URI: http://www.planete-flop.fr |
---|
[10851] | 9 | */ |
---|
| 10 | |
---|
| 11 | |
---|
| 12 | |
---|
| 13 | $themeconf = array( |
---|
| 14 | 'parent' => 'stripped', |
---|
| 15 | 'name' => 'stripped_black_bloc', |
---|
| 16 | 'theme_dir' => 'stripped_black_bloc', |
---|
| 17 | 'icon_dir' => 'themes/stripped/icon', |
---|
| 18 | 'admin_icon_dir' => 'themes/default/icon/admin', |
---|
| 19 | 'mime_icon_dir' => 'themes/default/icon/mimetypes/', |
---|
| 20 | 'local_head' => 'local_head.tpl', |
---|
| 21 | ); |
---|
[11696] | 22 | |
---|
| 23 | load_language('theme.lang', PHPWG_THEMES_PATH.'stripped_black_bloc/'); |
---|
| 24 | |
---|
| 25 | |
---|
[11677] | 26 | add_event_handler('loc_end_index_category_thumbnails', 'MY'); |
---|
[10851] | 27 | add_event_handler('loc_end_index_thumbnails', 'MY'); |
---|
| 28 | function MY($tpl_thumbnails_var) |
---|
| 29 | { |
---|
| 30 | global $template; |
---|
| 31 | $new_tplvar=array(); |
---|
| 32 | foreach ($tpl_thumbnails_var as $tplvar) |
---|
| 33 | { |
---|
| 34 | list($width, $height, $type, $attr) = getimagesize( $tplvar['TN_SRC'] ); |
---|
| 35 | $tplvar['TN_WIDTH']=$width; |
---|
| 36 | $tplvar['TN_HEIGHT']=$height; |
---|
| 37 | $new_tplvar[]=$tplvar; |
---|
| 38 | } |
---|
| 39 | return $new_tplvar; |
---|
| 40 | } |
---|
[11498] | 41 | add_event_handler('init', 'MY_init'); |
---|
| 42 | function MY_init() |
---|
| 43 | { |
---|
| 44 | remove_event_handler('loc_begin_index', 'modify_nb_thumbnail_page'); |
---|
| 45 | } |
---|
[11696] | 46 | |
---|
| 47 | /************************************ index.tpl ************************************/ |
---|
| 48 | add_event_handler('loc_end_index', 'stripped_black_bloc_index'); |
---|
| 49 | function stripped_black_bloc_index() |
---|
| 50 | { |
---|
| 51 | global $template; |
---|
| 52 | $template->set_prefilter('index', 'stripped_black_bloc_prefilter_index'); |
---|
| 53 | } |
---|
| 54 | function stripped_black_bloc_prefilter_index($content, &$smarty) |
---|
| 55 | { |
---|
| 56 | $search = '#\{if \!empty\(\$navbar\) \}[\s]*\{include file=\'navigation_bar\.tpl\'\|@get_extent:\'navbar\'\}[\s]*\{/if\}#'; |
---|
| 57 | $replacement = ''; |
---|
| 58 | $content = preg_replace($search, $replacement, $content); |
---|
| 59 | |
---|
| 60 | $search = '#<\!-- subContent -->#'; |
---|
| 61 | $replacement = '<\!-- subContent --> |
---|
| 62 | {if !empty($navbar) } |
---|
| 63 | {include file=\'navigation_bar.tpl\'|@get_extent:\'navbar\'} |
---|
| 64 | {/if}'; |
---|
| 65 | return preg_replace($search, $replacement, $content); |
---|
| 66 | } |
---|
| 67 | |
---|
[10851] | 68 | ?> |
---|