MyBB Community Forums

Full Version: Facebook Google+ Twitter share Button on Each Post w/o plugin (FontAwesome)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
(2018-04-22, 04:06 PM)shinemo Wrote: [ -> ]But Facebook always recommends using their official code. Check if any changes before using the codes above.

but who tells you these are not official codes ?
Thank you for this.
(2018-09-29, 11:37 PM)yafin Wrote: [ -> ]Thank you for this.

you are welcome Smile
Is possible to somehow add a dropdown menu for share? Click on share icon -> dropdown with Facebook/Twitter/post URL?
(2019-02-15, 08:51 PM)Eldenroot Wrote: [ -> ]Is possible to somehow add a dropdown menu for share? Click on share icon -> dropdown with Facebook/Twitter/post URL?


[Image: share.png]


You can use the edit posts drop down button like so.

Add this next to {$post['button_email']} in postbit + postbit_classic
<a href="share.php?pid={$post['pid']}" id="share_post_{$post['pid']}" title="Share Post" class="author_buttons  postbit_buttons  postbit_edit postbit_mirage"><span>Share</span></a>



Add this at the bottom of  postbit + postbit_classic
<div id="share_post_{$post['pid']}_popup" class="popup_menu" style="display: none;">

<div class="popup_item_container"><a class="popup_item" href="https://plus.google.com/share?url={$mybb->settings['bburl']}/{$post['postlink']}" 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" style="font-size:18px; color:#d34836"></i> Google Plus</a></div>


<div class="popup_item_container"><a class="popup_item" href="https://www.facebook.com/sharer/sharer.php?u={$mybb->settings['bburl']}/{$post['postlink']}" class="fb-share-button" onclick="javascript:window.open(this.href,  '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;"><i class="fa fa-facebook-square" style="font-size:18px;color:#3B5998"></i> Facebook </a></div>


<div class="popup_item_container"><a class="popup_item" href="https://twitter.com/intent/tweet?text={$thread['subject']} &url={$mybb->settings['bburl']}/{$post['postlink']}"onclick="javascript:window.open(this.href,'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;"><i class="fa fa-twitter-square" style="font-size:18px;color:#0084b4"></i> Twitter </a></div>

</div>

<script type="text/javascript">
// <!--
	if(use_xmlhttprequest == "1")
	{
		$("#share_post_{$post['pid']}").popupMenu();
	}
// -->
</script>
Thank you, I will try! +1
with the help of above codes by @iandrew 

[Image: hYzq9Hj]

https://imgur.com/hYzq9Hj


 i have made this if you want this type can paste little modification of codes here
Pages: 1 2 3