vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Adding Profile fieldss to Postbit (https://vborg.vbsupport.ru/showthread.php?t=307886)

RichieBoy67 02-03-2014 09:19 PM

Adding Profile fieldss to Postbit
 
I have added conditionals that display some new profile fields in my postbit_legacy template. The problem I am having is making these fields show up when the member has not yet added any info. I know this should be easy but I am doing something wrong.

I need the field to show up so members know they can add their info.

Thanks,
Rich

ozzy47 02-03-2014 09:37 PM

What is the code you are currently using?

RichieBoy67 02-03-2014 10:12 PM

Thanks, right now just the basic conditional

PHP Code:

<vb:if condition="$post['field7']"><dt>Height</dt> <dd>{vb:raw post.field7}</dd></vb:if> 


ozzy47 02-03-2014 10:28 PM

Try something like this:
Code:

                        <vb:if condition="$post['field7'] != ''">
                                <dt>Height</dt> <dd>{vb:raw post.field7}</dd>
                        <vb:else />
                                <dt>Edit Your Profile to fill in information</dt>
                        </vb:if>

You can change, Edit Your Profile to fill in information to suit your needs.

RichieBoy67 02-03-2014 10:32 PM

I actually tried something like that but I did not add text. I may have messed up though,

I will try this,
Thanks Ozzy!

#Update - ok, I see what I did before. In the else statement I put ___ thinking it would show Height___ if the info was not added. I should have just put Height in the text field. Doh Thanks again

ozzy47 02-03-2014 10:40 PM

No problem, glad it's working now. :)

RichieBoy67 02-03-2014 11:19 PM

I had it working but alignment was messed up. I have a few fields I want members to see so they know they can enter their info. I may need to do a little more work to get it to display properly.

ozzy47 02-03-2014 11:21 PM

What is the alignment issue? Perhaps a link so I can see what you got going on live.

RichieBoy67 02-03-2014 11:32 PM

Sure,

https://vborg.vbsupport.ru/external/2014/02/1.bmp

when filled it looks like this

https://vborg.vbsupport.ru/external/2014/02/2.bmp

I don't have a link because I put the standard conditional back while i figure it out.

ozzy47 02-03-2014 11:38 PM

Here ya go:

Code:

                        <vb:if condition="$post['field7'] != ''">
                                <dt>Height</dt> <dd>{vb:raw post.field7}</dd>
                        <vb:else />
                                <dt style="padding-left:10px;">Height</dt>
                        </vb:if>

Adjust 10px as needed. :)


All times are GMT. The time now is 09:13 AM.

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.02155 seconds
  • Memory Usage 1,737KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete