Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 10-27-2011, 09:14 PM
j1mmy j1mmy is offline
 
Join Date: Feb 2006
Location: UK, England
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Adding a custom field under the avatar

How can I add a custom field detail for viewing under the avatar next to join date, and post count?

Thanks
Reply With Quote
  #2  
Old 10-27-2011, 10:18 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Are you talking about a custom profile field? You just need to add the field in the adminCP, then edit the postbit or postbit_legacy template and add $post[fieldX] where you want it to appear (of course you'd change X to the actual id number of your custom field).
Reply With Quote
  #3  
Old 10-28-2011, 04:35 PM
j1mmy j1mmy is offline
 
Join Date: Feb 2006
Location: UK, England
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes a custom profile field.

Do I edit both templates or just any of those two?
Reply With Quote
  #4  
Old 10-29-2011, 12:06 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You would edit the one you're using. (There's a "Use Legacy (Vertical) Postbit Template" setting in the adminCP options, under "Help Style & Language Settings"). Basically, if you have all the poster's info on the left side then you're using postbit_legacy. If it's across the top (like this site) then it's postbit.

BTW, in my previous post I orignially had vb4 syntax for adding the variable to the template, but I just fixed it. Sorry if that caused you any problems.
Reply With Quote
Благодарность от:
j1mmy
  #5  
Old 10-29-2011, 08:56 PM
j1mmy j1mmy is offline
 
Join Date: Feb 2006
Location: UK, England
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, so I've found the template, and I guess this is what I need to focus on?

Code:
			<div class="smallfont">
				&nbsp;<br />
				<if condition="$post['joindate']"><div>$vbphrase[join_date]: $post[joindate]</div></if>
				<if condition="$post['field8']"><div>$vbphrase[location_perm]: $post[field8]</div></if>
				<if condition="$post['age']"><div>$vbphrase[age]: $post[age]</div></if>
				<div>
					$vbphrase[posts]: $post[posts]
				</div>
Also do you know I can get rid of age showing up without deleting that line in the code? Is there an option?
Reply With Quote
  #6  
Old 10-29-2011, 11:52 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, that's the place, you should just be able to copy one of those lines and make your changes (you don't even have to make a phrase if you don't want to, you can just put your text in there).

I think a user can choose whether or not to have their age displayed, but I don't think there's a global setting. If you dont' want to take it out because you're concerned about figuring out how to replace it, you could do this:

Code:
<if condition="0">
<if condition="$post['age']"><div>$vbphrase[age]: $post[age]</div></if>
</if>
Reply With Quote
  #7  
Old 10-30-2011, 12:05 PM
j1mmy j1mmy is offline
 
Join Date: Feb 2006
Location: UK, England
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks. This is how I am putting the code in, but the Occupation starts on the same line as the Education:

Code:
<strong>Education & Occupation</strong><br />
Education: $post[field11]
Occupation: $post[field14]
Do I need to wrap them in div tags as is done with the vB default ones?

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

Also, I've noticed that as I allow unregistered users to post on my board, their post count comes up as n/a. How can I do the same with the custom fields? How can I get them to also show n/a when a guest posts? At the moment its blank.
Reply With Quote
  #8  
Old 11-02-2011, 12:44 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by j1mmy View Post
Thanks. This is how I am putting the code in, but the Occupation starts on the same line as the Education:

Code:
<strong>Education & Occupation</strong><br />
Education: $post[field11]
Occupation: $post[field14]
Do I need to wrap them in div tags as is done with the vB default ones?

You need to use <BR /> to make a new line in html. A div would do it too I think.


Quote:
--------------- Added [DATE]1319977871[/DATE] at [TIME]1319977871[/TIME] ---------------

Also, I've noticed that as I allow unregistered users to post on my board, their post count comes up as n/a. How can I do the same with the custom fields? How can I get them to also show n/a when a guest posts? At the moment its blank.

You can do this:

Code:
<if condition="$show['member']">code for member<else />code for guest</if>
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 12:19 AM.


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.04351 seconds
  • Memory Usage 2,234KB
  • Queries Executed 11 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (5)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (1)post_thanks_box_bit
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete