PDA

View Full Version : Profile Enhancements - Official "Follow me" twitter button


ToNetU
05-31-2011, 10:00 PM
Hello there,
For people don't know, Twitter just released their new "Follow Button" so we can use it in our website.. Source (http://twitter.com/about/resources/followbutton)

- What is this mod for?
This mod is to help your members to show there there twitter username so people can follow them. and with this button you don't have to leave the page to enter to twitter then press the follow button "like the old days" :)
now people can follow you without leaving the page in just one touch!

- Can I show how many followers He/She has next to the Follow button?
Yes, Twitter added this choose so it's up to you "as forum admin" if you want to show to your members how many followers they have or not.

let's begin work..

1- you have to add new user profile field:
- Go to your admincp.
- From "User Profile Fields" choose "Add New User Profile Field"
- Choose "Signle-Line Text Box"
- Make it like this screenshot:
https://vborg.vbsupport.ru/attachment.php?attachmentid=129635&stc=1&d=1306897276
- Click "Save"
- Remember this number after you save your new field "check the screenshot" :
https://vborg.vbsupport.ru/attachment.php?attachmentid=129636&stc=1&d=1306897604
2- Now edit your (Postbit or Postbit_legacy Template) dependence on which one your are using.
- Search for in it for:
{vb:raw template_hook.postbit_messagearea_start}
- Add below it:
If you want to show how many followers She/He has add this:
<vb:if condition="$post['field5']">
<center><a href="http://twitter.com/{vb:raw post.field5}" class="twitter-follow-button">Follow @{vb:raw post.field5}</a></center>
<script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>
</vb:if>
- Change 5 to the field number you made before "check the second screenshot above"
If you doesn't want to show how many followers they have add this:
<vb:if condition="$post['field5']">
<center><a href="http://twitter.com/{vb:raw post.field5}" class="twitter-follow-button" data-show-count="false">Follow @{vb:raw post.field5}</a></center>
<script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>
</vb:if>
- Change 5 to the field number you made before "check the second screenshot above"
- Press "Save"
3- This is how it going to be in the thread:
https://vborg.vbsupport.ru/attachment.php?attachmentid=129644&stc=1&d=1306898681
And this is After you press "Follow"
https://vborg.vbsupport.ru/attachment.php?attachmentid=129645&stc=1&d=1306898681


4- That's it :)

NOTE:
- Note your member that if they want to add there twitter ID they have to edit their "profile" by going to "Setting" then "Edit Profile". And type their username without the @ . Ex: ToNetU not @ToNetU

UPDATE:
- If you want the button to be below the avatar, go to this post https://vborg.vbsupport.ru/showpost.php?p=2202905&postcount=9

ashley76
06-01-2011, 05:37 PM
Nice! Added!

tarzan22
06-01-2011, 05:47 PM
thanks but not work for me

ToNetU
06-01-2011, 06:13 PM
Nice! Added!

It worked with you? Just to be sure.. Thanks

ToNetU
06-01-2011, 06:20 PM
thanks but not work for me

Try to follow the instruction again i couldnt find anything wrong with the codes

glen290
06-01-2011, 07:41 PM
installed, but not showing up the twitter button..
Edit, sorted this..make a note to your users when the put theit titter ID in the user filed not to put @name , just put the name in.
Nice little mod, like it alot...

ToNetU
06-01-2011, 10:22 PM
installed, but not showing up the twitter button..
Edit, sorted this..make a note to your users when the put theit titter ID in the user filed not to put @name , just put the name in.
Nice little mod, like it alot...

Thanks i just updated tge note..

eternal_
06-02-2011, 06:02 PM
Is there any way to make this so it's in the avatar column instead of at the end of each post the person makes?

ToNetU
06-03-2011, 01:49 AM
Is there any way to make this so it's in the avatar column instead of at the end of each post the person makes?

Search in (Postbit or Postbit_legacy) Template for:
<img src="{vb:raw post.avatarurl}" alt="{vb:rawphrase xs_avatar, {vb:raw post.username}}" title="{vb:rawphrase xs_avatar, {vb:raw post.username}}" />
</a>
</vb:if>

Add below it:
If you want to show how many followers She/He has add this:
<vb:if condition="$post['field5']">
<center><a href="http://twitter.com/{vb:raw post.field5}" class="twitter-follow-button">Follow @{vb:raw post.field5}</a></center>
<script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>
</vb:if>
- Change 5 to the field number you made before "check the second screenshot in the first post"

If you doesn't want to show how many followers they have add this:
<vb:if condition="$post['field5']">
<center><a href="http://twitter.com/{vb:raw post.field5}" class="twitter-follow-button" data-show-count="false">Follow @{vb:raw post.field5}</a></center>
<script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>
</vb:if>
- Change 5 to the field number you made before "check the second screenshot in the first post"
- Press "Save"

Robru
06-04-2011, 08:07 AM
Very handy mod, thanks for it :)

Bozza
06-06-2011, 06:08 AM
Installed as it's a great idea, but I'm only getting text displayed 'eg Follow @NorthStandChat', not the Twitter graphic. The link it generates is going to twitter.com home page and not my Twitter account too.

Can be seen in first post here:
http://www.northstandchat.com/showthread.php?202678-Tapatalk-now-on-NSC

Edit: Ignore - all fixed now!

ashley76
06-07-2011, 11:13 PM
It worked with you? Just to be sure.. Thanks

Yep, works like a charm!

ToNetU
06-08-2011, 12:50 AM
Installed as it's a great idea, but I'm only getting text displayed 'eg Follow @NorthStandChat', not the Twitter graphic. The link it generates is going to twitter.com home page and not my Twitter account too.

Can be seen in first post here:
http://www.northstandchat.com/showthread.php?202678-Tapatalk-now-on-NSC

Edit: Ignore - all fixed now!

GREAT!

Yep, works like a charm!

Thank you! :)

Brandon Sheley
06-08-2011, 02:37 AM
nice mod, thanks for sharing!

zagman76
06-18-2011, 02:22 PM
Hello - this seems to break the board when using IE9. I suppose it could be used as a deterrent to the members from using this browser... :D

It works for FF & Chrome though! Thanks!

skylab
06-30-2011, 07:27 AM
Can't believe I didn't think of this earlier. Well done. Got it installed. Thanks!

Bozza
07-24-2011, 09:21 AM
Just changed mine to place it with the avatar etc. On my forum, and on many I suspect, with the full follower stats displayed, the text spills over quite messily so I'm using the no stat display now. Should be fine for all but the very longest Twitter usernames.

Seductor
08-01-2011, 11:37 AM
Hi! Is there any way to display the follow button only for admins?

x YNWA x
09-13-2011, 02:10 PM
Nice Mod.

For me, the follower count spills onto the post itself, is there a way of fixing this? I have it in the user info part...

Also when I click follow, it does not change to following, should it?

billstelling
09-24-2011, 05:06 AM
Any way to just show the button and no text? I also noticed that using the no followers version it still "sees it" when centering so it is left of center..

Nice mod by the way. Cool to have it on the forum now.

justpete
07-10-2012, 04:28 AM
I tried installing it on 4.2, but two odd things happen: A) the link disappears when you do a refresh or open a second browser (ie, IE). B) The twitter icon doesn't show up, just the text.

Any help? (yes, I used the username without the @)