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 | ); |
---|
18 | /** mainpage_categories.tpl **/ |
---|
19 | add_event_handler('loc_end_index_category_thumbnails', 'Pure_autumn_cat'); |
---|
20 | function Pure_autumn_cat($tpl_thumbnails_var) |
---|
21 | { |
---|
22 | global $template; |
---|
23 | $template->set_prefilter('index_category_thumbnails', 'Pure_autumn_prefilter_cat'); |
---|
24 | return $tpl_thumbnails_var; |
---|
25 | } |
---|
26 | function Pure_autumn_prefilter_cat($content, &$smarty) |
---|
27 | { |
---|
28 | $pwgversion=str_replace('.','',PHPWG_VERSION); |
---|
29 | $pwgversion_array=explode('.', PHPWG_VERSION); |
---|
30 | if ($pwgversion_array[0].$pwgversion_array[1]=="23") |
---|
31 | { |
---|
32 | $search = '#<li>[\s]*<div class="thumbnailCategory">#'; |
---|
33 | $replacement = '<li class="{cycle values="cat_1,cat_2,cat_3,cat_4"}" > |
---|
34 | <div class="thumbnailCategory">'; |
---|
35 | } |
---|
36 | elseif ($pwgversion_array[0].$pwgversion_array[1]=="24" or $pwgversion_array[0].$pwgversion_array[1]=="25" ) |
---|
37 | { |
---|
38 | $search = '#<li class="\{if \$smarty\.foreach.*odd\{else\}even\{/if\}">#s'; |
---|
39 | $replacement = '<li class="{cycle values="cat_1,cat_2,cat_3,cat_4"}" >'; |
---|
40 | } |
---|
41 | return preg_replace($search, $replacement, $content); |
---|
42 | } |
---|
43 | |
---|
44 | /** thumbnails.tpl **/ |
---|
45 | add_event_handler('loc_end_index_thumbnails', 'Pure_autumn_thumbnails'); |
---|
46 | function Pure_autumn_thumbnails($tpl_thumbnails_var) |
---|
47 | { |
---|
48 | global $template; |
---|
49 | $template->set_prefilter('index_thumbnails', 'Pure_autumn_prefilter_thumbnails'); |
---|
50 | $template->set_prefilter('stuffs', 'Pure_autumn_prefilter_thumbnails'); |
---|
51 | return $tpl_thumbnails_var; |
---|
52 | } |
---|
53 | |
---|
54 | function Pure_autumn_prefilter_thumbnails($content, &$smarty) |
---|
55 | { |
---|
56 | $pwgversion=str_replace('.','',PHPWG_VERSION); |
---|
57 | $pwgversion_array=explode('.', PHPWG_VERSION); |
---|
58 | if ($pwgversion_array[0].$pwgversion_array[1]=="23") |
---|
59 | { |
---|
60 | $search = '#<li>[\s]*<span class="wrap1">#'; |
---|
61 | |
---|
62 | $replacement = '<li class="thumb_{"1"|mt_rand:5}" > |
---|
63 | <span class="wrap1">'; |
---|
64 | } |
---|
65 | elseif ($pwgversion_array[0].$pwgversion_array[1]=="24") |
---|
66 | { |
---|
67 | $search = '#<li>[\s]*<span class="wrap1">#'; |
---|
68 | |
---|
69 | $replacement = '<li class="thumb_{"1"|mt_rand:5}" > |
---|
70 | <span class="wrap1">'; |
---|
71 | } |
---|
72 | |
---|
73 | return preg_replace($search, $replacement, $content); |
---|
74 | } |
---|
75 | ?> |
---|