Social Buttons instead.'; } function tumblr_add_button() { global $conf, $template, $page; $conf['TumblrShare'] = unserialize($conf['TumblrShare']); $conf['TumblrShare']['css'] = array( 'share_1' => 'width:81px; height:20px;', 'share_2' => 'width:61px; height:20px;', 'share_3' => 'width:129px; height:20px;', 'share_4' => 'width:20px; height:20px;', 'share_1T' => 'width:81px; height:20px;', 'share_2T' => 'width:61px; height:20px;', 'share_3T' => 'width:129px; height:20px;', 'share_4T' => 'width:20px; height:20px;', ); $root_url = get_absolute_root_url(); // button on piture page if (script_basename() == 'picture') { global $picture; $template->assign(array( 'TUMBLR_MODE' => 'photo', 'TUMBLR_URL' => $root_url.ltrim(duplicate_picture_url(), './'), 'TUMBLR_TITLE' => $picture['current']['TITLE'], )); if ($conf['TumblrShare']['img_size'] == 'Original') { $template->assign('TUMBLR_SOURCE', $root_url.ltrim($picture['current']['src_image']->get_url(), './')); } else { $template->assign('TUMBLR_SOURCE', $root_url.ltrim(DerivativeImage::url($conf['TumblrShare']['img_size'], $picture['current']['src_image']), './')); } } // button on other pages else if (script_basename() == 'index') { $conf['TumblrShare']['position'] = 'index'; $template->assign(array( 'TUMBLR_MODE' => 'link', 'TUMBLR_URL' => $root_url.ltrim(duplicate_index_url(), './'), 'TUMBLR_TITLE' => strip_tags($page['title']), )); } else { return; } // config $template->assign(array( 'TUMBLR_POSITION' => $conf['TumblrShare']['position'], 'TUMBLR_TYPE' => $conf['TumblrShare']['type'], 'TUMBLR_CSS' => $conf['TumblrShare']['css'][ $conf['TumblrShare']['type'] ], 'TUMBLR_COPY' => ' (from '.$conf['gallery_title'].')', )); $template->set_filename('tumblr_button', dirname(__FILE__).'/button.tpl'); $button = $template->parse('tumblr_button', true); switch ($conf['TumblrShare']['position']) { case 'index': // $template->add_index_button('