PDA

View Full Version : Twitter Like Button


Bob_R
01-03-2013, 04:07 PM
I was advised at vbulletin.com https://www.vbulletin.com/forum/showthread.php/414599-Facebook-Like-button to ask over here.

So, here goes.

I'd like a Twitter Like button on the top of SHOWTHREAD and would like it to function just like my Facebook Like button does.

In other words the button doesn't show in private forums.

How can this be done?

Thanks!!

Brandon Sheley
01-03-2013, 04:22 PM
That link doesn't work for me..
but.. I had added my social networking buttons in one of the ad_location templates, I think it was ad_location_above_forum or something like that.
Just past the "tweet me" button code in there, you can add google plus and facebook if you want as well.
You can add if conditions around the code to prevent them from showing in forums you wish.

Bob_R
01-03-2013, 04:51 PM
FYI: Fixed link

Brandon, I'd like it exactly where vBulletin places the Facebook Like button (next to it obviously).

I have the code to render it, what I really just need is help with the code to exclude the certain forums (which the Facebook Like button just does by default for lack of a better word).

Brandon Sheley
01-03-2013, 08:29 PM
FYI: Fixed link

Brandon, I'd like it exactly where vBulletin places the Facebook Like button (next to it obviously).

I have the code to render it, what I really just need is help with the code to exclude the certain forums (which the Facebook Like button just does by default for lack of a better word).

I don't exactly remember where vbulletin has those located, are they under the post or above?
Either way I don't think there is a hook for it, I'd poke around the showthread template and see if you can find the facebook code, place it under that.

Bob_R
01-03-2013, 08:41 PM
Thanks.

All I need is code to exclude certain forums. The Facebook Like automatically doesn't appear in private forums. Which to have the same for Twitter.

FYI: Facebook code doesn't have the code, it's done automatically (for lack of a better word).

Brandon Sheley
01-03-2013, 09:41 PM
Thanks.

All I need is code to exclude certain forums. The Facebook Like automatically doesn't appear in private forums. Which to have the same for Twitter.



Here you go :)

https://vborg.vbsupport.ru/showthread.php?t=231525

karnevil
10-24-2013, 10:02 AM
I've just done this, and used the same conditional as on the facebook like...as they will only want to show together. May be a bit simplistic but works perfectly.

<vb:if condition="$show['fb_likebutton']">
{vb:raw fblikebutton}
</vb:if>



<vb:if condition="$show['fb_likebutton']">

<a href="https://twitter.com/share" class="twitter-share-button" data-via="LegalBeagles">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementB yId(id)){js=d.createElement(s);js.id=id;js.src=p+' ://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}} (document, 'script', 'twitter-wjs');</script>

</vb:if>