Line | |
---|
1 | <?php |
---|
2 | defined('SOCIALBUTT_PATH') or die('Hacking attempt!'); |
---|
3 | |
---|
4 | function socialbutt_pinterest($basename, $root_url, &$tpl_vars, &$buttons) |
---|
5 | { |
---|
6 | // only on piture page |
---|
7 | if ($basename != 'picture') |
---|
8 | { |
---|
9 | return; |
---|
10 | } |
---|
11 | |
---|
12 | global $conf, $template, $picture; |
---|
13 | |
---|
14 | // config |
---|
15 | $tpl_vars['PINTEREST'] = $conf['SocialButtons']['pinterest']; |
---|
16 | $tpl_vars['PINTEREST']['title'] = $picture['current']['TITLE']; |
---|
17 | |
---|
18 | if ($conf['SocialButtons']['pinterest']['img_size'] == 'Original') |
---|
19 | { |
---|
20 | $tpl_vars['PINTEREST']['source'] = $picture['current']['src_image']->get_url(); |
---|
21 | } |
---|
22 | else |
---|
23 | { |
---|
24 | $tpl_vars['PINTEREST']['source'] = DerivativeImage::url($conf['SocialButtons']['pinterest']['img_size'], $picture['current']['src_image']); |
---|
25 | } |
---|
26 | |
---|
27 | |
---|
28 | $template->set_filename('pinterest_button', realpath(SOCIALBUTT_PATH .'template/pinterest.tpl')); |
---|
29 | $buttons[] = 'pinterest_button'; |
---|
30 | } |
---|
31 | |
---|
32 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.