vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Adding a custom field under the avatar (https://vborg.vbsupport.ru/showthread.php?t=272933)

j1mmy 10-27-2011 09:14 PM

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

kh99 10-27-2011 10:18 PM

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).

j1mmy 10-28-2011 04:35 PM

Yes a custom profile field.

Do I edit both templates or just any of those two?

kh99 10-29-2011 12:06 AM

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.

j1mmy 10-29-2011 08:56 PM

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?

kh99 10-29-2011 11:52 PM

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>


j1mmy 10-30-2011 12:05 PM

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.

kh99 11-02-2011 12:44 PM

Quote:

Originally Posted by j1mmy (Post 2262887)
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>


All times are GMT. The time now is 10:09 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.01099 seconds
  • Memory Usage 1,731KB
  • 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
  • (5)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete