vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Custom Field - Inputting Info Automatically. (https://vborg.vbsupport.ru/showthread.php?t=46134)

dogbomb 11-26-2002 08:07 PM

Custom Field - Inputting Info Automatically.
 
Hey.

I have a custom profile field on my forums. It is not required, not hidden and not editable.

When someone signs up to the site, I want to set this at a start value of 1...

What would be the best way to do this?

profilefieldid=5 if that info helps.

Thanks in advance for any help or advice.

Xenon 11-27-2002 11:45 AM

open your register.php and find this:
PHP Code:

  while ($profilefield=$DB_site->fetch_array($profilefields)) {
    
$havefields 1;
    
$varname="field$profilefield[profilefieldid]";
    if (
$profilefield[required] and $$varname=="") {
      eval(
"standarderror(\"".gettemplate("error_requiredfieldmissing")."\");");
      exit;
    }
    $
$varname=censortext($$varname);
    
// ENTER ANY CUSTOM FIELD VALIDATION HERE!
    //Make sure user didn't try to bypass the maxchars for the fields
    
$$varname=substr($$varname,0,$profilefield[maxlength]);
    
$userfieldsnames.=",field$profilefield[profilefieldid]";
    
$userfields.=",'".addslashes(htmlspecialchars($$varname))."'";
  } 

change it to:
PHP Code:

  while ($profilefield=$DB_site->fetch_array($profilefields)) {
    
$havefields 1;
    
$varname="field$profilefield[profilefieldid]";
    if (
$profilefield[required] and $$varname=="") {
      eval(
"standarderror(\"".gettemplate("error_requiredfieldmissing")."\");");
      exit;
    }
    $
$varname=censortext($$varname);
    
// ENTER ANY CUSTOM FIELD VALIDATION HERE!
    //Make sure user didn't try to bypass the maxchars for the fields
    
$$varname=substr($$varname,0,$profilefield[maxlength]);
    
$userfieldsnames.=",field$profilefield[profilefieldid]";
    if(
$profilefield[profilefieldid]==5) $$varname=1;
  
$userfields.=",'".addslashes(htmlspecialchars($$varname))."'";
  } 


dogbomb 11-27-2002 01:03 PM

That kills register.php :|

Xenon 11-27-2002 01:10 PM

can you be a bit more specific?

error?

which message?

dogbomb 11-27-2002 01:30 PM

No error... gives out a blank page.

Xenon 11-27-2002 06:02 PM

hmm, cannot be normally
perhaps you have uploaded the file incorrectly...

try it again, be sure it's saved as pure ASCII

dogbomb 11-27-2002 06:04 PM

I did. I even tried editing it directly in the shell.

I got the page to show when I changed

PHP Code:

if($profilefield[profilefieldid]==5]) $$varname=1

to:

PHP Code:

if($profilefield[profilefieldid]==5) $$varname=1

but it still didn't work :(

dogbomb 11-30-2002 12:25 PM

As yet I am unable to fix this... anyone got any more ideas?


All times are GMT. The time now is 07:26 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.01053 seconds
  • Memory Usage 1,738KB
  • 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
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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