The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Twitter - Tweet Button in SHOWTHREAD Details »» | |||||||||||||||||||||||||||||||||
Twitter - Tweet Button in SHOWTHREAD
Developer Last Online: Aug 2023
Twitter released their new TWEET button.
Live Demo: http://www.juot.net/forums/showthread.php?t=41185 (Update I have for the time being replaced the Tweet button with the Add This share button on my live forum. See the screen shots instead.) I have tested this in latest versions of IE / Firefox / Chrome / Opera / Safari. This will show you how to add this simple code to your SHOWTHREAD template below the page navigation bar, if visible. Go to the Admin CP -> Styles & Templates -> Style Manager Edit your SHOWTHREAD Template Find: Code:
<if condition="$show['pagenav']"><td align="$stylevar[right]">$pagenav</td></if> Code:
<td align="$stylevar[right]"><if condition="$show['pagenav']">$pagenav</if> <if condition="!in_array($GLOBALS[forumid], array(X, Y, Z))"> <table border="0"> <tr><td> <a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="YOUR_TWITTER_USERNAME">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script> </td></tr></table> </if> </td> Valid Examples: <if condition="!in_array($GLOBALS[forumid], array(2, 5, 9))"> <if condition="!in_array($GLOBALS[forumid], array(7))"> <if condition="!in_array($GLOBALS[forumid], array(2, 3, 4, 5, 6, 7, 8))"> If none of your forums are private or you want to enable this in every forum you can remove the lines: Code:
<if condition="!in_array($GLOBALS[forumid], array(X, Y, Z))"> and </if> (The second one) When you hit the Tweet button you will be given a box to type a message if you're logged in. If you're not logged in you will be asked to login or join, all within the pop-up window. This button code will count the number of tweets people have made using it. I will add more options in later posts. Note- My Screenshot also has the Facebook Like button available as a separate mod here by someone else. If you don't have the facebook like button your Tweet button will be on the right of the page. There is also a basic skin screen shot. Please click Install if you use this. NEW UPDATE!!! Use this code instead it will force the correct URL to Twitter and solve the issue with a different URL being tweeted if thread is tweeted as soon as it's posted. Code:
<td align="$stylevar[right]"><if condition="$show['pagenav']">$pagenav</if> <if condition="!in_array($GLOBALS[forumid], array(X, Y, Z))"> <table border="0"> <tr><td> <a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="YOUR_TWITTER_USERNAME" data-url="$vboptions[bburl]/showthread.php?t=$thread[threadid]">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script> </td></tr></table> </if> </td> Download Now
Screenshots
Show Your Support
|
Благодарность от: | ||
mary_rose082198 |
Comments |
#32
|
||||
|
||||
Quote:
Code:
<!-- controls above postbits --> <table cellpadding="0" cellspacing="0" border="0" width="100%" style="margin-bottom:3px"> <tr valign="bottom"> <if condition="$show['largereplybutton']"> <td class="smallfont"><a href="newreply.php?$session[sessionurl]do=newreply&noquote=1&p=$FIRSTPOSTID" rel="nofollow"><if condition="$show['closethread']"><img src="$stylevar[imgdir_button]/reply.gif" alt="$vbphrase[reply]" border="0" /><else /><img src="$stylevar[imgdir_button]/threadclosed.gif" alt="$vbphrase[closed_thread]" border="0" /></if></a></td> <else /> <td class="smallfont"> </td> </if> <td align="$stylevar[right]"><if condition="$show['pagenav']">$pagenav</if> <if condition="!in_array($GLOBALS[forumid], array(2, 3, 6, 15, 23, 24, 45, 51))"> <table border="0"> <tr><td><div style="padding-bottom:8px;"> <a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="Billyne">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div> </td><td> <iframe src="http://www.facebook.com/plugins/like.php?href=http://www.nailtechalley.com/forums/showthread.php$session[sessionurl]?t=$threadid" &show_faces=false&width=350&action=like&colorscheme=dark&height=30" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:350px; height:30px;" allowTransparency="true"></iframe> </td></tr></table> </if> </td> </tr> </table> <!-- / controls above postbits --> |
#33
|
||||
|
||||
Quote:
Unfortunately the error you're getting in your main pc sounds like an issue local to your system- I'd recommend upgrading to the latest IE... It's also possible firewall or anti-malware software you may be running is blocking part of the script and causing the error- it could be anything. Quote:
If you want to try, experiment with putting the twitter code before the line: Code:
<td align="$stylevar[right]"><if condition="$show['pagenav']">$pagenav</if> |
#34
|
||||
|
||||
I've added updated code to the first post that will fix the counter issue/wrong URL issue.
|
#35
|
||||
|
||||
thanks!
|
#36
|
||||
|
||||
Hi.
How do I place the tweet button beside the page navigation? (so that [tweet button] [page navigation]) |
#37
|
||||
|
||||
I never really tried that but I'll play with it and let you know.
|
#38
|
||||
|
||||
OK for Next to the Page Nav menu do the following.
In SHOWTHREAD find the line: Code:
<if condition="$show['pagenav']"><td align="$stylevar[right]">$pagenav</td></if> Code:
<td align="$stylevar[right]"> <table border="0" width="1%" align="right"><tr><td align="right"> <if condition="!in_array($GLOBALS[forumid], array(X, Y, Z))"><a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="YOUR_TWITTER_USERNAME">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script><else /> </if></td><td align="right"><if condition="$show['pagenav']">$pagenav<else /> </if> </td></tr></table> </td> |
#39
|
||||
|
||||
Very awesome. Thank you very much, BirdOPrey.
|
#40
|
|||
|
|||
BirdOPrey, I really wanna get that facebook LIKE link next to the Twitter one, and placed where you have them because those are the best spots IMO, I have the Twitter one in place but not sure what coding needs to be placed to do so.
|
#41
|
||||
|
||||
Quote:
Code:
<td align="$stylevar[right]"><if condition="$show['pagenav']">$pagenav</if> <if condition="!in_array($GLOBALS[forumid], array(2, 3, 6, 15, 23, 24, 45, 51))"> <table border="0"> <tr><td><![if !IE]><div style="padding-bottom:1px;"><![endif]><!--[if IE]><div style="padding-bottom:18px;"><![endif]--> <a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="JUOTnet" data-url="$vboptions[bburl]/showthread.php?t=$thread[threadid]">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div> </td><td> <p>FACEBOOK LIKE CODE HERE</p> </td></tr></table> </if> </td> You'll have to customize the forumids and the twitter specifics and add your facebook like code to "FACEBOOK LIKE CODE HERE" but it will look good. :up: |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|