Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications

Reply
 
Thread Tools
Twitter And Facebook Integrated Buttons in Threads Details »»
Twitter And Facebook Integrated Buttons in Threads
Version: 1.01, by Boko577 Boko577 is offline
Developer Last Online: Nov 2011 Show Printable Version Email this Page

Category: Mini Mods - Version: 4.0.x Rating:
Released: 06-07-2010 Last Update: Never Installs: 36
Template Edits
Translations  
No support by the author.

First of all, I would like to give credit to the founders of the codes I used in this mod. I know almost nothing about coding and without them, this mod would have never existed.
Twitter Code Founder: https://vborg.vbsupport.ru/showthread.php?t=242425
Facebook Code Founder: https://vborg.vbsupport.ru/showthread.php?t=241011



What's better about my mod?
Doing two template edits is much quicker than making two advertisements. Another reason, is that both of these mods tell you to put the code as an advertisement. Although it's easier to do, it leaves an ugly blank space below the buttons that is just wasted. The way I implemented them in uses the space under the buttons.
Their mods:

My mods:

OR:




Demo this mod here!


How to Install
Add the following code at the top of the header template:
Code:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="http://tweet-it.s3.amazonaws.com/tweet-it.js"></script>

<script type="text/javascript">
	$(document).ready(function(){
		$(".tweet-this a").tweetIt({
			animate: "fade",
			header: "Tweet!"
		});
// Something else
			$("tr.openclose a").click(function(){ $(this).parents("tr").hide(); $("tr.closed").show(); });
	})
</script>
It seems to work when you put this code anywhere, but just to be safe, I would put it at the top.


If you want it here:

Find the following code in the postbit_legacy template:
Code:
{vb:raw ad_location.thread_first_post_content}
Add the following code below it:
Code:
<vb:if condition="THIS_SCRIPT == 'showthread'"><div style="float: right; padding: 0px 0px 0px 0px;"><p class="tweet-this"><p class="tweet-this"><a href="javascript://"><img src="http://nextgendaily.com/images/retweet.png" /> Tweet Topic!</a></p>
<iframe src="http://www.facebook.com/plugins/like.php?href=http://www.YOURSITE.com/{vb:link thread, {vb:raw thread}}&amp;layout=button_count&amp;show_faces=false&amp;width=80&amp;action=like&amp;font=tahoma&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:80px; height:25px"></iframe></div>
</vb:if>
Make sure to change http://www.YOURSITE.com/ to your link! If you don't use www like me, delete it. You can also change the code Tweet Topic! to whatever you would like the Twitter button to say.


If you want it here:

Find the following code in the SHOWTHREAD template:
Code:
	<div id="thread_controls" class="thread_controls">
		<div>
Add the following code below it:
Code:
<vb:if condition="THIS_SCRIPT == 'showthread'"><iframe src="http://www.facebook.com/plugins/like.php?href=http://nextgendaily.com/{vb:link thread, {vb:raw thread}}&amp;layout=button_count&amp;show_faces=false&amp;width=80&amp;action=like&amp;font=tahoma&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:80px; height:25px"></iframe><div style="float: left; padding: 0px 5px 0px 5px;"><p class="tweet-this"><p class="tweet-this"><a href="javascript://"><img src="http://nextgendaily.com/images/retweet.png" /> Tweet Topic!</a></p></div></vb:if>
If someone can help me with this code it would be much appreciated. I was able to put both buttons on the same line, but it still makes the gray bar longer. If someone can find a way to shorten the gray bar back, I'll put your code here instead.



Again, I take no credit for finding the code used in this mod, however, I did make some changes to it and moved the code to a different area to add more flexibility. If you have any way to increase the code or fix a flaw I might have made, please leave a comment with the code below and I'll change this code right away.

PLEASE MARK AS INSTALLED IF YOU USE THIS

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 06-08-2010, 07:21 AM
sweetguy2004's Avatar
sweetguy2004 sweetguy2004 is offline
 
Join Date: Feb 2007
Location: uk
Posts: 117
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

can we use this in 3.8? please reply
Reply With Quote
  #3  
Old 06-08-2010, 01:33 PM
schlottkej schlottkej is offline
 
Join Date: Apr 2007
Posts: 226
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by sweetguy2004 View Post
can we use this in 3.8? please reply
Yeah, you can, but it won't be in the same parts of the templates because they dont exist and youll need to change the way the conditionals are written to that of 3.8
Reply With Quote
  #4  
Old 06-08-2010, 01:36 PM
prof3ta prof3ta is offline
 
Join Date: Jan 2005
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

wondering the same. Can we use it in 3.8?

Edit: Just read the reply. Itd be great if you could really quickly add the new conditionals for 3.8!
Reply With Quote
  #5  
Old 06-08-2010, 05:57 PM
puppetmaster222 puppetmaster222 is offline
 
Join Date: Aug 2006
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks I "like" this version of the mod and am using it now.
Reply With Quote
  #6  
Old 06-08-2010, 06:57 PM
MichelangeloITA's Avatar
MichelangeloITA MichelangeloITA is offline
 
Join Date: Dec 2009
Location: Italy, Rimini
Posts: 58
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very good, man

Is it possible to set it on every single post/blog/CMS article? :P

EDIT: Some issue with quote text

Reply With Quote
  #7  
Old 06-09-2010, 11:12 PM
Boko577's Avatar
Boko577 Boko577 is offline
 
Join Date: Dec 2009
Posts: 122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MichelangeloITA View Post
Very good, man

Is it possible to set it on every single post/blog/CMS article? :P

EDIT: Some issue with quote text

I see... You can now check back and see that there is a new option to add the buttons to the gray bar above the post. This will fix the quote problem, but move the button positions. You may like it more though anyways. Instead of installing the first option, install the second.
Reply With Quote
  #8  
Old 06-13-2010, 01:36 AM
CRDeveloper's Avatar
CRDeveloper CRDeveloper is offline
 
Join Date: Aug 2009
Location: Costa Rica
Posts: 95
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello!

Thanks for the mod!

I added it inside a table to look like this

http://is.gd/cNftT

This is the code:

Code:
<vb:if condition="THIS_SCRIPT == 'showthread'">
<table width="170" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <th scope="col"><iframe src="http://www.facebook.com/plugins/like.php?href=http://nextgendaily.com/{vb:link thread, {vb:raw thread}}&amp;layout=button_count&amp;show_faces=false&amp;width=80&amp;action=like&amp;font=tahoma&amp;colorscheme=light" 
    scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:80px; height:20px"></iframe></th>
    <th scope="col">
    <p class="tweet-this"><a href="javascript://"><img src="http://nextgendaily.com/images/retweet.png" /> Tweet Topic!</a></p>
    </th>
  </tr>
</table>
</vb:if>
I fount that this is repeated twice, i removed but should be like that?
Code:
<p class="tweet-this">
Reply With Quote
  #9  
Old 06-16-2010, 04:43 PM
aspen1018 aspen1018 is offline
 
Join Date: May 2007
Posts: 73
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

works great

Thank you
Reply With Quote
  #10  
Old 06-16-2010, 09:54 PM
Xencored Xencored is offline
 
Join Date: Sep 2008
Location: UK, Scuny
Posts: 1,337
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm dont work for me the pop up box from twitter pops up for like 1 sec than goes away
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:05 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.07078 seconds
  • Memory Usage 2,318KB
  • Queries Executed 24 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (7)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete