vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   where in register.php can I add some custom db inputs.... (https://vborg.vbsupport.ru/showthread.php?t=172638)

fearfx 03-10-2008 05:42 PM

where in register.php can I add some custom db inputs....
 
In the register php file, at what point can I add my own mysql query.

Basically, at what point is the user fully registered, but before the page goes to the thank you page... I want to do some certain things with php. I hope anyone can understand this.

And thanks for the help!

shovel 03-10-2008 07:21 PM

Absolutely. Rather than modifying your documents, leave them be and create a hook via the AdminCP.

Goto...
AdminCP -> (left menu) Products & Plugins -> Plugin Manager

Click "Add New Plugin" and point your hook location to register_form_complete. You can begin your PHP modification there. :)

Opserty 03-10-2008 07:52 PM

I think you want addmember_complete or something like that.

register_form_complete is executed when the form is displayed, as opposed to when the data is processed.

fearfx 03-15-2008 09:15 PM

Thanks for the help... Now if want to use the newly registered persons, id number(example: member.php?u=23

whats the variable name, and is there a list of all variable names anywhere?

Thanks for the help.

Lynne 03-15-2008 09:20 PM

If you use register_addmember_complete, I believe $userid is available for use at that point.

I don't know of a list of others available. You can look in the register.php page and see what is defined right before the hook you use.

Scuzzy 03-21-2008 04:14 AM

I've noticed there are no template hooks in the registry pages. Is it possible, without modifying the registry template itself, to add another required field to the user registration process? Any idea on how to accomplish this without modifying any generic vbulletin template?

Thanks

Marco van Herwaarden 03-21-2008 09:06 AM

AdminCP -> User Profile Fields.

Boofo 03-21-2008 09:30 AM

Marco hit it right on. The easiest way to do it.

Scuzzy 03-21-2008 11:08 AM

What I'd like to do is a little more difficult then that. The field needs to be a part of a plugin (so it would have to be installed when they install the plugin), it must be a drop down box, and it must contain information from a table other then one part of regular vbulletin. It's currently done by actually modifying the registry.php and changing the display of one user defined field, but I want to get out of direct modifications to vb code and templates and make this completely plugin driven.

Opserty 03-21-2008 11:28 AM

You will have to edit a template then, if you want to include custom HTML into the Registration Form. PHP code can be placed in a nearby Plugin and then use that to call and evaluate a template. Then use the variable, that the template is evaluated to, in the registration template.

Scuzzy 03-21-2008 07:06 PM

Quote:

Originally Posted by Opserty (Post 1470639)
You will have to edit a template then, if you want to include custom HTML into the Registration Form. PHP code can be placed in a nearby Plugin and then use that to call and evaluate a template. Then use the variable, that the template is evaluated to, in the registration template.

I found a way very similar to what your describing, but without editing a template. In order to add a custom set of fields to the actual registration form I did the following:
  1. Created a hook on register_activateform that appended my custom template form fields to $profile_variable
  2. Created another hook on register_addmember_process to pull and verify my form specific information.

If anyone thinks of any caveats to that I'd really like to hear them, but it appears to work very well, and I don't have to modify any regular VBulletin php files or templates.

Scuzzy

ilrglen 08-14-2009 07:17 PM

I would like to send new registrants to my payments.php page to purchase a membership before the registration process is completed. If there is no payment made then I would like the registrant deleted so that they cannot log in to any part of my site. I added a pluggin that redirects to payments.php after the registration page but discovered that the registration still goes through if they cancel the page or close the window. How can I get around this so that the registration process and payment process are one and the same?

ravistb 08-18-2009 07:34 PM

I've added some custom user profile fields, but I would like to insert them into a separate DB table for use in my non vb site. I've got the plugin on the register_addmember_complete hook, but am not sure how to refence what those fields were. From what I can see they are just called $userfield[field2], $userfield[field5], $userfield[field6]. What do I need to do in order to get these values into some sort of variable that I can insert into my table? I've tried setting a variable like $customfield1 = $vbulletin->userfield[field2]; but all the inserts into my table are just blank empty inserts.

Any help would be greatly appreciated.

Lynne 08-18-2009 07:43 PM

$vbulletin->userinfo[field2] is probably the correct variable, or it may be $vbulletin->GPC[field2] (or $vbulletin->GPC['field2'] depending on where you use it).

ravistb 08-18-2009 07:53 PM

Thank thank you! That was perfect!

Lynne 08-18-2009 08:02 PM

Which worked (in case someone else comes across this thread with the same question)?

ravistb 08-18-2009 10:19 PM

$vbulletin->userinfo[field2] was the correct one

ilrglen 08-31-2009 08:29 PM

Quote:

Originally Posted by Marco van Herwaarden (Post 1470544)
AdminCP -> User Profile Fields.

Is there a way to make the Location field a pulldown menu list that the user would be required to choose from? It would be nice to be able to get some consistent responses for this so that possible it could be used to sort users or make users from certain countries have access to certain forums. Any ideas?

Lynne 08-31-2009 08:57 PM

Take a look in the manual under User Profile Fields and you will see how to make a dropdown menu for it.

ilrglen 08-31-2009 09:21 PM

Quote:

Originally Posted by Lynne (Post 1877391)
Take a look in the manual under User Profile Fields and you will see how to make a dropdown menu for it.

Not sure how I missed that. Must have had a couple of pages stuck together. Thanks.

--------------- Added [DATE]1251760289[/DATE] at [TIME]1251760289[/TIME] ---------------

B U T . . . I now noticed there is a limit of 31 options allowed to pulldown menus. Any way that can be overridden?

Quote:

Originally Posted by ilrglen (Post 1877407)
Not sure how I missed that. Must have had a couple of pages stuck together. Thanks.


Lynne 08-31-2009 10:31 PM

Quote:

Originally Posted by ilrglen (Post 1877407)
B U T . . . I now noticed there is a limit of 31 options allowed to pulldown menus. Any way that can be overridden?

I don't think so. I think it has to do with the type of field it is. It may be that you can change it in the database. You may want to ask that question over on vb.com (I think that is where I have seen it brought up before).

Marco van Herwaarden 09-01-2009 08:07 AM

I think that limit is hardcoded.


All times are GMT. The time now is 05:19 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.01159 seconds
  • Memory Usage 1,759KB
  • 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
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (22)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