source: extensions/floPure/Pure_autumn/themeconf.inc.php @ 31353

Last change on this file since 31353 was 30085, checked in by flop25, 10 years ago

2.7 compat: colorscheme and 2.7 only OS_default

File size: 2.7 KB
Line 
1<?php
2/*
3Theme Name: Pure_autumn
4Version: auto
5Description: Colors of autumn, random sort of colors for thumbnails, "S" blocks... a must have !
6Theme URI: http://fr.piwigo.org/ext/extension_view.php?eid=443
7Author: flop25
8Author URI: http://www.planete-flop.fr
9*/
10
11$themeconf = array(
12  'name'         => 'Pure_autumn',
13  'parent'        => 'Pure_default',
14  'icon_dir'      => 'themes/Pure_default/icon',
15  'mime_icon_dir' => 'themes/Pure_default/icon/mimetypes/',
16  'local_head' => 'local_head.tpl',
17  'colorscheme' => 'clear',
18);
19/** mainpage_categories.tpl **/
20add_event_handler('loc_end_index_category_thumbnails', 'Pure_autumn_cat');
21function Pure_autumn_cat($tpl_thumbnails_var)
22{
23    global $template;
24    $template->set_prefilter('index_category_thumbnails', 'Pure_autumn_prefilter_cat');
25                return $tpl_thumbnails_var;
26}
27function Pure_autumn_prefilter_cat($content, &$smarty)
28{
29  $pwgversion=str_replace('.','',PHPWG_VERSION);
30  $pwgversion_array=explode('.', PHPWG_VERSION);
31  if ($pwgversion_array[0].$pwgversion_array[1]=="23")
32  {
33    $search = '#<li>[\s]*<div class="thumbnailCategory">#';
34    $replacement = '<li class="{cycle values="cat_1,cat_2,cat_3,cat_4"}" >
35        <div class="thumbnailCategory">';
36  }
37  elseif ($pwgversion_array[0].$pwgversion_array[1]=="24" or $pwgversion_array[0].$pwgversion_array[1]=="25" or $pwgversion_array[0].$pwgversion_array[1]=="26" or $pwgversion_array[0].$pwgversion_array[1]=="27" )
38  {
39    $search = '#<li class="\{if \$smarty\.foreach.*odd\{else\}even\{/if\}">#s';
40    $replacement = '<li class="{cycle values="cat_1,cat_2,cat_3,cat_4"}" >';
41  }
42  return preg_replace($search, $replacement, $content);
43}
44
45/** thumbnails.tpl **/
46add_event_handler('loc_end_index_thumbnails', 'Pure_autumn_thumbnails');
47function Pure_autumn_thumbnails($tpl_thumbnails_var)
48{
49    global $template;
50    $template->set_prefilter('index_thumbnails', 'Pure_autumn_prefilter_thumbnails');
51    $template->set_prefilter('stuffs', 'Pure_autumn_prefilter_thumbnails');
52                return $tpl_thumbnails_var;
53}
54
55function Pure_autumn_prefilter_thumbnails($content, &$smarty)
56{
57  $pwgversion=str_replace('.','',PHPWG_VERSION);
58  $pwgversion_array=explode('.', PHPWG_VERSION);
59  if ($pwgversion_array[0].$pwgversion_array[1]=="23")
60  {
61  $search = '#<li>[\s]*<span class="wrap1">#';
62 
63  $replacement = '<li class="thumb_{"1"|mt_rand:5}"  >
64        <span class="wrap1">';
65  }
66  elseif ($pwgversion_array[0].$pwgversion_array[1]=="24" or $pwgversion_array[0].$pwgversion_array[1]=="25" or $pwgversion_array[0].$pwgversion_array[1]=="26" or $pwgversion_array[0].$pwgversion_array[1]=="27")
67  {
68  $search = '#<li>[\s]*<span class="wrap1">#';
69 
70  $replacement = '<li class="thumb_{"1"|mt_rand:5}"  >
71        <span class="wrap1">';
72  }
73
74  return preg_replace($search, $replacement, $content);
75}
76?>
Note: See TracBrowser for help on using the repository browser.