vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   register.php (https://vborg.vbsupport.ru/showthread.php?t=46058)

mishkan 11-24-2002 06:15 AM

register.php
 
Please forgive me if this post is in the wrong place. Mods, please move to the appropriate forum. Thanks!

I want to display these variables in the error_moderateuser template.
- custom user field # 5
- custom user field # 6
- the user's email address

By doing a lot of searching and reading, I now understand that I must edit one of my php files. Specifically, I need to change the register.php file, according to the "vBulletin 2.0 Template Reference" in the members area.

Question is... exactly what changes do I make to register.php?

Thanks for any help!

mishkan 11-24-2002 02:54 PM

Just clarifying... the only change I need to make to register.php is just so I can access those particular variables from within the error_moderateuser template. I'm guessing this is something really simple, like from a "php 101" class... LOL... but I'm truly a newbie. So, thanks for any help! :)

JulianD 11-24-2002 03:02 PM

You can edit the template and use variables like:

$bbuserinfo[email] for the email address.
$bbuserinfo[field5] for the field 5
$bbuserinfo[field6] for the field 6.

Is that what you want?

mishkan 11-24-2002 03:25 PM

Julian, thanks for your response! :) I tried putting the following code into the error_moderateuser template, to see what would happen...

field 5 = $bbuserinfo[field5] < br>
field 6 = $bbuserinfo[field6] < br>
email = $bbuserinfo[email] < br>


But, it didn't work. The following output was displayed on the screen...

field 5 =
field 6 =
email =


The variables didn't work. Anyone know how to hack the register.php file, in order to make those variables accessible in the error_moderateuser template? Thanks again for any help!

JulianD 11-24-2002 03:49 PM

Oh. Now I understand.

It doesn't work with the above variables because those variables aren't created when the user signup.

Instead, you must use the variables submitted by the registration form...

Like this

Field 5 = $field5
Field 6 = $field6
email = $email

Hope this helps.

mishkan 11-24-2002 04:09 PM

1 Attachment(s)
Nope, still didn't work. :(

Here's the code I put into the error_moderateuser template...

Field 5 = $field5 < br>
Field 6 = $field6 < br>
email = $email < br>


And, I'm attaching a photo of what the output looks like.
Please keep the ideas coming, though! Thanks!

JulianD 11-24-2002 04:52 PM

OK. Let's take a look:

Do you have email verification activated?

mishkan 11-24-2002 07:51 PM

Sorry, I was out doing chores, and I have to run out again. Do you mean you want to try registering on my board? It's a private board, so I can't post the URL.

Can you try putting that code in your error_moderateuser template? Or is there another way I can help you troubleshoot?

JulianD 11-24-2002 10:06 PM

No, I don't want to register on your board.

The problem is that the solution above won't work if you have email verification activated. To get the custom profile fields in error_moderateuser, you will have to hack register.php a little.

Try this:


Find this:

PHP Code:

            $DB_site->query("UPDATE user SET usergroupid=4$dotitle WHERE userid='$u'"); 

After it, add:

PHP Code:

            $userprofile $DB_site->query_first("SELECT * FROM useractivation WHERE userid='$u'"); 

Now in error_moderateuser, to display the email you can use $userinfo[email] and for the custom profile fields, use $userprofile[field6], $userprofile[field7], etc....

Tell me if it works.

mishkan 11-25-2002 01:14 AM

Here's the new code in the register.php file.
PHP Code:

 $username $userinfo['username'];
$DB_site->query("UPDATE user SET usergroupid=4$dotitle WHERE userid='$u'");
$userprofile $DB_site->query_first("SELECT * FROM useractivation WHERE userid='$u'");
eval(
"standarderror(\"".gettemplate("error_moderateuser")."\");"); 

Here's the code I put into the error_moderateuser template.
PHP Code:

 field 5 $bbuserinfo[field5] <br>
field 6 $bbuserinfo[field6] <br>
username $bbuserinfo[username] <br>
email $bbuserinfo[email] <br>
================== <
br>
field 5 $field5 <br>
field 6 $field6 <br>
email $email <br>
================== <
br>
field 5 $userprofile[field5] <br>
field 6 $userprofile[field6] <br>
email $userinfo[email] <br>
================== <
br
<
br>
Thank you for registering$username

And here's what was displayed by the error_moderateuser template.

[color=sky blue] field 5 = Jane Doe
field 6 = 123
username = test
email = my-email-address@my-domain.com
==================
field 5 =
field 6 =
email =
==================
field 5 =
field 6 =
email = my-email-address@my-domain.com
==================

Thank you for registering, test.
[/color]



In summary, these variables worked.
  • field 5 = $bbuserinfo[field5]
  • field 6 = $bbuserinfo[field6]
  • username = $bbuserinfo[username]
    username = $username
  • email = $bbuserinfo[email]
    email = $userinfo[email]

As long as the data is being displayed correctly,
does it matter which variables I use?

BTW, thanks for all your help.
It's such a great feeling to be making progress! :)


All times are GMT. The time now is 03: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.01568 seconds
  • Memory Usage 1,753KB
  • 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)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete