Instantly share code, notes, and snippets.
Created
January 21, 2015 14:05
-
Star
0
(0)
You must be signed in to star a gist -
Fork
0
(0)
You must be signed in to fork a gist
-
Save imrehg/533932bd556843e28eab to your computer and use it in GitHub Desktop.
Simple Share Button Adder patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- simple-share-buttons-adder.php.old 2015-01-21 22:00:10.795372823 +0800 | |
+++ simple-share-buttons-adder.php 2015-01-21 22:03:49.304790517 +0800 | |
@@ -904,7 +904,7 @@ | |
function ssba_facebook($arrSettings, $urlCurrentPage, $strPageTitle, $booShowShareCount) { | |
// facebook share link | |
- $htmlShareButtons = '<a class="ssba_facebook_share" href="http://www.facebook.com/sharer.php?u=' . $urlCurrentPage . '" ' . ($arrSettings['ssba_share_new_window'] == 'Y' ? ' target="_blank" ' : NULL) . ($arrSettings['ssba_rel_nofollow'] == 'Y' ? ' rel="nofollow"' : NULL) .'>'; | |
+ $htmlShareButtons = '<a class="ssba_facebook_share ssba_share_link" href="http://www.facebook.com/sharer.php?u=' . $urlCurrentPage . '" ' . ($arrSettings['ssba_share_new_window'] == 'Y' ? ' target="_blank" ' : NULL) . ($arrSettings['ssba_rel_nofollow'] == 'Y' ? ' rel="nofollow"' : NULL) .'>'; | |
// if not using custom | |
if ($arrSettings['ssba_image_set'] != 'custom') { | |
@@ -950,7 +950,7 @@ | |
$twitterShareText = urlencode(html_entity_decode($strPageTitle . ' ' . $arrSettings['ssba_twitter_text'], ENT_COMPAT, 'UTF-8')); | |
// twitter share link | |
- $htmlShareButtons = '<a class="ssba_twitter_share" href="http://twitter.com/share?url=' . $urlCurrentPage . '&text=' . $twitterShareText . '" ' . ($arrSettings['ssba_share_new_window'] == 'Y' ? ' target="_blank" ' : NULL) . ($arrSettings['ssba_rel_nofollow'] == 'Y' ? ' rel="nofollow"' : NULL) . '>'; | |
+ $htmlShareButtons = '<a class="ssba_twitter_share ssba_share_link" href="http://twitter.com/share?url=' . $urlCurrentPage . '&text=' . $twitterShareText . '" ' . ($arrSettings['ssba_share_new_window'] == 'Y' ? ' target="_blank" ' : NULL) . ($arrSettings['ssba_rel_nofollow'] == 'Y' ? ' rel="nofollow"' : NULL) . '>'; | |
// if image set is not custom | |
if ($arrSettings['ssba_image_set'] != 'custom') { | |
@@ -993,7 +993,7 @@ | |
function ssba_google($arrSettings, $urlCurrentPage, $strPageTitle, $booShowShareCount) { | |
// google share link | |
- $htmlShareButtons = '<a class="ssba_google_share" href="https://plus.google.com/share?url=' . $urlCurrentPage . '" ' . ($arrSettings['ssba_share_new_window'] == 'Y' ? ' target="_blank" ' : NULL) . ($arrSettings['ssba_rel_nofollow'] == 'Y' ? ' rel="nofollow" ' : NULL) . '>'; | |
+ $htmlShareButtons = '<a class="ssba_google_share ssba_share_link" href="https://plus.google.com/share?url=' . $urlCurrentPage . '" ' . ($arrSettings['ssba_share_new_window'] == 'Y' ? ' target="_blank" ' : NULL) . ($arrSettings['ssba_rel_nofollow'] == 'Y' ? ' rel="nofollow" ' : NULL) . '>'; | |
// if image set is not custom | |
if ($arrSettings['ssba_image_set'] != 'custom') { | |
@@ -1095,7 +1095,7 @@ | |
function ssba_reddit($arrSettings, $urlCurrentPage, $strPageTitle, $booShowShareCount) { | |
// reddit share link | |
- $htmlShareButtons = '<a class="ssba_reddit_share" href="http://reddit.com/submit?url=' . $urlCurrentPage . '&title=' . $strPageTitle . '" ' . ($arrSettings['ssba_share_new_window'] == 'Y' ? ' target="_blank" ' : NULL) . ($arrSettings['ssba_rel_nofollow'] == 'Y' ? ' rel="nofollow" ' : NULL) . '>'; | |
+ $htmlShareButtons = '<a class="ssba_reddit_share ssba_share_link" href="http://reddit.com/submit?url=' . $urlCurrentPage . '&title=' . $strPageTitle . '" ' . ($arrSettings['ssba_share_new_window'] == 'Y' ? ' target="_blank" ' : NULL) . ($arrSettings['ssba_rel_nofollow'] == 'Y' ? ' rel="nofollow" ' : NULL) . '>'; | |
// if image set is not custom | |
if ($arrSettings['ssba_image_set'] != 'custom') { | |
@@ -1208,7 +1208,7 @@ | |
else | |
{ | |
// use the choice of pinnable images approach | |
- $htmlShareButtons = "<a class='ssba_pinterest_share' href='javascript:void((function()%7Bvar%20e=document.createElement('script');e.setAttribute('type','text/javascript');e.setAttribute('charset','UTF-8');e.setAttribute('src','//assets.pinterest.com/js/pinmarklet.js?r='+Math.random()*99999999);document.body.appendChild(e)%7D)());'>"; | |
+ $htmlShareButtons = "<a class='ssba_pinterest_share ssba_share_link' href='javascript:void((function()%7Bvar%20e=document.createElement('script');e.setAttribute('type','text/javascript');e.setAttribute('charset','UTF-8');e.setAttribute('src','//assets.pinterest.com/js/pinmarklet.js?r='+Math.random()*99999999);document.body.appendChild(e)%7D)());'>"; | |
} | |
// if image set is not custom | |
@@ -1297,7 +1297,7 @@ | |
function ssba_email($arrSettings, $urlCurrentPage, $strPageTitle, $booShowShareCount) { | |
// email share link | |
- $htmlShareButtons = '<a class="ssba_email_share" href="mailto:?Subject=' . $strPageTitle . '&Body=' . $arrSettings['ssba_email_message'] . '%20' . $urlCurrentPage . '">'; | |
+ $htmlShareButtons = '<a class="ssba_email_share ssba_share_link" href="mailto:?Subject=' . $strPageTitle . '&Body=' . $arrSettings['ssba_email_message'] . '%20' . $urlCurrentPage . '">'; | |
// if image set is not custom | |
if ($arrSettings['ssba_image_set'] != 'custom') { | |
@@ -1331,7 +1331,7 @@ | |
} | |
// flattr share link | |
- $htmlShareButtons = '<a class="ssba_flattr_share" href="https://flattr.com/submit/auto?user_id=' . $arrSettings['ssba_flattr_user_id'] . '&title=' . $strPageTitle . '&url=' . $urlCurrentPage . '" ' . ($arrSettings['ssba_share_new_window'] == 'Y' ? ' target="_blank" ' : NULL) . ($arrSettings['ssba_rel_nofollow'] == 'Y' ? ' rel="nofollow" ' : NULL) . '>'; | |
+ $htmlShareButtons = '<a class="ssba_flattr_share ssba_share_link" href="https://flattr.com/submit/auto?user_id=' . $arrSettings['ssba_flattr_user_id'] . '&title=' . $strPageTitle . '&url=' . $urlCurrentPage . '" ' . ($arrSettings['ssba_share_new_window'] == 'Y' ? ' target="_blank" ' : NULL) . ($arrSettings['ssba_rel_nofollow'] == 'Y' ? ' rel="nofollow" ' : NULL) . '>'; | |
// if image set is not custom | |
if ($arrSettings['ssba_image_set'] != 'custom') { | |
@@ -1358,7 +1358,7 @@ | |
function ssba_buffer($arrSettings, $urlCurrentPage, $strPageTitle, $booShowShareCount) { | |
// buffer share link | |
- $htmlShareButtons = '<a class="ssba_buffer_share" href="https://bufferapp.com/add?url=' . $urlCurrentPage . '&text=' . ($arrSettings['ssba_buffer_text'] != '' ? $arrSettings['ssba_buffer_text'] : NULL) . ' ' . $strPageTitle . '" ' . ($arrSettings['ssba_share_new_window'] == 'Y' ? ' target="_blank" ' : NULL) . ($arrSettings['ssba_rel_nofollow'] == 'Y' ? ' rel="nofollow" ' : NULL) . '>'; | |
+ $htmlShareButtons = '<a class="ssba_buffer_share ssba_share_link" href="https://bufferapp.com/add?url=' . $urlCurrentPage . '&text=' . ($arrSettings['ssba_buffer_text'] != '' ? $arrSettings['ssba_buffer_text'] : NULL) . ' ' . $strPageTitle . '" ' . ($arrSettings['ssba_share_new_window'] == 'Y' ? ' target="_blank" ' : NULL) . ($arrSettings['ssba_rel_nofollow'] == 'Y' ? ' rel="nofollow" ' : NULL) . '>'; | |
// if image set is not custom | |
if ($arrSettings['ssba_image_set'] != 'custom') { | |
@@ -1399,7 +1399,7 @@ | |
$urlCurrentPage = str_replace("http://", '', $urlCurrentPage); | |
// tumblr share link | |
- $htmlShareButtons = '<a class="ssba_tumblr_share" href="http://www.tumblr.com/share/link?url=' . $urlCurrentPage . '&name=' . $strPageTitle . '" ' . ($arrSettings['ssba_share_new_window'] == 'Y' ? ' target="_blank" ' : NULL) . ($arrSettings['ssba_rel_nofollow'] == 'Y' ? ' rel="nofollow" ' : NULL) . '>'; | |
+ $htmlShareButtons = '<a class="ssba_tumblr_share ssba_share_link" href="http://www.tumblr.com/share/link?url=' . $urlCurrentPage . '&name=' . $strPageTitle . '" ' . ($arrSettings['ssba_share_new_window'] == 'Y' ? ' target="_blank" ' : NULL) . ($arrSettings['ssba_rel_nofollow'] == 'Y' ? ' rel="nofollow" ' : NULL) . '>'; | |
// if image set is not custom | |
if ($arrSettings['ssba_image_set'] != 'custom') { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment