Back to vBulletin 4.x Template Modifications

Official "Follow me" twitter button
Mod Version: 1.00, by ToNetU

vB Version: 4.x.x Rating: (5 votes - 4.80 average) Installs: 34
Released: 01 Jun 2011 Last Update: Never Downloads: 0
Not Supported Template Edits Re-usable Code  

Hello there,
For people don't know, Twitter just released their new "Follow Button" so we can use it in our website.. https://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:

- Click "Save"
- Remember this number after you save your new field "check the screenshot" :

2- Now edit your (Postbit or Postbit_legacy Template) dependence on which one your are using.
- Search for in it for:
Code:
{vb:raw template_hook.postbit_messagearea_start}
- Add below it:
If you want to show how many followers She/He has add this:
Code:
<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:
Code:
<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:

And this is After you press "Follow"


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

Spoiler (click to open)


Quote by eternal_
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:
Code:
<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:
Code:
<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:
Code:
<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"

Close

Download

No files for download.

Screenshots

Click image for larger version
Name:	Screen shot 2011-06-01 at 03.56.14.png
Views:	1704
Size:	89.5 KB
ID:	129635   Click image for larger version
Name:	2.jpg
Views:	1696
Size:	78.9 KB
ID:	129636   Click image for larger version
Name:	3.jpg
Views:	1787
Size:	16.8 KB
ID:	129644   Click image for larger version
Name:	4.jpg
Views:	1731
Size:	14.5 KB
ID:	129645  

Similar Mods

Forum Home Enhancements Twitter - Scroll Animated Flash "Follow Us" Buttons vBulletin 4.x Template Modifications

vblts.ru supports vBulletin®, 2022-2024