vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=236)
-   -   End-User Options - UKBL ~ Twitter profile link on Postbit ~ Clickable (https://vborg.vbsupport.ru/showthread.php?t=212221)

UKBusinessLive 04-25-2009 10:00 PM

UKBL ~ Twitter profile link on Postbit ~ Clickable
 
1 Attachment(s)
UKBL ~ Twitter profile link on Postbit ~ Clickable !!


Member on Twitter? Show other members that you have a Twitter presance by adding a Twitter Icon to your postbit ;)

Not been on for a while but i've had numerous requests for this Twitter hack so here we go....

This is a cool hack which will let your members add a Twitter Icon to their Postbit template, They need to add their Twitter Profile user name in their userCP for this to show, If they don't enter one, then the badge don't show :D

Runs along the same lines as the Facebook Hack, so if you've installed that, you'll love this :D
How to install.

Its really easy to do, as always, so if your sitting comfortably, lets begin ;)

Now we need to create a User Custome field, so.....

AdminCP and add a custom field > User Profile fields > Add New User Profile Field

Title = Twitter User Name

Description = Enter Your Twitter username from your Twitter User Profile

Default Value = Leave empty

Max length of allowed user input = 20

Display Size = 10

Display Order = 10 or 15

Field Required = No as default

Field Editable by User = Yes in case member wants to delete, Later

Private Field = No

Field Searchable on Members List = No

Show on Members List = Yes

Regular Expression = leave empty

Save the field ;)

Once you've saved you can see what the field number is, So lets say its Field11 for example, Remember this as will need it for your Postbit Edits :up:

Thats the first bit done, now Part Two :rolleyes:

Go to the template you are using in Styles & Templates/Style Manager, and select Edit templates.

Go to "postbit templates" and select the template you are using, either postbit or postbit_legacy.

Find the following

Code:

<if condition="$post['joindate']"><div class="postbit">$vbphrase[join_date]: $post[joindate]</div></if>
Directly above it add

Code:

<if condition="is_member_of($bbuserinfo, 6, 7, 9)">
<if condition="$post['field11']">
<a href="https://twitter.com/$post[field11]">
<img alt="My Twitter" border="0" src="http://i475.photobucket.com/albums/rr114/ukbusinesslive/twitter3.gif" border="0"/>
</if></if>

replace the RED Field attribute for your own and dont forget to replace the twitter image show in the above code for your own, see below

Code:

http://i475.photobucket.com/albums/rr114/ukbusinesslive/twitter3.gif
I've added several twitter images below but feel free to use your own

They are in .gif and .png, use the ones you feel happiest with ;)

https://vborg.vbsupport.ru/external/2009/04/5.gif
https://vborg.vbsupport.ru/external/2009/04/10.png
https://vborg.vbsupport.ru/external/2009/04/3.gif
https://vborg.vbsupport.ru/external/2009/04/4.gif
https://vborg.vbsupport.ru/external/2009/04/11.png
https://vborg.vbsupport.ru/

Now when members sign up their Twitter badge and enter their profile user ID into the "Enter your twitter username from your Twitter User Profile" section in their UserCP, The Badge will automatically appear in their Postbit :eek:

Don't forget to change the usergroup condition with the number of the usergroups that you want to be able to view this

Code:

<if condition="is_member_of($bbuserinfo, 6, 7, 9)">
That means that guests and banned users will not be able to view members Twitter profile urls ;)

Members who do not add a user id will not be shown anything.

Next, Upload the Twitter icon to your forums/images/misc folder and add the full url to the part in the code which shows the image.

if you are just seeing a red cross on your postbit, then its because your image url is not right ;)

Oh Forgot to say, Badge is fully clickable so members can click directly to Twitter ;)



Please Click Installed and I'll support you 100%

Thanks

UKBusinessLive 04-26-2009 04:03 PM

:) Reserved ;)

RobbieZ 04-26-2009 06:12 PM

Cool for expanding forums.. I like it.

FreeWebspace 04-28-2009 04:44 PM

Installed, but the link
Code:

https://twitter.com/[field11]
is not the correct one. I have to change it to
Code:

https://twitter.com/$post[field11]

UKBusinessLive 04-28-2009 05:15 PM

Quote:

Originally Posted by FreeWebspace (Post 1800658)
Installed, but the link
Code:

https://twitter.com/[field11]
is not the correct one. I have to change it to
Code:

https://twitter.com/$post[field11]

Thanks buddy, i'll change that now ;)

TimberFloorAu 04-28-2009 08:32 PM

Welcome back Gerry.

I coded this on our forums a few weeks back, and am happy with it. Albeit I think Twitter is crap, lol

MaR? 04-29-2009 12:15 AM

Does the Twitter status shows on postbit legacy?.. do you have screen or demo site? THANKS!

UKBusinessLive 04-29-2009 12:20 AM

Quote:

Originally Posted by MaR? (Post 1800902)
Does the Twitter status shows on postbit legacy?.. do you have screen or demo site? THANKS!

Does show in the Post bit legacy if you post the code there, No demo but you can get the same sort of idea with the facebook hack i did ;) Pictures in that one :D

UKBusinessLive 04-29-2009 12:22 AM

Quote:

Originally Posted by TimberFloorAu (Post 1800797)
Welcome back Gerry.

I coded this on our forums a few weeks back, and am happy with it. Albeit I think Twitter is crap, lol

Hi Steve,

Yeah Twitter is not as popular but it seems to be getting there, so i guess its cool to cater for it :)

as7apcool 04-29-2009 01:16 AM

very cooool

thanks


All times are GMT. The time now is 11:50 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.01151 seconds
  • Memory Usage 1,752KB
  • 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
  • (8)bbcode_code_printable
  • (3)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