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 - Tweet-This (vBulletin Style) (https://vborg.vbsupport.ru/showthread.php?t=242425)

Sparrow-Sean 05-12-2010 10:00 PM

Tweet-This (vBulletin Style)
 
1 Attachment(s)
Hello,

*First of all, this modification works quite easily. Insert the code and follow the steps, when you click the link which will appear in the first thread at the top right a fader box will appear at the lower right page of your screen where you can connect to Twitter to tweet that page.

It is not 100% perfect, I think it might reflect better with an image though :)

This is more a modification that I have made to my board from a (Tweet-it) application:
http://pongsocket.com/tweet-it/ (I take no credit).

Step 1:

Admin Panel >> Style Manager >> Edit Templates >> Header

I added this to the top of my header file, it seems to work whatever position it is inserted:
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 The Sparrow!"
                });
// Something else
                        $("tr.openclose a").click(function(){ $(this).parents("tr").hide(); $("tr.closed").show(); });
        })
</script>

Step 2:

Admin Panel >> Advertising >> Manage Ads >> Add New Add >> (DropDown) Thread >> First Box

I titled mine "tweet", call it as you wish.

Ad HTML >> I suck at code so do bare with me - Perhaps someone can code this up for me a little better than I can, I do apologise:

Code:

<div style="float: left; padding: 0px 3px 0px 0px;"><img src="http://forums.speedysparrow.com/images/ads/arrow-retweet.png" /></div><div style="float: left; padding: 0px 25px 0px 0px;"><p class="tweet-this"><p class="tweet-this"><a href="javascript://">Tweet Thread!</a></p></div>
Configure the options below as you require and save.

That is it! :)

EDIT:


You can add this to your POSTBIT_LEGACY:

Find:
Code:

<a class="forwardpost" href="{vb:raw post.forwardlink}" rel="nofollow"><img src="{vb:stylevar imgdir_button}/reply_40b.png" alt="{vb:rawphrase forward_message}" /> {vb:rawphrase forward}</a></vb:if>
After Add:
Code:

<div style="float: right; padding: 0px 0px 0px 0px;"><p class="tweet-this"><p class="tweet-this"><a href="javascript://"><img src="http://forums.speedysparrow.com/images/retweet.png" />Re-Tweet This Topic!</a></p></div>
This will add it to your postbit, however, it does add to every thread, if anyone can re-adjust this it would be great.
================================================== ==============
You can edit the header code to change the name of the Tweet-Box Name ie.
Please excuse my bad coding, I am not a developer and this is my first experience with this so if anyone can re-code correctly please do so.

Test This:
http://forums.speedysparrow.com/show...rrow-Promotion

Select TWEET THREAD.
================================================== ==============


EDIT 09/07/10:

Use the following code to hide from PM's:
Code:

<vb:if condition="THIS_SCRIPT == 'showthread'">Code Here</vb:if>
Insert the code within and it should fix those Private Message issues.

Thank you,

Sean

Bacon Butty 05-13-2010 05:19 PM

Looks Brilliant thanks Sean.

Crow 05-13-2010 05:31 PM

Checking it out now, thanks

Bacon Butty 05-13-2010 05:44 PM

I've actually added it to my postbit;

https://vborg.vbsupport.ru/

Before I put it live, I'm hoping someone anyone verify that this is actually secure.

Sparrow-Sean 05-13-2010 10:51 PM

Quote:

Originally Posted by Bacon Butty (Post 2036521)
I've actually added it to my postbit;

http://img707.imageshack.us/img707/3356/tweetpost.jpg

Before I put it live, I'm hoping someone anyone verify that this is actually secure.

Hello Bacon Butty,

Thank you for your help :)

Can you tell me how you got it down there?

I am not very clever with all of this since it is my first official release.

Cheers,

Sean

Bacon Butty 05-14-2010 08:04 AM

I'm not the best either mate. What I done was;

Open Postbit;

Find

Code:

&nbsp;<a class="report" href="{vb:raw post.reportlink}" rel="nofollow" title="{vb:rawphrase report_bad_post}"><!-- <img src="{vb:stylevar imgdir_button}/report-40b.png" alt="{vb:rawphrase report_bad_post}" /> -->&nbsp;</a> &nbsp;
                                        </vb:if>

Underneath, put;

Code:

<div style="float: right; padding: 0px 5px 0px 0px;"><p class="tweet-this"><a href="javascript://"><img src="/images/misc/arrow-retweet.png" />Tweet Post!</a></p></div>
Though, I'm needing to find a condition to remove it from PMs as 'Tweet This' is showing under PMs. Can anyone tell me how to remove this from view in PM's?

I'm also assuming it might be an idea to put jquery.min.js, and tweet-it.js on your own server.

Sparrow-Sean 05-14-2010 08:35 AM

Just noticed the "Tweet Thread" in Private Messaging.

Should of put more thought into my modification :(

I have added it into my site now, however, I had to add it another way then above but the same way in essence.

Hopefully others can pitch in for better code ;)

paramegsoft 05-15-2010 12:42 PM

very useful

thanks man

Sparrow-Sean 05-15-2010 01:00 PM

Quote:

Originally Posted by paramegsoft (Post 2037350)
very useful

thanks man

It is a good modification, just needs some enhancements in which I hope the community can update on ;)

As pointed out it does add in to PM's which I want to some how remove as well ;)

Thanks for Installing.

Boko577 05-20-2010 04:45 AM

Bump! Cause I really wanna see the code improved. I hope there is a way to remove the Tweet button from postbit when in a PM or in any post. I just want it at the top in the first post (thread)

dargox 05-21-2010 03:29 PM

Hi guys... I can´t find the ADVERTISING option to paste the code, and where is the POSTBIT_LEGACY so I can edit ?

I think those steps are easy but I don´t know about programming so please help me.

Sparrow-Sean 05-23-2010 12:00 AM

As a person of lack of intelligence here, there has to be someone who can mimick this code surely to integrate it better in to a forum :)

Dargox, what version are you running?

kall 05-23-2010 06:16 PM

PHP Code:

<vb:if condition="THIS_SCRIPT == 'showthread'">Code Here</vb:if> 

That will restrict it to only showing when showthread.php is the active script.

Sparrow-Sean 05-24-2010 08:03 AM

Quote:

Originally Posted by kall (Post 2042340)
PHP Code:

<vb:if condition="THIS_SCRIPT == 'showthread'">Code Here</vb:if> 

That will restrict it to only showing when showthread.php is the active script.

Will this prevent it in Private Messages Kall?

Thanks,

Sean:D

dargox 05-24-2010 02:43 PM

Quote:

Originally Posted by Sparrow-Sean (Post 2042056)
As a person of lack of intelligence here, there has to be someone who can mimick this code surely to integrate it better in to a forum :)

Dargox, what version are you running?

I?m running the 4.0.3

kall 05-24-2010 05:19 PM

Quote:

Originally Posted by Sparrow-Sean (Post 2042574)
Will this prevent it in Private Messages Kall?

Thanks,

Sean:D

Yes. :)

Look at the start of the php file, under the block of copyright and stuff, there's a definition of "THIS_SCRIPT". showthread.php = showthread, private.php = private etc.

The template conditional I gave will only activate if the page that the viewer is on is showthread.php (so, not private.php).

Boko577 05-26-2010 05:54 AM

Mine looks like this? Any way to bump it up???
https://vborg.vbsupport.ru/

http://grab.by/grabs/c01c7f6d95cef17...9766cd8959.png

Boko577 05-27-2010 02:21 AM

Read Above Post!

kall 05-27-2010 03:23 AM

Quote:

Originally Posted by Boko577 (Post 2043883)
Read Above Post!

Read This Post!

https://vborg.vbsupport.ru/showpost....98&postcount=6

ChopSuey 05-27-2010 08:23 AM

You can just add it into the showthread template.

Xencored 05-27-2010 08:39 AM

Quote:

Originally Posted by ChopSuey (Post 2043993)
You can just add it into the showthread template.

Where abouts ive been looking for abit now :/

Boko577 05-29-2010 07:23 PM

Quote:

Originally Posted by kall (Post 2043904)

Obviously I did that when I have it in my postbit legacy already! I need to know why it's not on the bar right.

Fuhrmann 06-01-2010 04:12 PM

Nice, tagged.

Boko577 06-03-2010 12:02 AM

Mine looks like this? Any way to bump it up???
https://vborg.vbsupport.ru/

http://grab.by/grabs/c01c7f6d95cef17...9766cd8959.png

Veer 06-03-2010 03:23 PM

Quote:

Originally Posted by Boko577 (Post 2047373)

same here

Xencored 06-03-2010 06:54 PM

Quote:

Originally Posted by Veer (Post 2047715)
same here

Same here too ive tryed to move it up the other day didnt work tho :erm:

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

In your "posbit_legacy" file in edit templates scroll too the bottom and add:

Quote:

<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://forums.speedysparrow.com/images/site_icons/forum.png" />Tweet Thread!</a></p></div></vb:if>
Be sure to change our address to an image on your site, the image I have chosen is from the board but it does not change effects like the others.

The above code, add it above:

Quote:

******here******
</span>
<!-- </div> -->
</div>
</div>
<hr />
{vb:raw template_hook.postbit_end}
Good Luck

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

You might also need to fiddle with the padding settings outlined, though, otherwise it should work on all v4 boards. ;)

sticky 07-09-2010 10:01 AM

Installed, awesome :)

Sparrow-Sean 07-09-2010 10:15 AM

Thanks for updating Sticky. Glad you like it :)

sticky 07-16-2010 06:06 AM

Quote:

Originally Posted by Sparrow-Sean (Post 2066759)
Thanks for updating Sticky. Glad you like it :)

I love it but one problem, it keeps asking me to link with my Twitter account? Why is that?

It seems it loses the link after a while and I have to do it over again.

sticky 07-27-2010 07:11 PM

Quote:

Originally Posted by sticky (Post 2069913)
I love it but one problem, it keeps asking me to link with my Twitter account? Why is that?

It seems it loses the link after a while and I have to do it over again.

Any idea why it won't stay linked?


All times are GMT. The time now is 05:16 AM.

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.01251 seconds
  • Memory Usage 1,819KB
  • 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
  • (2)bbcode_php_printable
  • (14)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (32)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