assign(array( 'GPLUS1_SIZE' => $conf['GooglePlusOne']['size'], 'GPLUS1_ANNO' => $conf['GooglePlusOne']['annotation'], )); if (script_basename() == 'picture') { $template->assign('GPLUS1_POSITON', $conf['GooglePlusOne']['position']); $template->set_prefilter('picture', 'gplus1_add_button_prefilter'); } else if (script_basename() == 'index') { $template->assign('GPLUS1_POSITON', 'index'); $template->set_prefilter('index', 'gplus1_add_button_prefilter'); } // 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') { $template->assign('GPLUS1_SIZE', 'standard'); } } // 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'); } } function gplus1_add_button_prefilter($content, &$smarty) { global $template; $replace = '{combine_script id=\'google_plusone\' path=\'https://apis.google.com/js/plusone.js\'} '; switch ($template->get_template_vars('GPLUS1_POSITON')) { case 'top': $search = '
'; $replace = '
'.$replace.'
'; break; case 'bottom': $search = '{$ELEMENT_CONTENT}'; break; case 'toolbar': $search = '
'; break; case 'index': $search = '