1 | <?php |
---|
2 | |
---|
3 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
4 | $ad_c = get_plugin_data('adult_content'); |
---|
5 | |
---|
6 | global $conf, $template, $lang, $page; |
---|
7 | global $prefixeTable; |
---|
8 | load_language('plugin.lang', $ad_c->plugin_path); |
---|
9 | $conf_ad_c = unserialize($conf['ad_c_plugin']); |
---|
10 | |
---|
11 | |
---|
12 | $page['infos'] = array(); |
---|
13 | |
---|
14 | if (isset($_POST['option_ad_c'])) |
---|
15 | { |
---|
16 | $newconf_plugin=array(); |
---|
17 | $newconf_plugin['menublock_for_guest'] = (isset($_POST['menublock_for_guest'])) ? true : false; |
---|
18 | $newconf_plugin['manage_what'] = (isset($_POST['manage_what'])) ? $_POST['manage_what'] : 'both'; |
---|
19 | $query = ' |
---|
20 | UPDATE '.CONFIG_TABLE.' |
---|
21 | SET value="'.pwg_db_real_escape_string(serialize($newconf_plugin)).'" |
---|
22 | WHERE param="ad_c_plugin" |
---|
23 | LIMIT 1'; |
---|
24 | pwg_query($query); |
---|
25 | |
---|
26 | array_push($page['infos'], l10n('ad_c_msg_admin_1')); |
---|
27 | load_conf_from_db(); |
---|
28 | $conf_ad_c = unserialize($conf['ad_c_plugin']); |
---|
29 | } |
---|
30 | |
---|
31 | |
---|
32 | $check='checked="checked"'; |
---|
33 | if ($conf_ad_c['menublock_for_guest']=='true') { $menublock=$check; } else { $menublock=NULL; } |
---|
34 | $template->assign( |
---|
35 | array( |
---|
36 | 'AD_C_manage_what' => $conf_ad_c['manage_what'], |
---|
37 | 'AD_C_menublock_for_guest' => $menublock, |
---|
38 | 'AD_C_LANG' => $user['language'], |
---|
39 | ) |
---|
40 | ); |
---|
41 | |
---|
42 | |
---|
43 | $template->set_filename('plugin_admin_content', $ad_c->plugin_path.'admin/admin.tpl'); |
---|
44 | $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); |
---|
45 | ?> |
---|