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 = explode("," , $conf['ad_c_plugin']); |
---|
10 | |
---|
11 | |
---|
12 | $page['infos'] = array(); |
---|
13 | |
---|
14 | if (isset($_POST['option_ad_c'])) |
---|
15 | { |
---|
16 | $newconf_plugin = (isset($_POST['menublock_for_guest'])) ? 'true' : 'false'; |
---|
17 | $newconf_plugin .= (isset($_POST['block_on_index'])) ? ',true' : ',false'; |
---|
18 | $newconf_plugin .= (isset($_POST['manage_what'])) ? ','.$_POST['manage_what'] : ',both'; |
---|
19 | //$newconf_plugin = implode ("," , $newconf_plugin); |
---|
20 | $query = ' |
---|
21 | UPDATE '.CONFIG_TABLE.' |
---|
22 | SET value="'.$newconf_plugin.'" |
---|
23 | WHERE param="ad_c_plugin" |
---|
24 | LIMIT 1'; |
---|
25 | pwg_query($query); |
---|
26 | |
---|
27 | array_push($page['infos'], l10n('ad_c_msg_admin_1')); |
---|
28 | } |
---|
29 | |
---|
30 | load_conf_from_db(); |
---|
31 | $conf_ad_c = explode("," , $conf['ad_c_plugin']); |
---|
32 | |
---|
33 | $check='checked="checked"'; |
---|
34 | if ($conf_ad_c[0]=='true') { $menublock=$check; } else { $menublock=NULL; } |
---|
35 | if ($conf_ad_c[1]=='true') { $index=$check; } else { $index=NULL; } |
---|
36 | $disabled='disabled="disabled"'; |
---|
37 | $template->assign( |
---|
38 | array( |
---|
39 | 'AD_C_manage_what' => $conf_ad_c[2], |
---|
40 | 'AD_C_menublock_for_guest' => $menublock, |
---|
41 | 'AD_C_block_on_index' => $index, |
---|
42 | 'AD_C_block_on_index_disabled' => $disabled, |
---|
43 | 'AD_C_LANG' => $user['language'], |
---|
44 | ) |
---|
45 | ); |
---|
46 | $template->set_filename('plugin_admin_content', $ad_c->plugin_path.'admin/admin.tpl'); |
---|
47 | $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); |
---|
48 | ?> |
---|