Social Buttons instead.'; } function gplus1_add_button() { global $conf, $template, $user; $conf['GooglePlusOne'] = unserialize($conf['GooglePlusOne']); $conf['GooglePlusOne']['lang'] = array( 'ar','bg','ca','zh-CN','zh-TW','hr','cs','da','nl','en-US','en-GB','et','fi','fr','de', 'el','iw','hi','hu','id','it','ja','ko','lv','lt','ms','no','fa','pl','pt-BR','pt-PT', 'ro','ru','sr','sk','sl','es','sv','th','tr','uk','vi', ); // urls and position if (script_basename() == 'picture') { $template->assign('GPLUS1_URL', get_absolute_root_url().ltrim(duplicate_picture_url(), './')); } else if (script_basename() == 'index') { $conf['GooglePlusOne']['position'] = 'index'; $template->assign('GPLUS1_URL', get_absolute_root_url().ltrim(duplicate_index_url(array(), array('start')), './')); } else { return; } // if the link is in the toolbar, we must use smallier buttons if ( script_basename() == 'index' OR $conf['GooglePlusOne']['position'] == 'toolbar') { if ($conf['GooglePlusOne']['size'] == 'tall' AND $conf['GooglePlusOne']['annotation'] == 'bubble') { $conf['GooglePlusOne']['size'] = 'standard'; } } // config $template->assign(array( 'GPLUS1_SIZE' => $conf['GooglePlusOne']['size'], 'GPLUS1_ANNO' => $conf['GooglePlusOne']['annotation'], 'GPLUS1_POSITON' => $conf['GooglePlusOne']['position'], )); // button language if ( in_array(str_replace('_','-',$user['language']), $conf['GooglePlusOne']['lang']) ) { $template->assign('GPLUS1_LANG', str_replace('_','-',$user['language'])); } if ( in_array(substr($user['language'],0,2), $conf['GooglePlusOne']['lang']) ) { $template->assign('GPLUS1_LANG', substr($user['language'],0,2)); } else { $template->assign('GPLUS1_LANG', 'en-GB'); } $template->set_filename('gplus1_button', dirname(__FILE__).'/button.tpl'); $button = $template->parse('gplus1_button', true); switch ($conf['GooglePlusOne']['position']) { case 'index': // $template->add_index_button('