vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=236)
-   -   Show Thread Enhancements - Twitter - Tweet Button in SHOWTHREAD (https://vborg.vbsupport.ru/showthread.php?t=248568)

BirdOPrey5 10-08-2010 01:19 PM

Quote:

Originally Posted by chocolate angel (Post 2107995)
hi. thank you so much for posting this.

i just installed this and i am trying to get the twitter button beside my fb button..here is my code. what did i do wrong? thanks :)


<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>
</td></td>
<iframe src="http://www.facebook.com/plugins/like.php?href=http://www.nailtechalley.com/forums/showthread.php$session[sessionurl]?t=$threadid" &amp;show_faces=false&amp;width=350&amp;action=lik e&amp;colorscheme=dark&amp;height=30" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:350px; height:30px;" allowTransparency="true"></iframe>
</td></tr></table>
</if>
</td>
<!-- / controls above postbits -->

There's a couple things that need to be moved and your IF statement seems in the wrong place though you didn't post the beginning of it - so I'm giving you all the code between <!-- controls above postbits --> and <!-- /controls above postbits --> you can see where yours is different an change it... You just need to update the IF statement to exclude the forumid's of your forums you don't want to show either button for.

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&amp;noquote=1&amp;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">&nbsp;</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" &amp;show_faces=false&amp;width=350&amp;action=like&amp;colorscheme=dark&amp;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 -->

Please backup your original template to a text file before changing just in case something goes wrong.

BirdOPrey5 10-08-2010 01:29 PM

Quote:

Originally Posted by astdirect (Post 2108007)
@birdofprey - iget that error when the tweet page pops up. I tried on laptop and i dont get that error, only on my main pc. Main PC is running XP and IE7 and laptop is running Vista and IE8. Not sure if thats anything to do with it.

Tweet button now counting tweets though after i moved it from postbit_legacy to showthread.

Brilliant addition !!

Glaf your counter is working. It's much better in showthread because in postbit it will show up per post but as-is it won't tweet each post just the entire page/thread so it would get confusing to people anyway.

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:

Originally Posted by Hagalepues (Post 2108020)
I do not understand why the button is down the pages.

How do I place above them?

Image:

http://img651.imageshack.us/img651/1530/sinttulo1co.png

It's below the page navigation because that's where I wanted it. You can move it above the page navigation by changing the location of the template edit.

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>
You might need to align it or whatnot but no reason it shouldn't work.

BirdOPrey5 10-08-2010 09:06 PM

I've added updated code to the first post that will fix the counter issue/wrong URL issue.

chocolate angel 10-12-2010 03:34 AM

thanks!

Tanapangarap 10-17-2010 10:04 PM

Hi.

How do I place the tweet button beside the page navigation? (so that [tweet button] [page navigation])

BirdOPrey5 10-18-2010 12:54 AM

I never really tried that but I'll play with it and let you know.

BirdOPrey5 10-18-2010 01:20 AM

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>
And Replace with:
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 />&nbsp;</if></td><td align="right"><if condition="$show['pagenav']">$pagenav<else />&nbsp;</if>
</td></tr></table>
</td>

Follow all the other instructions in the top post including changing "X, Y. Z" to forumids of forums you don't want to show the TWEET button in and replacing YOUR_TWITTER_USERNAME with your twitter username.

Tanapangarap 10-18-2010 03:00 AM

Very awesome. Thank you very much, BirdOPrey.

DJDynasty239 01-12-2011 06:54 PM

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.

BirdOPrey5 01-12-2011 08:49 PM

1 Attachment(s)
Quote:

Originally Posted by DJDynasty239 (Post 2148155)
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.

This is my code for both the twitter and facebook button like in the screen shot:

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>

Actually it looks even better than the screen shot, I managed to get them lined up properly.

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:


All times are GMT. The time now is 10:22 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01100 seconds
  • Memory Usage 1,757KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete