function ssba_reddit($arrSettings, $urlCurrentPage, $strPageTitle, $booShowShareCount) { // reddit share link $htmlShareButtons = '<a data-site="reddit" 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) . '>'; // if image set is not custom if ($arrSettings['ssba_image_set'] != 'custom') { // show ssba image $htmlShareButtons .= '<img src="' . plugins_url() . '/simple-share-buttons-adder/buttons/' . $arrSettings['ssba_image_set'] . '/reddit.png" title="Reddit" class="ssba ssba-img" alt="Share on Reddit" />'; } else { // show custom image $htmlShareButtons .= '<img src="' . $arrSettings['ssba_custom_reddit'] . '" title="Reddit" class="ssba ssba-img" alt="Share on Reddit" />'; } // close href $htmlShareButtons .= '</a>'; // if show share count is set to Y if ($arrSettings['ssba_show_share_count'] == 'Y' && $booShowShareCount == true) { // get and display share count $htmlShareButtons .= '<span class="ssba_sharecount">' . getRedditShareCount($urlCurrentPage) . '</span>'; // add to our db updateSharedCount('reddit', $urlCurrentPage); } // return share buttons return $htmlShareButtons; }
/** * Create Reddit Share Button **/ function sssp_reddit($arrSettings, $urlCurrentPage, $strPageTitle, $booShowShareCount) { $var_btn_cls = $booShowShareCount ? 's3d reddit' : 's3d reddit no-counter'; $htmlShareButtons = '<a class="' . $var_btn_cls . '" href="http://reddit.com/submit?url=' . $urlCurrentPage . '&title=' . $strPageTitle . '" ' . ($arrSettings['sssp_share_new_window'] == 'yes' ? ' target="_blank" ' : NULL) . ($arrSettings['sssp_rel_nofollow'] == 'yes' ? ' rel="nofollow" ' : NULL) . '>'; $htmlShareButtons .= '<span><i class="fa fa-reddit"></i></span>'; if ($booShowShareCount) { $htmlShareButtons .= '<span class="counter">' . number_format(getRedditShareCount($urlCurrentPage)) . '</span>'; } $htmlShareButtons .= '</a>'; return $htmlShareButtons; }
function ssba_reddit($arrSettings, $urlCurrentPage, $strPageTitle, $booShowShareCount) { // reddit share link $htmlShareButtons .= '<a id="ssba_reddit_share" href="http://reddit.com/submit?url=' . $urlCurrentPage . '&title=' . $strPageTitle . '" ' . ($arrSettings['ssba_share_new_window'] == 'Y' ? 'target="_blank"' : NULL) . '>'; // if image set is not custom if ($arrSettings['ssba_image_set'] != 'custom') { // show ssba image $htmlShareButtons .= '<img title="Reddit" class="ssba" alt="Reddit" src="' . WP_PLUGIN_URL . '/simple-share-buttons-adder/buttons/' . $arrSettings['ssba_image_set'] . '/reddit.png" />'; } else { // show custom image $htmlShareButtons .= '<img title="Reddit" class="ssba" src="' . $arrSettings['ssba_custom_reddit'] . '" alt="Reddit" />'; } // close href $htmlShareButtons .= '</a>'; // if show share count is set to Y if ($arrSettings['ssba_show_share_count'] == 'Y' && $booShowShareCount == true) { // get and display share count $htmlShareButtons .= '<span class="ssba_sharecount">' . getRedditShareCount($urlCurrentPage) . '</span>'; } // return share buttons return $htmlShareButtons; }
} ?> <?php } ?> </div> <h1 class="story-title"><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h1> <ul class="nav nav-align-right nav-interative-social"> <li class="hidden-xs social-share-count"><span><?php echo getRedditShareCount(get_permalink()) + getPinterestShareCount(get_permalink()) + getTwitterShareCount(get_permalink()) + getFacebookShareCount(get_permalink()); ?> </span> <b>Shares</b></li> <li class="social-fb"><a href="https://www.facebook.com/sharer/sharer.php?u=<?php the_permalink(); ?> " target='_blank'><span class="fa fa-facebook"></span><span class="hidden-xs"> like</span></a></li> <li class="social-twitter"><a href="https://twitter.com/intent/tweet?url=<?php the_permalink(); ?> " target='_blank'><span class="fa fa-twitter"></span><span class="hidden-xs"> tweet</span></a></li> <li class="social-reddit"><a href="http://www.reddit.com/submit?url=<?php the_permalink(); ?> " target='_blank'><span class="fa fa-reddit"></span><span class="hidden-xs"> submit</span></a></li> <li class="social-pinterest"><a href="http://www.pinterest.com/pin/create/button/?url=<?php