#57203
02/02/2004 3:18 PM
|
Joined: Sep 2001
Posts: 672
Member
|
Member
Joined: Sep 2001
Posts: 672 |
I was gonna add a dropdown to my custom field 4. My intentions are to have the options, single, taken or datingI know i still need to edit the register files, but for the public_edit_profile, I need to make sure im on the right track and not outta wack here. Find This:if (($vars_registration{custom4_field_use} ne 'DEL') && ($vars_registration{customfield4}
ne '')) {
if ($vars_registration{custom4_field_use} eq 'REQ') { $B1 = '<b>'; $B2 = '</b>'; } else { $B1 = ''; $B2 = ''; } after it add this:if($user_profile[18] eq 'Single') { my $singleselect = qq! selected="selected"!; } else { my $singleselect = qq! !; }
if($user_profile[18] eq 'Dating') { my $datingselect = qq! selected="selected"!; } else { my $datingselect = qq! !; }
if($user_profile[18] eq 'Taken') { my $takenselect = qq! selected="selected"!; } else { my $takenselect = qq! !; }
if($user_profile[18] eq '') { my $takenselect = qq! selected="selected"!; } else { my $takenselect = qq! !; } Find This:<input type="text" name="customfield4" value="$user_profile[19]" size="35" maxlength="80" /> Replace With:<select name="customfield4"> <option value="Single" $singleselect>$vars_wordlets_mods{single_option}</option> <option value="Dating" $datingselect>$vars_wordlets_mods{dating_option}</option> <option value="Taken" $takenselect>$vars_wordlets_mods{taken_option}</option> </select> and then in vars_wordlets_mods: q!single_option! => q!Single!, q!dating_option! => q!Dating!, q!taken_option! => q!Taken!, Yes ? No ? Any help?
|
|
|
#57204
02/02/2004 4:02 PM
|
Joined: Jan 2000
Posts: 5,073
Admin Emeritus
|
Admin Emeritus
Joined: Jan 2000
Posts: 5,073 |
"my" scopes the variable to that block - you need to declare the variables using my outside of the if blocks.
Otherwise this looks like it should work...
UBB.classic: Love it or hate it, it was mine.
|
|
|
#57205
02/03/2004 5:09 PM
|
Joined: Sep 2001
Posts: 672
Member
|
Member
Joined: Sep 2001
Posts: 672 |
outside? can u give me an example charles? Im all new to this stuff
|
|
|
#57206
02/03/2004 5:31 PM
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
Joined: Jan 2003
Posts: 3,456 Likes: 2 |
instead of if($user_profile[18] eq 'Dating') { my $datingselect = qq! selected="selected"!; } else { my $datingselect = qq! !; } do my $datingselect; if($user_profile[18] eq 'Dating') { $datingselect = qq! selected="selected"!; } else { $datingselect = qq! !; }
|
|
|
#57207
02/03/2004 6:56 PM
|
Joined: Jan 2000
Posts: 5,073
Admin Emeritus
|
Admin Emeritus
Joined: Jan 2000
Posts: 5,073 |
It would probably be better to do it inline, now that I think about it: my $datingselect = ($user_profile[18] eq 'Dating' ? qq! selected="selected"! : "");
UBB.classic: Love it or hate it, it was mine.
|
|
|
#57208
02/03/2004 8:50 PM
|
Joined: Sep 2001
Posts: 672
Member
|
Member
Joined: Sep 2001
Posts: 672 |
is user profile[18] right though too? Where can i find out what all the user profile numbers mean?
And do I do this same code in the registration files?
|
|
|
#57209
02/03/2004 9:19 PM
|
Joined: Jan 2000
Posts: 5,073
Admin Emeritus
|
Admin Emeritus
Joined: Jan 2000
Posts: 5,073 |
There's a nice guide at the bottom of cp2_membermanage. The registration template is a far different animal than the edit template...
UBB.classic: Love it or hate it, it was mine.
|
|
|
#57210
02/03/2004 10:36 PM
|
Joined: Sep 2001
Posts: 672
Member
|
Member
Joined: Sep 2001
Posts: 672 |
Ok so what about public_register_form Find$vars_registration{customfield4}, "", "customfield4", "text", 35, 80, 0); Replace with$vars_registration{customfield3}, "", "customfield3", "dropdown", { Single => $vars_wordlets_mods{single_option}, Dating => $vars_wordlets_mods{dating_option}, Taken => $vars_wordlets_mods{taken_option} }, [qw(Single Dating Taken)], Single); I think theres gotta be more though?
|
|
|
#57211
02/03/2004 11:25 PM
|
Joined: Sep 2001
Posts: 672
Member
|
Member
Joined: Sep 2001
Posts: 672 |
Actually Im just gonna use the radio button, its easier it seems so now I have this my $singleselect; if($user_profile[18] eq 'Single') { $singleselect = qq! selected="selected"!; } else { $singleselect = qq! !; } my $datingselect; if($user_profile[18] eq 'Dating') { $datingselect = qq! selected="selected"!; } else { $datingselect = qq! !; }
my $takenselect; if($user_profile[18] eq 'Taken') { $takenselect = qq! selected="selected"!; } else { $takenselect = qq! !; } my $takenselect; if($user_profile[18] eq '') { $takenselect = qq! selected="selected"!; } else { $takenselect = qq! !; } and this <input type="radio" name="customfield4" value="Single" $singleselect />
$vars_wordlets_mods{single_option}
<input type="radio" name="customfield4" value="Dating" $datingselect />
$vars_wordlets_mods{dating_option}
<input type="radio" name="customfield4" value="Taken" $takenselect />
$vars_wordlets_mods{taken_option} it works, however if u go back into ur profile, the radio buttons arnt checked. It doesnt save your setting. How do u make it do this?
|
|
|
#57212
02/04/2004 7:06 PM
|
Joined: Sep 2001
Posts: 672
Member
|
Member
Joined: Sep 2001
Posts: 672 |
Change of plans Need help Stillif($user_profile[18] eq 'Single') { $datingselect = ''; $takenselect = ''; $singleselect = qq( checked="checked");
} elsif($user_profile[18] eq 'Dating') $singleselect = ''; $takenselect = ''; $datingselect = qq( checked="checked");
} else { $singleselect = ''; $datingselect = ''; $takenselect = qq( checked="checked"); }
|
|
|
#57213
02/04/2004 10:51 PM
|
Joined: Jan 2000
Posts: 5,073
Admin Emeritus
|
Admin Emeritus
Joined: Jan 2000
Posts: 5,073 |
That looks right.........
UBB.classic: Love it or hate it, it was mine.
|
|
|
#57214
02/04/2004 11:49 PM
|
Joined: Sep 2001
Posts: 672
Member
|
Member
Joined: Sep 2001
Posts: 672 |
too bad it doesnt work ;(
Whenever you go back in ur profile, TAKEN is always the default one selected. EVen if you select SINGLE
|
|
|
#57215
02/05/2004 1:37 AM
|
Joined: Jan 2000
Posts: 5,073
Admin Emeritus
|
Admin Emeritus
Joined: Jan 2000
Posts: 5,073 |
Does the profile itself get updated properly?
UBB.classic: Love it or hate it, it was mine.
|
|
|
#57216
02/05/2004 9:47 AM
|
Joined: Sep 2001
Posts: 672
Member
|
Member
Joined: Sep 2001
Posts: 672 |
seems to be. it just defaults back to "taken" every time u go back into the profile. Very strange
|
|
|
#57217
02/05/2004 2:20 PM
|
Joined: Jan 2000
Posts: 5,073
Admin Emeritus
|
Admin Emeritus
Joined: Jan 2000
Posts: 5,073 |
Have it print $user_profile[18] somewhere on the page, just to verify that things have taken hold.
UBB.classic: Love it or hate it, it was mine.
|
|
|
#57219
02/05/2004 3:11 PM
|
Joined: Jan 2000
Posts: 5,073
Admin Emeritus
|
Admin Emeritus
Joined: Jan 2000
Posts: 5,073 |
Well, that explains that. You'll need to choose one of the other custom fields for this then...
UBB.classic: Love it or hate it, it was mine.
|
|
|
#57220
02/05/2004 4:15 PM
|
Joined: Sep 2001
Posts: 672
Member
|
Member
Joined: Sep 2001
Posts: 672 |
Originally posted by Charles Capps:
Well, that explains that. You'll need to choose one of the other custom fields for this then...
No, Im using customfield4, for the dating thing. I used customfield3 for the male/female. So it should work fine right?
|
|
|
#57221
02/05/2004 5:30 PM
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
Joined: Jan 2003
Posts: 3,456 Likes: 2 |
havoq, your using custom field 3 here, and there, which screwed up your ouput. Originally posted by havoq: Ok so what about public_register_form Find$vars_registration{customfield4}, "", "customfield4", "text", 35, 80, 0); Replace with$vars_registration{customfield3}, "", "customfield3", "dropdown", { Single => $vars_wordlets_mods{single_option}, Dating => $vars_wordlets_mods{dating_option}, Taken => $vars_wordlets_mods{taken_option} }, [qw(Single Dating Taken)], Single); I think theres gotta be more though? First, here, you replaces the customfield 3 input with the custom field 4 code. Custom field 4 is 19, my mod used custom field 3, 18
|
|
|
#57222
02/05/2004 5:48 PM
|
Joined: Sep 2001
Posts: 672
Member
|
Member
Joined: Sep 2001
Posts: 672 |
oooooooooooooooo, crap, didnt think about that.
Ok I'll try it with [19] and get back with you guys.
Thanks Ian!
|
|
|
#57223
02/05/2004 6:02 PM
|
Joined: Sep 2001
Posts: 672
Member
|
Member
Joined: Sep 2001
Posts: 672 |
Ok it works perfect now! But how would I make it so that NONE of the radio's are checked when you ENTER into your profile. Im making it an optional field. So basically now, the choice TAKEN is default selected, which means the member HAS TO CHOOSE a selection.
I want it so that NONE of the radio's are checked when you enter into your profile
|
|
|
#57224
02/05/2004 10:06 PM
|
Joined: Sep 2001
Posts: 672
Member
|
Member
Joined: Sep 2001
Posts: 672 |
nevermind, figured it outI had to add this } elsif($user_profile[19] eq 'Taken') {
$singleselect = ''; $datingselect = ''; $takenselect = qq( checked="checked"); } else {
$singleselect = ''; $datingselect = ''; $takenselect = ''; }
|
|
|
#57225
02/05/2004 10:22 PM
|
Joined: Jan 2000
Posts: 5,073
Admin Emeritus
|
Admin Emeritus
Joined: Jan 2000
Posts: 5,073 |
That sounds about right.
UBB.classic: Love it or hate it, it was mine.
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 417
Joined: November 2001
|
|
Forums63
Topics37,574
Posts293,926
Members13,850
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|