vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Small modification to register.php help request (https://vborg.vbsupport.ru/showthread.php?t=37811)

SWFans.net 04-24-2002 05:27 AM

Small modification to register.php help request
 
Alrighty, here is my scenario, which I don’t quite possess enough PHP knowledge to pull off :

I have set up a custom profile field to display within the postbit templates in only a certain set of subforums at our board, which I have given mods and admins the ability to edit.

I found a way, via use of a DB Query (thanks eva2000 @ vb.com) to set all currently registered users so that the custom field contains a default text value. What I would like to do is set it so that the field is automatically set up at registration with the same default text value.

Simple reasoning tells me that some PHP added to the register.php file could accomplish this, but in reality I am not skilled with PHP or MySQL, though I am not the least bit bothered by hacking and sometimes managing my own custom modifications.

The custom profile field ID is 6 and as I said, I just want to insert a default plain text value at registration, unbeknownst to the registering user. The field is already hidden during registration, and is not editable by the user.

Could a PHP guru give a guy a hand?

FWC 04-24-2002 06:31 AM

I don't know if this is the best way to do it, but it works on my test forum. In register.php find:
PHP Code:

$DB_site->query("INSERT INTO userfield $userfieldsnames VALUES ($userid$userfields)"); 

After that add:
PHP Code:

$DB_site->query("UPDATE userfield SET field6='Your Text Value' WHERE userid=$userid"); 


SWFans.net 04-24-2002 11:21 AM

Thank you very much for the assistance. It works just how I wanted. :)

FWC 04-25-2002 03:48 AM

Cool. :)


All times are GMT. The time now is 05:00 PM.

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.01195 seconds
  • Memory Usage 1,715KB
  • 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
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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