Line | |
---|
1 | <?php |
---|
2 | defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); |
---|
3 | |
---|
4 | function socialbutt_install() |
---|
5 | { |
---|
6 | global $conf; |
---|
7 | |
---|
8 | if (empty($conf['SocialButtons'])) |
---|
9 | { |
---|
10 | $default_config = array( |
---|
11 | 'position' => 'toolbar', |
---|
12 | 'twitter' => array( |
---|
13 | 'enabled' => true, |
---|
14 | 'size' => 'small', |
---|
15 | 'count' => 'bubble', |
---|
16 | 'via' => null, |
---|
17 | ), |
---|
18 | 'google' => array( |
---|
19 | 'enabled' => true, |
---|
20 | 'size' => 'medium', |
---|
21 | 'annotation' => 'bubble', |
---|
22 | ), |
---|
23 | 'tumblr' => array( |
---|
24 | 'enabled' => true, |
---|
25 | 'type' => 'share_1', |
---|
26 | 'img_size' => 'Original', |
---|
27 | ), |
---|
28 | 'facebook' => array( |
---|
29 | 'enabled' => true, |
---|
30 | 'color' => 'light', |
---|
31 | 'layout' => 'button_count', |
---|
32 | ), |
---|
33 | ); |
---|
34 | |
---|
35 | if (isset($conf['TumblrShare'])) |
---|
36 | { |
---|
37 | $temp = is_string($conf['TumblrShare']) ? unserialize($conf['TumblrShare']) : $conf['TumblrShare']; |
---|
38 | $default_config['tumblr']['type'] = $temp['type']; |
---|
39 | $default_config['tumblr']['img_size'] = $temp['img_size']; |
---|
40 | } |
---|
41 | if (isset($conf['TweetThis'])) |
---|
42 | { |
---|
43 | $temp = is_string($conf['TweetThis']) ? unserialize($conf['TweetThis']) : $conf['TweetThis']; |
---|
44 | $default_config['twitter']['size'] = $temp['size']; |
---|
45 | $default_config['twitter']['count'] = $temp['count'] ? 'bubble' : 'none'; |
---|
46 | $default_config['twitter']['via'] = $temp['via']; |
---|
47 | } |
---|
48 | if (isset($conf['GooglePlusOne'])) |
---|
49 | { |
---|
50 | $temp = is_string($conf['GooglePlusOne']) ? unserialize($conf['GooglePlusOne']) : $conf['GooglePlusOne']; |
---|
51 | $default_config['google']['size'] = $temp['size']; |
---|
52 | $default_config['google']['annotation'] = $temp['annotation']; |
---|
53 | } |
---|
54 | |
---|
55 | |
---|
56 | $conf['SocialButtons'] = serialize($default_config); |
---|
57 | conf_update_param('SocialButtons', $conf['SocialButtons']); |
---|
58 | } |
---|
59 | } |
---|
60 | |
---|
61 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.