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