![]() |
Here's what I want to do:
Add in 2 extra fields in the member's "Edit Profile" template inquiring if they are a member of 2 organizations (yes/no option) The variable names will be "ncm" and "ncrs". When they select yes or no under Edit Profile, it will show up in their user profiles. I could have added a customfield and made it easy, however, I don't want them to appear under the other customfields such as birthday, location, etc. I have a separate section in their profiles called "Memeberships" where I want this information to appear. I've gone into the database and added two fields, both tinyint(4). My question is, where in the member.php do I add these options in to be handled by the database and how would I write the code? |
In Member.php
find: PHP Code:
PHP Code:
Remember to update your templates as well. |
Thanks Wayne. I made what I believe are the necessary changes to the member.php, but didn't work.
I'm not sure if this would make a difference or not, but I wasn't planning on including the options in the registration form. Reason being, I wanted to minimize the amount of stuff in the registration form and give the user the option of dealing with it under "Edit Profile" once they have registered. I did hack the edit profile template, but the yes/no option is defaulted to "no". If I go in and set them to yes and save the settings, when I go back in, they are still defaulted to "no" and do not show up in the member's profile. Any ideas? |
IN the section for loading the modify profile template, you will need to add some parts similar to:
if ($bbuserinfo[ncm]) { $ncmchecked="checked"; $ncmnotchecked=""; } else { $ncmchecked=""; $ncmnotchecked="checked"; } You will then need to modify the template to show the checked and not checked variables next to the appropriate radio buttons. |
Still not working. :( I've tried everything and I can get the information to populate in the user's profile. This is the code I'm using in the modifyprofile template:
<input type="radio" name="ncm" value="yes" $ncmnotchecked> yes <input type="radio" name="ncm"value="no" $ncmchecked> no I've changed the data type in the database to varchar(4) since I want a "Yes" "No" to appear in the user's profile. For some reason, I just can't get it to work. Each time I check off yes or no in the Edit Profile, and go back to the page, it show the options as being unchecked. Any ideas? -Rob |
I managed to get this to partially work finally. The problem is this: if you go into Edit Options, and you check "yes" or " no" (radio buttons) and submit, it updates the user's profile. However, when you go back into Edit Options, neither button is checked. If you make any changes to your profile, or just click the submit button again, it wipes out that yes/no setting that you previous set in the user's profile. I noticed the same problem with Tubedogg's Community Bulletin generator hack where the user has the option of receiving the bulletin (yes/no radio buttons) in under Edit Options.
Does anyone have any ideas how to fix this? |
^^^^bump....anyone?
|
Quote:
Code:
if ($bbuserinfo[receivebulletin]) { |
Kevin,
Thanks, but this doesn't solve my original problem. That piece of code which you cited is what was missing out of member.php and did solve the problem for the Community Bulletin Generator hack, however, I used that same piece of code which wluke suggested but modified it with the correct variables. It still doesn't work. Maybe I'm not explaining the problem clearly. I have set up two option in Edit Profile which are radio buttons (yes/no) asking the user if they are a member of a particular organization. Depending on what they choose, that option will show up as Yes or No in their Member Profile. If you go into Edit Profile, both Yes and No are not checked. If you check one of them, the result will show up in the Member Profile. However, when you go back into Edit Profile, both options are unchecked again and if you make any other changes to profile and submit, it wipes out whatever was previously set for those two organizations thus wiping out the "Yes" or "No" in their profile. Here is the code I have in Member.php: PHP Code:
This is the code in the modifyprofile template: PHP Code:
|
Are ncm and ncrs the name of the columns in userfield? Or are they named field5, field6, etc.? That would be one reason why it isn't picking them up.
|
they are named ncm and ncrs.
|
I guess I'll give this one last bump before I abandon the idea.....anyone? ^^bump^^
|
Do you want this moved to Hacks?
|
Sure. Maybe that's where I should have posted it in the first place. I didn't think it would really be considered much of a hack, but someone over there might be able to help. Thanks Freddie.
|
RobAC,
I am still new at this database stuff (yes still working on the project I told ya about.. pain in the...) anyways.. can't you just set the default in the database to No. or would that even make a difference when it comes time to make changes in the control panel. Cause the code looks good to me, so it works, but does not keep it when you relogin to edit something else. I will see what I can do to help you out on this one... if you want, pm all the code and every you are using, or... I will just off of what you have put in the previous replies and I will insert it all in my to board.. and see if I can get it to work. |
Thanks Brad. I've tried everything to no avail. Regardless of what you set the default to, it won't hold the value.
|
that is puzzling.. I would think it would go one way or another automatically.. then again I have seen it do just what your talking about.
I wonder if there is a missing code part to making one of them default in the html part of the code. like radio1, radio2, set radio2 default.. no this is not html code heh. |
I think there is a missing chunk of code in the member.php file which I can't seem to create.
|
look at this code..
<input type="radio" value="V1" checked name="R1"><input type="radio" name="R1" value="V2"><input type="radio" name="R1" value="V3"> see the value that says.. checked name.... that might be what you need to enter. |
That's basically what I have. It's the same as saying $ncrschecked or $ncmchecked. :(
|
yah it is..
did you add 2 fields to the database table?... if so.. did ya make one of them default? trying to find the little blurb... before we dig into the member.php file :) |
Nope, neither one of them are defaulted.
-Rob |
Well I guess we will have to dig deeper...
I will try to figure something when I get off work.. later tonight.. but I can't promise anything heh. |
Cool. Thanks Brad. No rush. Hell, I've waited this long already. LOL
-Rob |
:)
I wish I was smarter with php and everything.. so that we could get this resolved :) I still have about 70% to do on my latest project heh.. but I tell ya it is helping me learn a lot.. :) trial and error style mostly :) |
RobAc,
I have been playing with.. my crap still, and instead of radio buttons I am using a drop down value.. and I have ran into the same somewhat problem as you. There is a Default Value = NA that it keeps going back to instead of the other 2. Like when I select it and save, it does it and when I view it in the member's profile it shows it but when I go back in to change something else, it will go back to default. What I did to fix it, considering I have no clue why it won't take characters just numbers :( I put default value as = -1 and the others are 1 and 2.. now it works... for some odd reason. Anyone know if you have to have "A" or 'B' or just leave it as the character for it to work properly. |
I have got this to work.. but using different code.. but mine works now.. Rob... so contact me through email.. and maybe we can work together for ya to get this to work.
|
Cool. Will do. Thanks Brad!
-Rob |
Finally making headway..... well somewhat with my current project and I have had to do some things like this...
|
RobAC.
check your private messages bud... I think I have this done for you, now we will have to change some things around for ya :) |
All times are GMT. The time now is 01:49 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|