PDA

View Full Version : Custom Profile Field 2- need extra code


leon2u
08-27-2002, 04:19 PM
I now have the following problem.....I adjusted my member.php en register.php and created a template which contains the '700-' in front see also posting https://vborg.vbsupport.ru/showthread.php?threadid=42774&goto=newpost

But now whenever I create a required field this '700-' is in front of all screens.....so I need some extra coding I believe...see post below for snapshots....

Plz help

leon2u
08-27-2002, 04:20 PM
Snapshot 2

leon2u
08-27-2002, 04:24 PM
Somewhere between this I need some extra code to use another template if the customprofile field is not identical to his ID-number!

The Serial field has an ID-number of let's assume 5...

SO the coding must be like this......

IF ID = 5 then gettemplate X
ELSE get gettemplate Z

Even better would it be to use only
IF ID = 5 then......
IF .........
IF......
SO you can use a lot of diffent style for your boxes....

Let me know

leon2u
08-27-2002, 09:07 PM
BUMP

Logician
08-27-2002, 09:14 PM
if ($profilefield[title]=='XXXXX') {eval("\$customfields_required .= \"".gettemplate("register_customfields_kg")."\";");}
else {eval("\$customfields_required .= \"".gettemplate("register_customfields")."\";");}

Replace XXXXX with the name of your profile field (it should be exact and be careful about caps too)

leon2u
08-28-2002, 05:53 AM
It works :laugh: great, see my attachment....

I got another question ;)

Is it possible to have Radio Button-boxes instead of those textboxes for custom User Profile Fields???

If so how do I do it???

Logician
08-28-2002, 07:16 AM
Is it possible to have Radio Button-boxes instead of those textboxes for custom User Profile Fields???


Use the same logic:


if ($profilefield[title]=='XXXXX') {eval("\$customfields_required .= \"".gettemplate("register_customfields_kg")."\";");}

elseif ($profilefield[title]=='YYYY') {eval("\$customfields_required .= \"".gettemplate("register_radiobuttons")."\";");}

else {eval("\$customfields_required .= \"".gettemplate
("register_customfields")."\";");}


Create and design "register_radiobuttons" template accordingly..

As for your question in PM: Yes basically you need to reinstall your hacks if you upgrade your board to a new version. However if you use tools like Beyond Compare or Araxis Merge, things can get easier. Search these words in vb.org and you'll learn how.. :)

leon2u
08-28-2002, 08:07 AM
Do I need a space between elsif?

So that it is 'else if'?

------------------ posted code before -------------------------------------

if ($profilefield[title]=='XXXXX') {eval("\$customfields_required .= \"".gettemplate("register_customfields_kg")."\";");}

elseif ($profilefield[title]=='YYYY') {eval("\$customfields_required .= \"".gettemplate("register_radiobuttons")."\";");}

else {eval("\$customfields_required .= \"".gettemplate
("register_customfields")."\";");}

Logician
08-28-2002, 08:08 AM
no space.. it's "elseif"

leon2u
08-28-2002, 09:07 AM
See snapshot one.jpg

leon2u
08-28-2002, 09:09 AM
See snapshot....

But now when I update my profiele it keeps saying that I need to fill out an required field.....I want to have user filled out the exact way it looks on the snapshot so with the choice of a dealer and to check a radio button....

How do I do this....which more steps do I need to take?

Thanx