1 | <?php |
---|
2 | defined('SOCIALBUTT_PATH') or die('Hacking attempt!'); |
---|
3 | |
---|
4 | function socialbutt_facebook($basename, $root_url, &$tpl_vars, &$buttons) |
---|
5 | { |
---|
6 | global $conf, $template, $user; |
---|
7 | |
---|
8 | $facebook_langs = array( |
---|
9 | 'af_ZA','ar_AR','az_AZ','be_BY','bg_BG','bn_IN','bs_BA','ca_ES','cs_CZ','cy_GB','da_DK', |
---|
10 | 'de_DE','el_GR','en_GB','en_PI','en_UD','en_US','eo_EO','es_ES','es_LA','et_EE','eu_ES', |
---|
11 | 'fa_IR','fb_LT','fi_FI','fo_FO','fr_CA','fr_FR','fy_NL','ga_IE','gl_ES','he_IL','hi_IN', |
---|
12 | 'hr_HR','hu_HU','hy_AM','id_ID','is_IS','it_IT','ja_JP','ka_GE','km_KH','ko_KR','ku_TR', |
---|
13 | 'la_VA','lt_LT','lv_LV','mk_MK','ml_IN','ms_MY','nb_NO','ne_NP','nl_NL','nn_NO','pa_IN', |
---|
14 | 'pl_PL','ps_AF','pt_BR','pt_PT','ro_RO','ru_RU','sk_SK','sl_SI','sq_AL','sr_RS','sv_SE', |
---|
15 | 'sw_KE','ta_IN','te_IN','th_TH','tl_PH','tr_TR','uk_UA','vi_VN','zh_CN','zh_HK','zh_TW' |
---|
16 | ); |
---|
17 | |
---|
18 | |
---|
19 | // if the link is in the toolbar, we must use smaller buttons |
---|
20 | if ( $conf['SocialButtons']['position'] == 'index' or $conf['SocialButtons']['position'] == 'toolbar') |
---|
21 | { |
---|
22 | if ($conf['SocialButtons']['facebook']['layout'] == 'box_count') |
---|
23 | { |
---|
24 | $conf['SocialButtons']['facebook']['layout'] = 'button_count'; |
---|
25 | } |
---|
26 | } |
---|
27 | |
---|
28 | |
---|
29 | // config |
---|
30 | $tpl_vars['FACEBOOK'] = $conf['SocialButtons']['facebook']; |
---|
31 | |
---|
32 | // button language |
---|
33 | if ( in_array($user['language'], $facebook_langs) ) |
---|
34 | { |
---|
35 | $tpl_vars['FACEBOOK']['lang'] = $user['language']; |
---|
36 | } |
---|
37 | else |
---|
38 | { |
---|
39 | $tpl_vars['FACEBOOK']['lang'] = 'en_GB'; |
---|
40 | } |
---|
41 | |
---|
42 | |
---|
43 | $template->set_filename('facebook_button', realpath(SOCIALBUTT_PATH .'template/facebook.tpl')); |
---|
44 | $buttons[] = 'facebook_button'; |
---|
45 | } |
---|
46 | |
---|
47 | ?> |
---|