Changeset 31106


Ignore:
Timestamp:
04/29/15 21:11:59 (4 years ago)
Author:
SergeD
Message:

version 1.0.3 - see changelog for details

Location:
extensions/ShareThis
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • extensions/ShareThis/admin.php

    r31051 r31106  
    1919    'pinterest'  => !empty($_POST['inc_pinterest']), 
    2020    'twitter'    => !empty($_POST['inc_twitter']), 
    21     'googleplus' => !empty($_POST['inc_googleplus']) 
     21    'googleplus' => !empty($_POST['inc_googleplus']), 
     22    'tumblr'     => !empty($_POST['inc_tumblr']) 
    2223  ); 
    2324 
     
    5051  'INC_PINTEREST'     => isset($params['pinterest']) && $params['pinterest'], 
    5152  'INC_TWITTER'       => isset($params['twitter']) && $params['twitter'], 
    52   'INC_GOOGLEPLUS'    => isset($params['googleplus']) && $params['googleplus'] 
     53  'INC_GOOGLEPLUS'    => isset($params['googleplus']) && $params['googleplus'], 
     54  'INC_TUMBLR'        => isset($params['tumblr']) && $params['tumblr'] 
    5355 
    5456)); 
  • extensions/ShareThis/changelog.txt

    r31059 r31106  
    141451 Franklin Street Fifth Floor, Boston, MA  02110-1301, USA. 
    1515 
     16Notes: 
     17* Google Plus would not pick up image references if $conf['derivative_url_style'] = 1; is used 
     18 
    1619=== Changelog === 
     20version 1.0.3 
     21+ ALL: Added better reference for OG: metadata 
     22+ ALL: Photo description extended to include Gallery title and author (if provided) 
     23+ Pinterest: Added Description. Fixed image reference. Improved Pinterest widget integration 
     24+ Tumblr: New option. Experimental 
     25 
    1726version 1.0.2 
    1827+ Corrected PayPal link for "Donate" link in admin area 
  • extensions/ShareThis/main.inc.php

    r31059 r31106  
    22/* 
    33Plugin Name: ShareThis 
    4 Version: 1.0.2 
     4Version: 1.0.3 
    55Description: Add "Share This" functionality to your site 
    66//Plugin URI: http://piwigo.org/ext/extension_view.php?eid=543 
     
    1515// +-----------------------------------------------------------------------+ 
    1616 
    17 define('SHARETHIS_VERSION', '1.0.2'); 
     17define('SHARETHIS_VERSION', '1.0.3'); 
    1818define('SHARETHIS_ID',      basename(dirname(__FILE__))); 
    1919define('SHARETHIS_PATH' ,   PHPWG_PLUGINS_PATH . SHARETHIS_ID . '/'); 
     
    4747  // prepare plugin configuration 
    4848  $conf['sharethis'] = safe_unserialize($conf['sharethis']); 
    49   if ($conf['sharethis']['facebook'] || $conf['sharethis']['pinterest'] || $conf['sharethis']['twitter'] || $conf['sharethis']['googleplus']): 
     49  if ($conf['sharethis']['facebook'] || $conf['sharethis']['pinterest'] || $conf['sharethis']['twitter'] || $conf['sharethis']['googleplus'] || $conf['sharethis']['tumblr']): 
    5050    add_event_handler('loc_begin_picture', 'sharethis_picture_handler'); 
    51   endif; 
     51  endif;                                                                                                                                     
    5252} 
    5353 
     
    7575      'sharethis_twitter'    => $conf['sharethis']['twitter'], 
    7676      'sharethis_googleplus' => $conf['sharethis']['googleplus'], 
     77      'sharethis_tumblr'     => $conf['sharethis']['tumblr'], 
    7778      'SHARETHIS_PATH'       => SHARETHIS_PATH, 
    7879      'CUR_PAGE'             => $curUrl 
     
    8586 
    8687  $url   = '{$CUR_PAGE|escape:\'url\'}'; 
    87   $image = '{if $current.selected_derivative}{$U_HOME}/{$current.selected_derivative->get_url()|escape:\'url\'}{else}{/if}'; 
    88   $title = '{$PAGE_TITLE|escape:\'url\'}'; 
     88  $image = '{if $current.selected_derivative}{$U_HOME|escape:\'url\'}{"/"|escape:\'url\'}{$current.selected_derivative->get_url()|escape:\'url\'}{/if}'; 
     89  $title = '{$GALLERY_TITLE|escape:\'url\'}{" | "|escape:\'url\'}{$PAGE_TITLE|escape:\'url\'}{if $current->author}{" | by "|escape:\'url\'}{$current->author|escape:\'url\'}{/if}'; 
    8990  $content = '{$CONTENT_DESCRIPTION|urlencode}'; 
    90  
    91  
    9291 
    9392  $metadata[] = array( 
     
    9695    "title"       => "{'Share This'|@translate}", 
    9796    "content"     => '<span>{\'Share This:\'|@translate}</span>' 
    98                    . '{if $sharethis_facebook}' 
    99                       . '{html_head}<meta property="og:title" content="">{"\n"}' 
    100                        . '<meta property="og:type" content="article">{"\n"}' 
    101                        . '<meta property="og:url" content="{$CUR_PAGE}">{"\n"}' 
    102                        . '{if $current.selected_derivative}<meta property="og:image" content="{$U_HOME}/{$current.selected_derivative->get_url()}">{"\n"}{/if}' 
     97                       . '{html_head}<!-- START OPEN GRAPH TAGS-->{"\n"}' 
     98                       . '<meta property="og:title" content="{$GALLERY_TITLE} | {$PAGE_TITLE}{if $current->author} | by {$current->author}{/if}" />{"\n"}' 
     99                       . '<meta property="og:type" content="article" />{"\n"}' 
     100                       . '<meta property="og:url" content="{$CUR_PAGE}" />{"\n"}' 
     101                       . '{if $current.selected_derivative}<meta property="og:image" content="{$U_HOME}/{$current.selected_derivative->get_url()}" />{"\n"}{/if}' 
     102                       . '<meta property="og:description" content="{$CONTENT_DESCRIPTION}" />{"\n"}' 
     103                       . '<!-- END OPEN GRAPH TAGS-->{"\n"}'  
     104                       . '{if $sharethis_pinterest}<script type="text/javascript" async defer src="//assets.pinterest.com/js/pinit.js"></script>{/if}' 
    103105                       . '{/html_head}' 
    104                        . '<a href="http://www.facebook.com/sharer/sharer.php?p[title]=' . $title . '&amp;p[url]=' . $url . '{if $current.selected_derivative}&amp;p[images][0]=' . $image . '{/if}&amp;p[summary]=' . $content . '" onclick="window.open(this.href, \'\', \'toolbar=0,status=0,width=700,height=500\'); return false;" title="{\'Share on Facebook\'|@translate}" target="_blank"><i class="fa fa-facebook-square"></i> <span>{\'Facebook\'|@translate}</span></a>{/if}' 
    105                    . '{if $sharethis_pinterest}<a href="http://pinterest.com/pin/create/button/?url=' . $url . '" title="{\'Share on Pinterest\'|@translate}" target="_blank"><i class="fa fa-pinterest"></i> <span>{\'Pinterest\'|@translate}</span></a>{/if}' 
     106 
     107                   . '{if $sharethis_facebook}<a href="http://www.facebook.com/sharer/sharer.php?p[url]=' . $url . '{if $current.selected_derivative}&amp;p[images][0]=' . $image . '{/if}&amp;p[summary]=' . $content . '" onclick="window.open(this.href, \'\', \'toolbar=0,status=0,width=700,height=500\'); return false;" title="{\'Share on Facebook\'|@translate}" target="_blank"><i class="fa fa-facebook-square"></i> <span>{\'Facebook\'|@translate}</span></a>{/if}' 
     108                   . '{if $sharethis_pinterest}<a href="http://pinterest.com/pin/create/button/?url=' . $url . '&media=' . $image . '&description=' . $title . '" title="{\'Share on Pinterest\'|@translate}" target="_blank" data-pin-do="none" data-pin-config="none"><i class="fa fa-pinterest"></i> <span>{\'Pinterest\'|@translate}</span></a>{/if}' 
    106109                   . '{if $sharethis_twitter}<a href="https://twitter.com/intent/tweet?text=' . $title . '&url=' . $url .'" title="{\'Share on Twitter\'|@translate}" target="_blank"><i class="fa fa-twitter"></i> <span>{\'Twitter\'|@translate}</span></a>{/if}' 
    107                    . '{if $sharethis_googleplus}<a href="https://plus.google.com/share?url=' . $url . '" title="{\'Share on Google+\'|@translate}" target="_blank"><i class="fa fa-google-plus-square"></i> <span>{\'Google+\'|@translate}</span></a>{/if}', 
    108     "combine"     => '{combine_css id=\'fa\' path=$SHARETHIS_PATH|cat:"/css/font-awesome.min.css"}' 
     110                   . '{if $sharethis_googleplus}<a href="https://plus.google.com/share?url=' . $url . '" title="{\'Share on Google+\'|@translate}" target="_blank" onclick="javascript:window.open(this.href, \'\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600\');return false;"><i class="fa fa-google-plus-square"></i> <span>{\'Google+\'|@translate}</span></a>{/if}' 
     111                   . '{if $sharethis_tumblr}<a href="http://www.tumblr.com/share/photo?source=' . $image . '&caption=' . $title . '&click_thru=' . $url . '" title="{\'Share on Tumblr\'|@translate}" target="_blank"><i class="fa fa-tumblr"></i> <span>{\'Tumblr\'|@translate}</span></a>{/if}', 
     112 
     113    "combine"     => '{combine_css id=\'fa\' path=$SHARETHIS_PATH|cat:"/css/font-awesome.min.css"}'                                                                                                             
    109114                   . '{combine_css id=\'sharethis\' path=$SHARETHIS_PATH|cat:"/css/styles.css"}', 
    110115    "no_overlay"  => TRUE 
  • extensions/ShareThis/template/admin.tpl

    r31059 r31106  
    2222    <li><label><span class="graphicalCheckbox {if $INC_TWITTER}icon-check{else}icon-check-empty{/if}">&nbsp;</span><input name="inc_twitter" id="inc_twitter" type="checkbox" value="1" {if $INC_TWITTER}checked="checked"{/if}>{'Post to Twitter'|@translate}</label></li> 
    2323    <li><label><span class="graphicalCheckbox {if $INC_GOOGLEPLUS}icon-check{else}icon-check-empty{/if}">&nbsp;</span><input name="inc_googleplus" id="inc_googleplus" type="checkbox" value="1" {if $INC_GOOGLEPLUS}checked="checked"{/if}>{'Post to Google Plus'|@translate}</label></li> 
     24    <li><label><span class="graphicalCheckbox {if $INC_TUMBLR}icon-check{else}icon-check-empty{/if}">&nbsp;</span><input name="inc_tumblr" id="inc_tumblr" type="checkbox" value="1" {if $INC_TUMBLR}checked="checked"{/if}>{'Post to Tumblr'|@translate}</label></li> 
    2425  </ul> 
    2526</fieldset> 
Note: See TracChangeset for help on using the changeset viewer.