1 | <?php |
---|
2 | if (!defined('SOCIALBUTT_PATH')) die('Hacking attempt!'); |
---|
3 | |
---|
4 | global $conf, $template, $page; |
---|
5 | |
---|
6 | load_language('plugin.lang', SOCIALBUTT_PATH); |
---|
7 | |
---|
8 | |
---|
9 | if (isset($_POST['submit'])) |
---|
10 | { |
---|
11 | $conf['SocialButtons'] = array( |
---|
12 | 'position' => $_POST['position'], |
---|
13 | 'on_index' => get_boolean($_POST['on_index']), |
---|
14 | 'twitter' => array( |
---|
15 | 'enabled' => isset($_POST['twitter']['enabled']), |
---|
16 | 'size' => $_POST['twitter']['size'], |
---|
17 | 'count' => $_POST['twitter']['count'], |
---|
18 | 'via' => trim($_POST['twitter']['via']), |
---|
19 | ), |
---|
20 | 'google' => array( |
---|
21 | 'enabled' => isset($_POST['google']['enabled']), |
---|
22 | 'size' => $_POST['google']['size'], |
---|
23 | 'annotation' => $_POST['google']['annotation'], |
---|
24 | ), |
---|
25 | 'tumblr' => array( |
---|
26 | 'enabled' => isset($_POST['tumblr']['enabled']), |
---|
27 | 'type' => $_POST['tumblr']['type'], |
---|
28 | 'img_size' => $_POST['tumblr']['img_size'], |
---|
29 | ), |
---|
30 | 'facebook' => array( |
---|
31 | 'enabled' => isset($_POST['facebook']['enabled']), |
---|
32 | 'color' => $_POST['facebook']['color'], |
---|
33 | 'layout' => $_POST['facebook']['layout'], |
---|
34 | ), |
---|
35 | 'pinterest' => array( |
---|
36 | 'enabled' => isset($_POST['pinterest']['enabled']), |
---|
37 | 'layout' => $_POST['pinterest']['layout'], |
---|
38 | 'img_size' => $_POST['pinterest']['img_size'], |
---|
39 | ), |
---|
40 | ); |
---|
41 | |
---|
42 | conf_update_param('SocialButtons', serialize($conf['SocialButtons'])); |
---|
43 | array_push($page['infos'], l10n('Information data registered in database')); |
---|
44 | |
---|
45 | // the prefilter changes, we must delete compiled templatess |
---|
46 | $template->delete_compiled_templates(); |
---|
47 | } |
---|
48 | |
---|
49 | |
---|
50 | $template->assign($conf['SocialButtons']); |
---|
51 | $template->assign(array( |
---|
52 | 'SOCIALBUTT_PATH' => SOCIALBUTT_PATH, |
---|
53 | 'img_sizes' => array_merge(ImageStdParams::get_all_types(), array('Original')), |
---|
54 | )); |
---|
55 | |
---|
56 | $template->set_filename('socialbutt_content', realpath(SOCIALBUTT_PATH . 'template/admin.tpl')); |
---|
57 | $template->assign_var_from_handle('ADMIN_CONTENT', 'socialbutt_content'); |
---|
58 | |
---|
59 | ?> |
---|