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)
-   -   Profile Enhancements - Official "Follow me" twitter button (https://vborg.vbsupport.ru/showthread.php?t=264538)

ToNetU 05-31-2011 10:00 PM

Official "Follow me" twitter button
 
1 Attachment(s)
Hello there,
For people don't know, Twitter just released their new "Follow Button" so we can use it in our website.. Source

- 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/attachmen...1&d=1306897276
- Click "Save"
- Remember this number after you save your new field "check the screenshot" :
https://vborg.vbsupport.ru/attachmen...1&d=1306897604
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:
https://vborg.vbsupport.ru/attachmen...1&d=1306898681
And this is After you press "Follow"
https://vborg.vbsupport.ru/attachmen...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....05&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

Quote:

Originally Posted by ashley76 (Post 2202437)
Nice! Added!

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

ToNetU 06-01-2011 06:20 PM

Quote:

Originally Posted by tarzan22 (Post 2202442)
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

Quote:

Originally Posted by glen290 (Post 2202472)
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

Quote:

Originally Posted by eternal_ (Post 2202776)
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"

Robru 06-04-2011 08:07 AM

Very handy mod, thanks for it :)


All times are GMT. The time now is 03:08 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.05371 seconds
  • Memory Usage 1,747KB
  • 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
  • (6)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete