vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Mini Mods - Twitter And Facebook Integrated Buttons in Threads (https://vborg.vbsupport.ru/showthread.php?t=244184)

Boko577 06-07-2010 10:00 PM

Twitter And Facebook Integrated Buttons in Threads
 
1 Attachment(s)
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:
https://vborg.vbsupport.ru/
My mods:
https://vborg.vbsupport.ru/
OR:
http://grab.by/grabs/1c1ff87de5c278d...a4247c9c7c.png



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: http://grab.by/grabs/1fcdca37499a53e...68fb0ba8fc.png

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: http://grab.by/grabs/fe0f57a8080df6c...abf83ef307.png

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

sweetguy2004 06-08-2010 07:21 AM

can we use this in 3.8? please reply

schlottkej 06-08-2010 01:33 PM

Quote:

Originally Posted by sweetguy2004 (Post 2050306)
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

prof3ta 06-08-2010 01:36 PM

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!

puppetmaster222 06-08-2010 05:57 PM

thanks I "like" this version of the mod and am using it now. ;)

MichelangeloITA 06-08-2010 06:57 PM

Very good, man ;)

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

EDIT: Some issue with quote text

https://vborg.vbsupport.ru/external/2010/06/66.jpg

Boko577 06-09-2010 11:12 PM

Quote:

Originally Posted by MichelangeloITA (Post 2050632)
Very good, man ;)

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

EDIT: Some issue with quote text

https://vborg.vbsupport.ru/external/2010/06/66.jpg

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.

CRDeveloper 06-13-2010 01:36 AM

Hello!

Thanks for the mod!

I added it inside a table to look like this

http://is.gd/cNftT
http://screensnapr.com/u/7dgvp2.png
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">

aspen1018 06-16-2010 04:43 PM

works great

Thank you

Xencored 06-16-2010 09:54 PM

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

The Rocketeer 06-17-2010 07:04 AM

dosent work for me either, can u look at the issue please?

Sparrow-Sean 06-17-2010 07:23 AM

Quote:

Originally Posted by Animemike (Post 2054704)
Hmm dont work for me the pop up box from twitter pops up for like 1 sec than goes away

Did you add this to your header.php file?

Quote:

<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: "Share this link!"
});
// Something else
$("tr.openclose a").click(function(){ $(this).parents("tr").hide(); $("tr.closed").show(); });
})
</script>

Yangster 06-24-2010 08:36 AM

This doesn't work for me in 4.0.4 throws out some really weird issues within long threads where users have quoted the original poster.

Filgga 06-24-2010 05:24 PM

Quote:

Originally Posted by Yangster (Post 2058668)
This doesn't work for me in 4.0.4 throws out some really weird issues within long threads where users have quoted the original poster.

Works for me :)

The issue am facing is; it's in all pages (if you navigate to page 2, 3, etc) of each thread.

I think it was supposed to be on the 1st post of the thread only, anyone with a code pls?

waleedelsafoury 10-12-2010 06:51 AM

I used this code you but in thread

PHP 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;"><class="tweet-this"><class="tweet-this"><a href="javascript://"><img src="http://nextgendaily.com/images/retweet.png" /> Tweet Topic!</a></p></div></vb:if> 

It worked for facebook but not for twitter

Cicada 11-12-2010 03:28 AM

bookmarked.

hnjco 11-28-2010 02:56 AM

I have installed with but its only showing for the first post.

Also your demo site shows the "share" mod which one is that?

http://img155.imageshack.us/img155/6...10115434pm.png

SoloX 12-10-2010 02:55 AM

^ i would like to know that as well. Which mod are you using to "share"?

Kingpin55 12-14-2010 11:14 PM

I installed this and the Tweet button shows up fine and it does post to Twitter but the links do not work. He is an example of a link it posts to Twitter

http://www.victorylaneforum.comshowt...hp/?3603-Rumor


The URL for my forum is http://www.victorylaneforum.com

shouldn't there be some sort of forward slash or something between .comshowthread??

Thanks for any help

thom 04-11-2014 12:53 PM

damn i have try to install this but it no't works for me
i have done exactly who u write hmmmmmmm


All times are GMT. The time now is 10:29 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.01098 seconds
  • Memory Usage 1,803KB
  • 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
  • (7)bbcode_code_printable
  • (1)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (20)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete