mirror of
https://github.com/Piwigo/Piwigo-Social-Buttons.git
synced 2026-07-04 17:01:41 +02:00
599708fc90
git-svn-id: http://piwigo.org/svn/extensions/SocialButtons@23202 68402e56-0260-453c-a942-63ccdbb3a9ee
42 lines
1.1 KiB
PHP
42 lines
1.1 KiB
PHP
<?php
|
|
defined('SOCIALBUTT_PATH') or die('Hacking attempt!');
|
|
|
|
function socialbutt_tumblr($basename, $root_url, &$tpl_vars, &$buttons)
|
|
{
|
|
global $conf, $template;
|
|
|
|
// config
|
|
$tpl_vars['TUMBLR'] = $conf['SocialButtons']['tumblr'];
|
|
|
|
// button on piture page
|
|
if ($basename == 'picture')
|
|
{
|
|
global $picture;
|
|
|
|
$tpl_vars['TUMBLR']['mode'] = 'photo';
|
|
$tpl_vars['TUMBLR']['title'] = $picture['current']['TITLE'];
|
|
|
|
if ($conf['SocialButtons']['tumblr']['img_size'] == 'Original')
|
|
{
|
|
$tpl_vars['TUMBLR']['source'] = $picture['current']['src_image']->get_url();
|
|
}
|
|
else
|
|
{
|
|
$tpl_vars['TUMBLR']['source'] = DerivativeImage::url($conf['SocialButtons']['tumblr']['img_size'], $picture['current']['src_image']);
|
|
}
|
|
}
|
|
// button on other pages
|
|
else if ($basename == 'index')
|
|
{
|
|
global $page;
|
|
|
|
$tpl_vars['TUMBLR']['mode'] = 'link';
|
|
$tpl_vars['TUMBLR']['title'] = strip_tags($page['title']);
|
|
}
|
|
|
|
|
|
$template->set_filename('tumblr_button', realpath(SOCIALBUTT_PATH .'template/tumblr.tpl'));
|
|
$buttons[] = 'tumblr_button';
|
|
}
|
|
|
|
?>
|