Last change
on this file since 11699 was
11699,
checked in by flop25, 13 years ago
|
omg i did it ! dynamic generation of thumbnails.tpl
admin page for width and this dynamic generation
|
File size:
1.3 KB
|
Line | |
---|
1 | <?php |
---|
2 | |
---|
3 | // Need upgrade? |
---|
4 | |
---|
5 | global $conf; |
---|
6 | |
---|
7 | if (!isset($conf['stripped_black_bloc'])) |
---|
8 | include(PHPWG_THEMES_PATH.'stripped_black_bloc/admin/upgrade.inc.php'); |
---|
9 | |
---|
10 | load_language('theme.lang', PHPWG_THEMES_PATH.'stripped_black_bloc/'); |
---|
11 | |
---|
12 | $config_send= array(); |
---|
13 | |
---|
14 | if(isset($_POST['submit_stripped_black_bloc'])) |
---|
15 | { |
---|
16 | $config_send['thumbnail']=(isset($_POST['f_thumbnail'])) ? $_POST['f_thumbnail'] : 'piwigo'; |
---|
17 | $config_send['column_width']=(isset($_POST['f_column_width'])) ? $_POST['f_column_width'] : 170; |
---|
18 | if ( isset($_POST['f_column_width']) and isset($_POST['f_thumbnail_width'])) |
---|
19 | { |
---|
20 | if ( $_POST['f_column_width']>$_POST['f_thumbnail_width'] ) |
---|
21 | { |
---|
22 | $config_send['thumbnail_width']=$_POST['f_thumbnail_width']; |
---|
23 | } |
---|
24 | else |
---|
25 | { |
---|
26 | $config_send['thumbnail_width']=$_POST['f_column_width']-20; |
---|
27 | } |
---|
28 | } |
---|
29 | else |
---|
30 | { |
---|
31 | $config_send['thumbnail_width']=150; |
---|
32 | } |
---|
33 | |
---|
34 | conf_update_param('stripped_black_bloc', pwg_db_real_escape_string(serialize($config_send))); |
---|
35 | |
---|
36 | array_push($page['infos'], l10n('Information data registered in database')); |
---|
37 | |
---|
38 | load_conf_from_db(); |
---|
39 | } |
---|
40 | |
---|
41 | $template->set_filenames(array( |
---|
42 | 'theme_admin_content' => dirname(__FILE__) . '/admin.tpl')); |
---|
43 | |
---|
44 | $template->assign('options', unserialize($conf['stripped_black_bloc'])); |
---|
45 | |
---|
46 | $template->assign_var_from_handle('ADMIN_CONTENT', 'theme_admin_content'); |
---|
47 | |
---|
48 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.