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

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

remove "no caption" option for facebook (buggy)
fix urls
fix pinterest javascript

File size: 870 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 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.