assign(array( 'TWEET_IMAGE' => $conf['TweetThis'][0], 'TWEET_POSITON' => $conf['TweetThis'][1], )); $template->set_prefilter('picture', 'tweet_add_button_prefilter'); } else if (script_basename() == 'index') { $template->assign(array( 'TWEET_IMAGE' => $conf['TweetThis'][0], 'TWEET_POSITON' => 'index', )); $template->set_prefilter('index', 'tweet_add_button_prefilter'); } // html change a bit if we use custom button, or official with counter if ( in_array( $conf['TweetThis'][0], array('none','horizontal','vertical') ) ) { $template->assign('TWEET_IFRAME', true); $template->assign('TWEET_COUNTER', $conf['TweetThis'][0]); } else { $template->assign('TWEET_IFRAME', false); $template->assign('TWEET_COUNTER', 'none'); } // if the link is in the toolbar, we must use smallest buttons if ( script_basename() == 'index' OR $conf['TweetThis'][1] == 'toolbar') { switch ($conf['TweetThis'][0]) { case 'vertical': $template->assign('TWEET_COUNTER', 'horizontal'); break; case 't_logo-a': $template->assign('TWEET_IMAGE', 't_small-a'); break; case 't_logo-b': $template->assign('TWEET_IMAGE', 't_small-b'); break; case 't_logo-c': $template->assign('TWEET_IMAGE', 't_small-c'); break; } } } function tweet_add_button_prefilter($content, &$smarty) { global $template; switch ($template->get_template_vars('TWEET_POSITON')) { case 'top': $search = '