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

Reply
 
Thread Tools
Individual Pseudo-Usergroup Icon in Postbit Details »»
Individual Pseudo-Usergroup Icon in Postbit
Version: 1.1, by TygerTyger TygerTyger is offline
Developer Last Online: Jul 2012 Show Printable Version Email this Page

Version: 3.6.0 Beta 3 Rating:
Released: 07-09-2006 Last Update: 07-12-2006 Installs: 7
Template Edits
 
No support by the author.

Requested by people who wanted to choose a small icon by their name like I gave to moderators and admins via Usergroup Markup code. Obviously if it's done by usergroup it can't be done for individuals (and frankly it looks like a minor disaster in WOL if every user has an icon). This way, with only template changes, it can.

Screenshot at the bottom of the post!

INSTRUCTIONS:
AdminCP > User Profile Fields > Add New User Profile Field

Single-Line Text Box

Title: Username Icon
Description: If you would like an icon to appear next to your username when you post on the forum, enter the URL ONLY in the text box below. Do NOT include the http:// part. Maximum permitted size is 16x16 pixels.
Obviously change the pixel dimensions to whatever dimensions you would like user to post, 16x16 looks right to me.
Default Value: imagename.gif

...A few settings here which are up to your own discretion...

Profile Field Type: Single-Line Text Box
Field Required: No.
Field Editable by User: Yes
Private Field: No.
Field Searchable on Members List: No
Show on Members List: No

Which page displays this option? Edit Profile

Save the page and make a note of the field number for this custom field which is shown in the list on the User Field Manager page. If it is your first custom field then it will be field6.

Now go to AdminCP > Styles & Templates > Style Manager > Edit Templates and edit your postbit(_legacy) template.

FIND:
Code:
<if condition="$show['profile']"><a class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]">$post[musername]</a>
REPLACE WITH:
Code:
<if condition="$show['profile']">
<if condition="$post['fieldX']"><span class="usernameicon"><div <if condition="is_browser('ie', 6)">style="margin:0;padding-right:4px;"</if>><img src="http://$post[field7]" alt="" class="inlineimg" border="0" /></div></span></if>
<a class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]">$post[musername]</a>
Making sure you change fieldX to field6 or the correct field number appropriate for you.

Next go to AdminCP > Styles & Templates > Style Manager > Main CSS and copy and paste the following code into the custom CSS text box at the bottom of the page, again changing the width and height pixel numbers to match the maximum size of the icon you want your members to use.

Code:
.usernameicon {
display:inline-block;
}
.usernameicon div {
display:inline-block;
float:left;
clear:none;
width:16px;
height:16px;
overflow:hidden;
margin:6px 6px 0 0;
}
And you're done! All your members now have to do is visit UserCP > Edit Profile and paste the URL of their chosen icon into the Username Icon text box.

Three things for you to note: There's no real restriction on the size of image people can use. The CSS ensures it won't show break your layout, since no matter how big a picture they choose only 16x16 pixels of it will show up. But it will show down page load times and waste your users bandwidth with large images, so be observant.

Secondly, this does not interfere with Usergroup Markup so you can specify an image there as well if you like.

Thirdly, this will only display to logged-in users. vBulletin does not allow Guests to pull custom user-field data so there won't be a fix as long as it remains a template mod.

Demo:


The Username Icon is the red rose on the left, the Usergroup Icon is the yellow rose on the right. If there is no Usergroup icon it will display where the yellow rose is.


Fix:
The http:// part of the URL is now set in the template code and not the user-defined text to stop the layout breaking if plain text is defined instead of an image URL. The default field text and description have been changed to reflect this. The alt text has been set to nothing for the same reason.
Fix:
CSS has been thoroughly kerjiggered so a block div will display inline next to the username. Or anything else for that matter.
Fix:
Changed the mod name to something terrible.
Fix:
IE Conditional to fix erratic IE rendering. Now aligns properly.
Fix:
AJAX posting will no longer makes the icon appear/disappear in new posts.


Current Issues
Mod name is something terrible but more accurately desciprtive.

Show Your Support

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

Comments
  #2  
Old 07-10-2006, 01:34 PM
TygerTyger TygerTyger is offline
 
Join Date: Aug 2005
Posts: 182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hm, the CSS isn't quite right and I can't find a way to delete the modification. Odd.

Disregard this mod until I can fix it.

Edit: Fixed. Post reserved, I guess.
Reply With Quote
  #3  
Old 07-10-2006, 05:42 PM
Snake's Avatar
Snake Snake is offline
 
Join Date: Mar 2005
Location: Cleveland, OH
Posts: 3,832
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Please get over it ASAP. I can't wait to have this installed on my forums!
Reply With Quote
  #4  
Old 07-11-2006, 11:38 AM
TygerTyger TygerTyger is offline
 
Join Date: Aug 2005
Posts: 182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Mod updated to fix the major bugs. The CSS, Template code and Custom Field text have all been changed.
Reply With Quote
  #5  
Old 07-13-2006, 10:37 AM
TygerTyger TygerTyger is offline
 
Join Date: Aug 2005
Posts: 182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Updated again to fix erratic display in IE and funny little AJAX quirk.
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 04:54 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.06819 seconds
  • Memory Usage 2,246KB
  • Queries Executed 20 (?)
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
  • (3)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (4)postbit
  • (5)postbit_onlinestatus
  • (5)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_postinfo_query
  • fetch_postinfo
  • 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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete