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(array( 'TWEET_IFRAME' => true, 'TWEET_COUNTER' => $conf['TweetThis'][0], )); } else { $template->assign(array( 'TWEET_IFRAME' => false, 'TWEET_COUNTER' => 'none', )); } // if the link is in the toolbar, we must use smallier 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 = '
'; $replace = '
{if $TWEET_IFRAME}Tweet{else}{/if}
'; break; case 'bottom': $search = '{$ELEMENT_CONTENT}'; $replace = ' {if $TWEET_IFRAME}Tweet{else}{/if} '; break; case 'toolbar': $search = '{*caddie management END*}'; $replace = ' {if $TWEET_IFRAME}Tweet{else}{/if} '; break; case 'index': $search = '