Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > Programming Articles
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
How To Add Custom Profile Field Information To The Postbit
peterska2
Join Date: Oct 2003
Posts: 6,504

 

Manchester, UK
Show Printable Version Email this Page Subscription
peterska2 peterska2 is offline 06-16-2006, 10:00 PM

So you've added some custom profile fields and would like the information to display in the postbit, but how do you go about it? This guide will help you to do this.

Throughout this guide the x in fieldx is to be replaced with the field number as shown in the profile field manager in the name column.

Single Line Text Boxes

To add the contents of a single line text box to the postbit, use one of the following formats:

To use a title for the displayed text (eg Real name: Kerry-Anne)
Code:
<if condition="$post[fieldx]"><div class="smallfont">Label for text: $post[fieldx]</div></if>
To simply display the text (eg Kerry-Anne)
Code:
$post[fieldx]
Multiple Line Text Boxes

While I don't recommend displaying these in the postbit as they can contain a large amount of information, they are done in the exact same way as the single line text box.

Note: The text entered will display all on one line, not in multiple lines as added to the text box and displayed in the profile page.


Single Selection Radio Buttons & Single Selection Menus

These both display text in the same way as the Single Line Text Box so the same format can be applied to these. However, as these are mainly used for fixed options (eg Date of Birth, or Homepage contains adult content here at vB.org) they can also be used to display images (eg the gender in postbit modification).

These examples, using images, assume that you have uploaded the images to your misc image directory for the style that you are using. You can replace
Code:
$stylevar[imgdir_misc]
with the appropriate path to your images if different. They also assume that the file type of the images is gif. If this is different, you will need to alter it in the code by replacing
Code:
.gif
with the appropraite extension. Your image names need to be exactly the same as the profile field options, including capitalization.

To use the contents to display an image, with no label, use the following format:
Code:
<if condition="$post[fieldx]"><div><img src="$stylevar[imgdir_misc]/$post[fieldx].gif" border="0" alt="$post[fieldx]" /></div></if>
To show a label before the image, use the following format:
Code:
<if condition="$post[fieldx]"><div class="smallfont">Label for image: <img src="$stylevar[imgdir_misc]/$post[fieldx].gif" border="0" alt="$post[fieldx]" /></div></if>
Multiple Selection Menus and Checkboxes

I wouldn't recommend using these to display information in the postbit, as to enable them requires long usage of conditionals to translate the code saved in the database into displayable text.


I hope you find this useful. Feel free to ask any questions related to this.
Reply With Quote
  #22  
Old 10-08-2008, 02:33 PM
Macartist6 Macartist6 is offline
 
Join Date: Oct 2008
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

anyone want to do this on my site for me???... this is way over my head... PM me

I'll Pay you via PayPal

--------------- Added [DATE]1223485311[/DATE] at [TIME]1223485311[/TIME] ---------------

I got someone thank you!
Reply With Quote
  #23  
Old 12-03-2008, 12:22 PM
mmoore5553 mmoore5553 is offline
 
Join Date: Aug 2008
Posts: 530
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

does anyone know how to make this show up on thread ....under there name and show a picture ? i added the custom user group but cant find where to modify it ..i looked up nder post legacy

msn - mmoore@smoothstone. com

--------------- Added [DATE]1228324154[/DATE] at [TIME]1228324154[/TIME] ---------------

oh here is my example ..i have choices ... 1 2 3
if they pick1 they get this gif by there name or under it or beside dont matter to me
if they pick 2 they get this other picture or gif
if they pick 3 they get this other pic or gif ...

i know what needs to be done but cant figure it out for love of me ...i have paypal
Reply With Quote
  #24  
Old 12-31-2008, 11:23 PM
DarkFormula's Avatar
DarkFormula DarkFormula is offline
 
Join Date: Jul 2005
Location: Columbus, Ohio
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

FYI, there's nowhere specified where to add this in the template, and adding it under existing fields called for causes an error of "The conditional on line 62 appears to be missing its beginning tag (<if>). This may cause unexpected behavior."
Reply With Quote
  #25  
Old 01-01-2009, 02:28 AM
mmoore5553 mmoore5553 is offline
 
Join Date: Aug 2008
Posts: 530
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i actually figured out how to add special modifications on my site ..

www.cg-hq.com

i have them pick what 3d software they use adn then it adds a picture under there avatar ...just to let you know this guide plus another helped me
Reply With Quote
  #26  
Old 01-01-2009, 02:35 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by DarkFormula View Post
FYI, there's nowhere specified where to add this in the template, and adding it under existing fields called for causes an error of "The conditional on line 62 appears to be missing its beginning tag (<if>). This may cause unexpected behavior."
They can't tell you exactly where to add it in the template because everyone wants to add their stuff in a different place. It is assumed you will make sure you are not replacing an <if> tag, or doing something else to 'break' the html in the template.
Reply With Quote
  #27  
Old 01-01-2009, 03:16 AM
DarkFormula's Avatar
DarkFormula DarkFormula is offline
 
Join Date: Jul 2005
Location: Columbus, Ohio
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
They can't tell you exactly where to add it in the template because everyone wants to add their stuff in a different place. It is assumed you will make sure you are not replacing an <if> tag, or doing something else to 'break' the html in the template.
Where would be the best place to add it, then? I've tried several places and the error always appears, just with a different line reference.
Reply With Quote
  #28  
Old 01-01-2009, 02:38 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Why don't you post the line you are adding and the code a few lines above and below that part in your template and see can see what is wrong.
Reply With Quote
  #29  
Old 01-05-2009, 08:43 PM
makofu makofu is offline
 
Join Date: Dec 2007
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by DarkFormula View Post
Where would be the best place to add it, then? I've tried several places and the error always appears, just with a different line reference.
I got the same thing initially...realized I forgot to add a quote in my <if ....> statement. Make sure you have all of your quotes in place.
Reply With Quote
  #30  
Old 01-06-2009, 09:38 AM
selwonk's Avatar
selwonk selwonk is offline
 
Join Date: Jul 2005
Location: Manchester, UK
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great tutorial! Is there any way to only show the profile field once per page? For example, I run a motoring forum and I show the user's "garage" beneath their signature* but I'd like to only show it on the first post per page for that user

Thanks in advance!

* Not within so that it always shows the garage regardless of whether they have a signature or not
Reply With Quote
  #31  
Old 01-06-2009, 02:29 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by selwonk View Post
Great tutorial! Is there any way to only show the profile field once per page? For example, I run a motoring forum and I show the user's "garage" beneath their signature* but I'd like to only show it on the first post per page for that user

Thanks in advance!

* Not within so that it always shows the garage regardless of whether they have a signature or not
That is really beyond the scope of the article. If you want to do that, I suggest you have a look at the modification to only have a signature show up once on a page. Modify that code for use with your profile fields.
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 02:23 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.04940 seconds
  • Memory Usage 2,312KB
  • Queries Executed 25 (?)
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
  • (6)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete