source: extensions/SocialButtons/include/pinterest.inc.php @ 24757

Last change on this file since 24757 was 24757, checked in by mistic100, 11 years ago

add light mode: no script loaded
tests in migration task
add an id to the div on picture page

File size: 869 bytes
Line 
1<?php
2defined('SOCIALBUTT_PATH') or die('Hacking attempt!');
3
4function socialbutt_pinterest($basename, $root_url, &$tpl_vars, &$buttons)
5{
6  // only on picture 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.