The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
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? |
#2
|
||||
|
||||
In Member.php
find: PHP Code:
PHP Code:
Remember to update your templates as well. |
#3
|
|||
|
|||
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? |
#4
|
||||
|
||||
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. |
#5
|
|||
|
|||
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 |
#6
|
|||
|
|||
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? |
#7
|
|||
|
|||
^^^^bump....anyone?
|
#8
|
||||
|
||||
Quote:
Code:
if ($bbuserinfo[receivebulletin]) { $receivebulletinchecked = " checked"; $receivebulletinnotchecked = ""; } else { $receivebulletinchecked = ""; $receivebulletinnotchecked = " checked"; } |
#9
|
|||
|
|||
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:
|
#10
|
||||
|
||||
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.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|