Ignore:
Timestamp:
Oct 6, 2013, 9:05:18 PM (11 years ago)
Author:
mistic100
Message:

improve facebook light link and clean code & conf

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/SocialButtons/main.inc.php

    r24758 r24788  
    9494function socialbutt_add_button()
    9595{
    96   global $conf, $template;
     96  global $conf, $template, $picture;
    9797 
    9898  $basename = script_basename();
     
    121121  $tpl_vars = array(
    122122    'share_url' => $share_url,
     123    'basename' => $basename,
    123124    'position' => $conf['SocialButtons']['position'],
    124125    'light' => $conf['SocialButtons']['light'],
    125126    'copyright' => '(from <a href="'.$share_url.'">'.$conf['gallery_title'].'</a>)',
    126127    );
     128 
     129  if ($basename == 'picture')
     130  {
     131    if ($conf['SocialButtons']['img_size'] == 'Original')
     132    {
     133      $tpl_vars['source'] = $picture['current']['src_image']->get_url();
     134    }
     135    else
     136    {
     137      $tpl_vars['source'] = DerivativeImage::url($conf['SocialButtons']['img_size'], $picture['current']['src_image']);
     138    }
     139  }
     140 
     141 
    127142  $buttons = array();
    128  
    129143 
    130144  if ($conf['SocialButtons']['google']['enabled'])
Note: See TracChangeset for help on using the changeset viewer.