1 | <?php |
---|
2 | // Chech whether we are indeed included by Piwigo. |
---|
3 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
4 | |
---|
5 | // Fetch the template. |
---|
6 | global $template, $conf, $page; |
---|
7 | |
---|
8 | if ((!empty($_POST['modified'])) and ($_POST['modified']=true)) { |
---|
9 | $eb_conf = array( |
---|
10 | 'blog_name' => $_POST['blog_name'], |
---|
11 | 'posts_per_page' => $_POST['posts_per_page'], |
---|
12 | 'blog_description' => $_POST['blog_description'], |
---|
13 | 'date_format' => $_POST['date_format'] |
---|
14 | ); |
---|
15 | if (!empty($_POST['show_on_main_page'])) { |
---|
16 | $eb_conf['show_on_main_page'] = $_POST['show_on_main_page']; |
---|
17 | }else{ |
---|
18 | $eb_conf['show_on_main_page'] = false; |
---|
19 | } |
---|
20 | if (!empty($_POST['show_on_category_page'])) { |
---|
21 | $eb_conf['show_on_category_page'] = $_POST['show_on_category_page']; |
---|
22 | }else{ |
---|
23 | $eb_conf['show_on_category_page'] = false; |
---|
24 | } |
---|
25 | if (!empty($_POST['show_number'])) { |
---|
26 | $eb_conf['show_number'] = $_POST['show_number']; |
---|
27 | }else{ |
---|
28 | $eb_conf['show_number'] = false; |
---|
29 | } |
---|
30 | if (!empty($_POST['show_date'])) { |
---|
31 | $eb_conf['show_date'] = $_POST['show_date']; |
---|
32 | }else{ |
---|
33 | $eb_conf['show_date'] = false; |
---|
34 | } |
---|
35 | pwg_query(' |
---|
36 | UPDATE '.CONFIG_TABLE.' |
---|
37 | SET '.CONFIG_TABLE.'.value = "'.pwg_db_real_escape_string(serialize($eb_conf)).'" |
---|
38 | WHERE '.CONFIG_TABLE.'.param = "evil_blog" LIMIT 1 ; |
---|
39 | '); |
---|
40 | array_push($page['infos'], l10n('config_is_saved')); |
---|
41 | } else { $eb_conf = @unserialize($conf['evil_blog']);} |
---|
42 | |
---|
43 | $template->assign('blog_name', $eb_conf['blog_name']); |
---|
44 | $template->assign('blog_description', $eb_conf['blog_description']); |
---|
45 | $template->assign('posts_per_page', $eb_conf['posts_per_page']); |
---|
46 | $template->assign('show_on_main_page', $eb_conf['show_on_main_page']); |
---|
47 | $template->assign('show_on_category_page', $eb_conf['show_on_category_page']); |
---|
48 | $template->assign('show_number', $eb_conf['show_number']); |
---|
49 | $template->assign('show_date', $eb_conf['show_date']); |
---|
50 | $template->assign('date_format', $eb_conf['date_format']); |
---|
51 | |
---|
52 | $template->set_filenames( array('plugin_admin_content' => dirname(__FILE__).'/config.tpl') ); |
---|
53 | $template->assign_var_from_handle( 'ADMIN_CONTENT', 'plugin_admin_content'); |
---|
54 | |
---|
55 | ?> |
---|