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 | 'img_size' => $_POST['img_size'], |
---|
15 | 'light' => isset($_POST['light']), |
---|
16 | 'twitter' => array( |
---|
17 | 'enabled' => isset($_POST['twitter']['enabled']), |
---|
18 | 'size' => $_POST['twitter']['size'], |
---|
19 | 'count' => $_POST['twitter']['count'], |
---|
20 | 'via' => trim($_POST['twitter']['via']), |
---|
21 | ), |
---|
22 | 'google' => array( |
---|
23 | 'enabled' => isset($_POST['google']['enabled']), |
---|
24 | 'size' => $_POST['google']['size'], |
---|
25 | 'annotation' => $_POST['google']['annotation'], |
---|
26 | ), |
---|
27 | 'tumblr' => array( |
---|
28 | 'enabled' => isset($_POST['tumblr']['enabled']), |
---|
29 | 'type' => $_POST['tumblr']['type'], |
---|
30 | ), |
---|
31 | 'facebook' => array( |
---|
32 | 'enabled' => isset($_POST['facebook']['enabled']), |
---|
33 | 'layout' => $_POST['facebook']['layout'], |
---|
34 | ), |
---|
35 | 'pinterest' => array( |
---|
36 | 'enabled' => isset($_POST['pinterest']['enabled']), |
---|
37 | 'layout' => $_POST['pinterest']['layout'], |
---|
38 | ), |
---|
39 | 'reddit' => array( |
---|
40 | 'enabled' => isset($_POST['reddit']['enabled']), |
---|
41 | 'type' => $_POST['reddit']['type'], |
---|
42 | 'community' => $_POST['reddit']['community'], |
---|
43 | ), |
---|
44 | 'linkedin' => array( |
---|
45 | 'enabled' => isset($_POST['linkedin']['enabled']), |
---|
46 | 'counter' => $_POST['linkedin']['counter'], |
---|
47 | ), |
---|
48 | ); |
---|
49 | |
---|
50 | conf_update_param('SocialButtons', $conf['SocialButtons']); |
---|
51 | $page['infos'][] = l10n('Information data registered in database'); |
---|
52 | |
---|
53 | // the prefilter changes, we must delete compiled templatess |
---|
54 | $template->delete_compiled_templates(); |
---|
55 | } |
---|
56 | |
---|
57 | |
---|
58 | $template->assign($conf['SocialButtons']); |
---|
59 | $template->assign(array( |
---|
60 | 'SOCIALBUTT_PATH' => SOCIALBUTT_PATH, |
---|
61 | 'img_sizes' => array_merge(ImageStdParams::get_all_types(), array('Original')), |
---|
62 | )); |
---|
63 | |
---|
64 | $template->set_filename('socialbutt_content', realpath(SOCIALBUTT_PATH . 'template/admin.tpl')); |
---|
65 | $template->assign_var_from_handle('ADMIN_CONTENT', 'socialbutt_content'); |
---|