Computer Help Forum

Go Back   vBulletin and Computer Help Forum > vBulletin Support > vBulletin Forum Software

vBulletin Forum Software Get help with vBulletin settings, permissions or general configuration issues here.

Reply
 
Thread Tools Display Modes
Old 12-05-2008   #1
Dave
Member
 
Dave's Avatar
 
Join Date: Jun 2005
Posts: 89
Saving options from custom page

So I've got a custom vBulletin powered vBulletin page. Doesn't contain anything real interesting.

i've got an option lets call it "Opt in email updates" :lol:

I've got the checkbox displaying, the text displaying, on my custom page no problem. But whenever someone checks or unchecks the box its not saving properly.

I've lookedd through probably 6-7 different modifications tonight trying to figure out how they've done it and for some reason, I just can't wrap my head around it
Dave is offline   Reply With Quote
Old 12-05-2008   #2
Greg
Administrator
 
Greg's Avatar
 
Join Date: Feb 2003
Location: Florida
Posts: 5,173
You don't supply enough information. Are you trying to set a user option or setting for a member?
__________________
Computers and Accessories Computer Manuals Riderinfo Connect for Bikers
Ad Revenue - Sell link space on your website and profit.
Greg is offline   Reply With Quote
Old 12-05-2008   #3
Dave
Member
 
Dave's Avatar
 
Join Date: Jun 2005
Posts: 89
Just an individual setting from a profile field.\

I tried taking code from register.php that looked like it was used for displaying profile fields and saving them, but didnt work, and i can't find any resources or tutorials for it >.<
Dave is offline   Reply With Quote
Old 12-05-2008   #4
Greg
Administrator
 
Greg's Avatar
 
Join Date: Feb 2003
Location: Florida
Posts: 5,173
To save one setting, you have to hook in and fetch all the user info, depending where you are, into the DM. The hook is usually right before save is called. So if the userdata is all set and you hook just before save, set your setting, thell the DM it is allowed, and then let the script continue to the save. If it's a new field that is not usually in the user table, you have to tell the data manager it is allowed before saving the settings.

To do an option, the easiest way is the data manager. To do a new field in the user table like the eznl field, you could do a query. But that usually adds a query.

On the other side though, once it's in the table, you can read it from $vbulletin->userinfo.

You have to do the above with hooks at any place you want that setting to be available to update it. On the display side have a hook to place and configure your input box or whatever input you use or you edit a temaplate. On the save side you have to get it from the $_POST array through the GPC cleaner, tell the DM it is allowed, set it and let the script continue on to save.
__________________
Computers and Accessories Computer Manuals Riderinfo Connect for Bikers
Ad Revenue - Sell link space on your website and profit.
Greg is offline   Reply With Quote
Old 12-06-2008   #5
Dave
Member
 
Dave's Avatar
 
Join Date: Jun 2005
Posts: 89
Thanks Greg With your help and tips i've got custom profile fields showing up and saving properly

Now off to get it to save the EZNL check box
Dave is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 04:43 AM.



vBulletin 3.8.7 Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright vB and Computer Help Forum

EZ software products copyright Greg Lynch 2006-2013