Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Social Networks in Postbit Details »»
Social Networks in Postbit
Version: 1.00, by zerovenom zerovenom is offline
Developer Last Online: Feb 2010 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 3.8.4 Rating:
Released: 01-09-2010 Last Update: Never Installs: 19
Template Edits
Re-useable Code  
No support by the author.

My Social Networks

I'd like to add my first modification because I feel like I just leech everything and don't give back, so I decided to start trying.

I don't take credit for this mod, it's based off of UKBusinessLive's Twitter profile link.
https://vborg.vbsupport.ru/showthread.php?t=212221

I simply edited it and added 2 more for Facebook and MySpace as well.

This should work with vBulletin 3.7 and Up. I'm not sure as I've only tested on 3.8.4. If you can test this on previous versions, it would be great if you can post that. Thanks!

Here's a live demo on my development site: Demo

You'll need to create 3 new User Profile Fields.
AdminCP>User Profile Fields>Add New User Profile Field

Profile Field Type: Single-Line Text Box

Title: Twitter Username
Description: Please Enter your Twitter Username
Profile Field Category: Choose your category (if you have extra custom ones)
Default Value: Leave Blank
Max length of allowed user input: 20
Field Length: Leave Default
Display Order: Choose any number that hasn't already been taken in your profile fields.
Field Required: No
Field Editable by User: Yes
Private Field: No
Field Searchable on Members List: No
Show on Members List: Yes
Regular Expression: Leave Blank

Save.

You'll need to make one for Facebook, Twitter, and MySpace using the same settings except you need to change the names to the proper social network.

For Display Order, I used 5 for Twitter, 6 for Facebook, and 7 for MySpace.
If you've made previous custom profile fields, then please enter your own numbers.

Remember which number you chose for Display Order.

Now go to AdminCP>Styles & Templates>Style Manager>Edit Templates and choose your template.

Scroll down and choose Postbit Templates. You can edit either postbit or postbit_legacy

Find:
Code:
<if condition="$post['joindate']"><div class="postbit">$vbphrase[join_date]: $post[joindate]</div></if>
And add this before:
Code:
<div align="center">
My Social Networks:<br /><br />
<if condition="is_member_of($bbuserinfo, 2, 6, 7, 9)">
<if condition="$post['field5']">
<a href="https://twitter.com/$post[field5]" target="_blank">
<img alt="Twitter" border="0" src="$stylevar[imgdir_misc]/twitter.png"/></a></if>
&nbsp;&nbsp;
<if condition="$post['field6']">
<a href="https://facebook.com/$post[field6]" target="_blank">
<img alt="Facebook" border="0" src="$stylevar[imgdir_misc]/facebook.png"/></a></if>
&nbsp;&nbsp;
<if condition="$post['field7']">
<a href="https://myspace.com/$post[field7]" target="_blank">
<img alt="MySpace" border="0" src="$stylevar[imgdir_misc]/myspace.png"/></a></if>
</div>
</if>
This is the default code that I created, but felt like it needed work. This style is still available to use if you don't need any special look or feel to it.

Everything in red should be the only items you need to change. However, you may need to edit it further for different styles.

To change which usergroups can see these links, you can edit this code with the usergroup number you want to be able to view them.

Code:
<if condition="is_member_of($bbuserinfo, 6, 7, 9)">
Or you can simply delete this code to allow everybody to view them, but you'll also need to delete the </if> at the very end of the full code.

If you'd like to create a box specifically for it for more design and better formatting, then continue reading--

I don't take credit for this change either.
This modification is based off of jacki's Pro. Postbit Legacy.
https://vborg.vbsupport.ru/showthread.php?t=214565

You'll need to edit your template's CSS by going here:
AdminCP>Styles & Templates>Style Manager>All Style Options

Scroll down to Additional CSS Definitions and in the second box, scroll all the way down and add:
Code:
.mysocialnetworks {
padding-left: 3px;
padding-right: 0px;
padding-top: 3px;
padding-bottom: 3px;
background-color: #FFFFFF;
border-top: 1px solid #dadada;
border-right: 2px solid #dadada;
border-left: 1px solid #dadada;
border-bottom: 2px solid #dadada;
margin-bottom: 3px;
}
The items highlighted in red can be changed. These are the image codes and can be changed to your templates colors.

Now, you basically just need to follow the previous steps for adding it to your postbit or postbit_legacy. Except with minor changes to include the CSS and center it.

Find:

Code:
<if condition="$post['joindate']"><div class="postbit">$vbphrase[join_date]: $post[joindate]</div></if>
And add this before:
Code:
<div align="center" class="mysocialnetworks">
My Social Networks:<br /><br />
<if condition="is_member_of($bbuserinfo, 2, 6, 7, 9)">
<if condition="$post['field5']">
<a href="https://twitter.com/$post[field5]" target="_blank">
<img alt="Twitter" border="0" src="$stylevar[imgdir_misc]/twitter.png"/></a></if>
&nbsp;&nbsp;
<if condition="$post['field6']">
<a href="https://facebook.com/$post[field6]" target="_blank">
<img alt="Facebook" border="0" src="$stylevar[imgdir_misc]/facebook.png"/></a></if>
&nbsp;&nbsp;
<if condition="$post['field7']">
<a href="https://myspace.com/$post[field7]" target="_blank">
<img alt="MySpace" border="0" src="$stylevar[imgdir_misc]/myspace.png"/></a></if>
</div>
</if>

Since Facebook's Username system is fairly new, a lot of people don't know it exists as Facebook never fully advertised it. In order to create a Facebook username, you need to simply click on "Settings" on Facebook and you'll see "Username", click on "Change" and you can change your Facebook username to anything you want and be able to use it for this mod.


If you'd like further help, please click Install and I'll be more than happy to provide support.

The uploaded file includes the 20x20 icons. Place these in your template's images "misc" folder.

Download Now

File Type: zip mysocialnetworks.zip (15.9 KB, 107 views)

Screenshots

File Type: png mysocialnetworks_default.png (15.9 KB, 0 views)
File Type: png mysocialnetworks_myskin.png (13.8 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 01-11-2010, 05:58 PM
mekanbursa mekanbursa is offline
 
Join Date: Feb 2009
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanx..
Reply With Quote
  #3  
Old 01-11-2010, 06:35 PM
zerovenom zerovenom is offline
 
Join Date: Jan 2009
Location: Corpus Christi, TX
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Updated:

Oops, when I posted it, I didn't realize I had Twitter on there three times. Updated to have Twitter, Facebook, and MySpace in their correct order.
Reply With Quote
  #4  
Old 01-19-2010, 04:22 AM
zerovenom zerovenom is offline
 
Join Date: Jan 2009
Location: Corpus Christi, TX
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I know this is my mod, but since it's basically just based off of two other mods... I have a question on how to possibly edit it further to make it look better. I have it set to where only my usergroups, 2, 6, 7, 9, 20, 21, are able to see it... but if they don't fill out the information or don't have information to provide, the "My Social Networks" still shows with the box around it.

How would I be able to have the box show ONLY when at LEAST one of the fields has been entered?

I'm sure it's somewhere along the lines of
Code:
<if condition="$show['field5']">
However... Would I have to enter that three times for each one? 5, 6, and 7? Or is it possibly to make it
[CODE]I know this is my mod, but since it's basically just based off of two other mods... I have a question on how to possibly edit it further to make it look better. I have it set to where only my usergroups, 2, 6, 7, 9, 20, 21, are able to see it... but if they don't fill out the information or don't have information to provide, the "My Social Networks" still shows with the box around it.

How would I be able to have the box show ONLY when at LEAST one of the fields has been entered?

I'm sure it's somewhere along the lines of
Code:
<if condition="$show['field5']$show['field6']$show['field7']">
? That doesn't seem like it'd work... but does anybody have any idea? If so, please provide, I'll updated and give credit. =)
Reply With Quote
  #5  
Old 01-23-2010, 04:11 PM
Tenth Doctor's Avatar
Tenth Doctor Tenth Doctor is offline
 
Join Date: Oct 2008
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can't seem to get this to work on vB 4.0.1. Would really love to get it working though.

It can't find this in any of the templates, even the default one:
<if condition="$post['joindate']"><div class="postbit">$vbphrase[join_date]: $post[joindate]</div></if>
Reply With Quote
  #6  
Old 01-28-2010, 08:22 PM
zerovenom zerovenom is offline
 
Join Date: Jan 2009
Location: Corpus Christi, TX
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Tenth Doctor View Post
Can't seem to get this to work on vB 4.0.1. Would really love to get it working though.

It can't find this in any of the templates, even the default one:
<if condition="$post['joindate']"><div class="postbit">$vbphrase[join_date]: $post[joindate]</div></if>
This is for 3.8 =(

I'll see what I can do about getting it for 4.0 though.
Reply With Quote
  #7  
Old 01-31-2010, 07:07 AM
Tenth Doctor's Avatar
Tenth Doctor Tenth Doctor is offline
 
Join Date: Oct 2008
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by zerovenom View Post
This is for 3.8 =(

I'll see what I can do about getting it for 4.0 though.
Thanks! I would really appreciate it. this is a great hack and exactly what I've been looking for! My community is based on Twitter, the vB CMS/forums is an extension of that, so we really do need Twitter integration with our board.
Reply With Quote
  #8  
Old 07-06-2010, 11:06 PM
DarioVinci DarioVinci is offline
 
Join Date: Jun 2006
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hi zerovenom, ty for this hack...i fixed the code to not display the social network box when fields are empty:

HTML Code:
<if condition="$post[field14] OR $post[field15] OR $post[field16]">
<div align="center" class="mysocialnetworks">
Social Networks:<br /><br />
<if condition="is_member_of($bbuserinfo, 2, 6, 7, 12, 13, 14, 15, 16)">
<if condition="$post['field14']">
<a href="https://twitter.com/$post[field14]" target="_blank">
<img alt="Twitter" border="0" src="$stylevar[imgdir_misc]/twitter.png"/></a></if>
&nbsp;&nbsp;
<if condition="$post['field15']">
<a href="https://facebook.com/$post[field15]" target="_blank">
<img alt="Facebook" border="0" src="$stylevar[imgdir_misc]/facebook.png"/></a></if>
&nbsp;&nbsp;
<if condition="$post['field16']">
<a href="https://myspace.com/$post[field16]" target="_blank">
<img alt="MySpace" border="0" src="$stylevar[imgdir_misc]/myspace.png"/></a></if>
</div>
</if>
</if>
Reply With Quote
  #9  
Old 07-26-2010, 06:13 PM
steeler7 steeler7 is offline
 
Join Date: Oct 2009
Posts: 141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any word on getting this or something like this for vB4?
Reply With Quote
  #10  
Old 10-28-2010, 05:42 AM
2fast4ya 2fast4ya is offline
 
Join Date: Feb 2005
Location: Los Angeles
Posts: 210
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I would kill for something like this in VB4
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:50 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05181 seconds
  • Memory Usage 2,349KB
  • Queries Executed 24 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (8)bbcode_code
  • (1)bbcode_html
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (3)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete