vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Changing a profile field checkbox from vbadvanced (https://vborg.vbsupport.ru/showthread.php?t=134109)

Vitesse 12-16-2006 11:53 AM

Changing a profile field checkbox from vbadvanced
 
Hi guys, got a quick question

I'm looking at setting up a mailing list on my site and was planning to have say a submit button from within a template. What i effectively want to do is check to see if the logged in user has got field 5 in their profile checked (checkbox) and if not then check it and save the change. What is the best way to do this as my coding isnt great by any means.

Edit: Should have been a bit more specific about this really, i'm using vbadvanced portal, created a cusom module and want to have a submit button in that module that when clicked by the user will change field5 checkbox to checked in their profile.

Thanks

rogersnm 12-16-2006 02:28 PM

So you want a form which has a checkbox and a submit button which when pressed saves the status of the checkbox to the db.

Vitesse 12-17-2006 07:01 AM

Thanks for replying rogersnm

Not exactly, i've made a module that had a submit button that when clicked I want to change the value of a custom field in the users profile (field 5).

What I really need to know is what I would need to do php wise to actually make the change to the profile as 'm assuming it'd be a mysql query which im not overly familiar with.

What the entire thing is supposed to do is:

1) If the user has already checked the box via there profile or clicked the button, then the template displalys they already are subscribed (nearly done that hopefully)

2)If the user clicks the subscribe button, profile field 5 is checked in their profile to see if it's already marked, if not then it marks it and saves the user profile. <---- This is what im totally stuck on

rogersnm 12-17-2006 07:10 AM

So you want to link the button to a php script which will redirect once completed, which includes global.php (get field5 status and be able to query) and then one a query in a conditional.

Vitesse 12-17-2006 08:32 AM

Sort of, I've already done the testing within the template so the button wont show if the user is not logged in or is already subscribed, so what i'm after doing is just having the submit button i've added set the value of field 5 to 1 in the userCP for the user viewing the page

Thanks

rogersnm 12-17-2006 08:34 AM

I added your yahoo :)


All times are GMT. The time now is 05:29 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
  • Page Generation 0.01359 seconds
  • Memory Usage 1,714KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete