source: extensions/SocialButtons/include/tumblr.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: 1.1 KB
Line 
1<?php
2defined('SOCIALBUTT_PATH') or die('Hacking attempt!');
3
4function socialbutt_tumblr($basename, $root_url, &$tpl_vars, &$buttons)
5{
6  global $conf, $template;
7 
8  // config
9  $tpl_vars['TUMBLR'] = $conf['SocialButtons']['tumblr'];
10 
11  // button on piture page
12  if ($basename == 'picture')
13  {
14    global $picture;
15   
16    $tpl_vars['TUMBLR']['mode'] = 'photo';
17    $tpl_vars['TUMBLR']['title'] = $picture['current']['TITLE'];
18   
19    if ($conf['SocialButtons']['tumblr']['img_size'] == 'Original')
20    {
21      $tpl_vars['TUMBLR']['source'] = $picture['current']['src_image']->get_url();
22    }
23    else
24    {
25      $tpl_vars['TUMBLR']['source'] = DerivativeImage::url($conf['SocialButtons']['tumblr']['img_size'], $picture['current']['src_image']);
26    }
27  }
28  // button on other pages
29  else if ($basename == 'index')
30  {
31    global $page;
32   
33    $tpl_vars['TUMBLR']['mode'] = 'link';
34    $tpl_vars['TUMBLR']['title'] = strip_tags($page['title']);
35  }
36 
37 
38  $template->set_filename('tumblr_button', realpath(SOCIALBUTT_PATH .'template/tumblr.tpl'));
39  $buttons[] = 'tumblr_button';
40}
41
42?> 
Note: See TracBrowser for help on using the repository browser.