source: extensions/SocialButtons/include/install.inc.php @ 20374

Last change on this file since 20374 was 20374, checked in by mistic100, 11 years ago

add pinterest, option to hide counter on facebook button

File size: 2.3 KB
Line 
1<?php
2defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
3
4function 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      'pinterest' => array(
34        'enabled' => true,
35        'layout' => 'horizontal',
36        'img_size' => 'Original',
37        ),
38      );
39   
40    if (isset($conf['TumblrShare']))
41    {
42      $temp = is_string($conf['TumblrShare']) ? unserialize($conf['TumblrShare']) : $conf['TumblrShare'];
43      $default_config['tumblr']['type'] = $temp['type'];
44      $default_config['tumblr']['img_size'] = $temp['img_size'];
45    }
46    if (isset($conf['TweetThis']))
47    {
48      $temp = is_string($conf['TweetThis']) ? unserialize($conf['TweetThis']) : $conf['TweetThis'];
49      $default_config['twitter']['size'] = $temp['size'];
50      $default_config['twitter']['count'] = $temp['count'] ? 'bubble' : 'none';
51      $default_config['twitter']['via'] = $temp['via'];
52    }
53    if (isset($conf['GooglePlusOne']))
54    {
55      $temp = is_string($conf['GooglePlusOne']) ? unserialize($conf['GooglePlusOne']) : $conf['GooglePlusOne'];
56      $default_config['google']['size'] = $temp['size'];
57      $default_config['google']['annotation'] = $temp['annotation'];
58    }
59   
60    $conf['SocialButtons'] = serialize($default_config);
61    conf_update_param('SocialButtons', $conf['SocialButtons']);
62  }
63  else
64  {
65    $new_conf = unserialize($conf['SocialButtons']);
66    if (empty($new_conf['pinterest']))
67    {
68      $new_conf['pinterest'] = array(
69        'enabled' => true,
70        'layout' => 'horizontal',
71        'img_size' => 'Original',
72        );
73      $conf['SocialButtons'] = serialize($new_conf);
74      conf_update_param('SocialButtons', $conf['SocialButtons']);
75    }
76  }
77}
78
79?>
Note: See TracBrowser for help on using the repository browser.