Post by mastiffman on Nov 5, 2015 22:06:18 GMT -8
Hey everyone.
Loving the forum creation life!
Was wonding if anyone knew of a plugin for social media post share buttons?
Is this possible? I think that would really set things up for attraction to site life while still making people feel that they are "plugged in" (pun intended~) to social sites...
I started this thread to find out if anyone had accomplished this. I didn't really get a response tot he thread and started researching this on my own.
This is what I found. Facebook buttons can be added to you proboards.com forums fairly easily. It took me a bit of playing around with the coding from a couple of sources, but after finding the facebook developers page, I easily found the foundation of the coding that I needed.
To keep it simple for everyone I will just give the steps, codes and area to place them.
1. Go to the Facebook Developer Plugins page and select either "Share Button" or "Likes Button" on the left of the page. If you want them both, you can select the "Like Button" and then scroll down to the "like button configurator" section and check the box that will "Include share button".
2. Put your forum address in the "URL to like" box, Select your referred button type in the "Layout" dropdown window and put a check or uncheck the box depending on whether or not you want your friends icons posted when they use the buttons.
3. Click on the "Get Code" button and a window will pop up (Leave that window open to go back and copy the button code) with the Below code that you will need to add to your forums "wrapper" code. Navigate to "Admin home> Themes> Layout Template> Wrapper" and add the below code after the initial "<body>" value and then save the theme.
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.5";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
4. Next, if you simply want to add these buttons to your forums home page, navigate to either your Global header (FB buttons at the top of every page) or Main header (FB buttons only on home page) via this path "Admin home> Structure> Headers & Footers> Manage" Chose either/ or and place the following code before or after any code you have there already, if any and save the theme. You'll then have the buttons on your forum!
<div class="fb-like" data-href="YOUR-SITE-URL.HERE" data-layout="button_count" data-action="like" data-show-faces="false" data-share="true"></div>
Now if you want to take it step further and add these buttons to you boards, threads or even posts... Continue on...
5. Boards= Navigate to "Admin home> Themes> Layout Template> Board" and place the above code after "<h1>$[board.display_name]</h1>
</div>" and save your theme.
6. Threads= Navigate to "Admin home> Themes> Layout Template> Thread" and place the above code after "<h1>$[thread.subject]</h1>
</div>" and save your theme.
7. Posts= Navigate to "Admin home> Themes> Layout Template> Thread> Post List" and place the below code after "<span class="date">$[post.created_on]" and before the "</span>" and then save your theme...
<div class="fb-share-button" data-href="$[thread.link.href]" data-layout="button_count"></div>
<div class="fb-like" data-href="$[thread.link.href]" data-layout="button_count" data-action="like" data-show-faces="false" data-share="false"></div>
Anyway, I hope that this helps many of you out to incorporate facebook buttons onto your sites like it did with me. I will most likely be finding the code for twitter as well.