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_number'])) { |
---|
21 | $eb_conf['show_number'] = $_POST['show_number']; |
---|
22 | }else{ |
---|
23 | $eb_conf['show_number'] = false; |
---|
24 | } |
---|
25 | if (!empty($_POST['show_date'])) { |
---|
26 | $eb_conf['show_date'] = $_POST['show_date']; |
---|
27 | }else{ |
---|
28 | $eb_conf['show_date'] = false; |
---|
29 | } |
---|
30 | pwg_query(' |
---|
31 | UPDATE '.CONFIG_TABLE.' |
---|
32 | SET '.CONFIG_TABLE.'.value = "'.pwg_db_real_escape_string(serialize($eb_conf)).'" |
---|
33 | WHERE '.CONFIG_TABLE.'.param = "evil_blog" LIMIT 1 ; |
---|
34 | '); |
---|
35 | array_push($page['infos'], l10n('config_is_saved')); |
---|
36 | } else { $eb_conf = @unserialize($conf['evil_blog']);} |
---|
37 | |
---|
38 | $template->assign('blog_name', $eb_conf['blog_name']); |
---|
39 | $template->assign('blog_description', $eb_conf['blog_description']); |
---|
40 | $template->assign('posts_per_page', $eb_conf['posts_per_page']); |
---|
41 | $template->assign('show_on_main_page', $eb_conf['show_on_main_page']); |
---|
42 | $template->assign('show_number', $eb_conf['show_number']); |
---|
43 | $template->assign('show_date', $eb_conf['show_date']); |
---|
44 | $template->assign('date_format', $eb_conf['date_format']); |
---|
45 | |
---|
46 | $template->set_filenames( array('plugin_admin_content' => dirname(__FILE__).'/config.tpl') ); |
---|
47 | $template->assign_var_from_handle( 'ADMIN_CONTENT', 'plugin_admin_content'); |
---|
48 | |
---|
49 | ?> |
---|