1 | <?php |
---|
2 | /* |
---|
3 | Theme Name: Pure_autumn |
---|
4 | Version: auto |
---|
5 | Description: Colors of autumn, random sort of colors for thumbnails, "S" blocks... a must have ! |
---|
6 | Theme URI: http://fr.piwigo.org/ext/extension_view.php?eid=443 |
---|
7 | Author: flop25 |
---|
8 | Author 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 **/ |
---|
20 | add_event_handler('loc_end_index_category_thumbnails', 'Pure_autumn_cat'); |
---|
21 | function 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 | } |
---|
27 | function 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 **/ |
---|
46 | add_event_handler('loc_end_index_thumbnails', 'Pure_autumn_thumbnails'); |
---|
47 | function 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 | |
---|
55 | function 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 | ?> |
---|