vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Add javascript button to VB registration page (https://vborg.vbsupport.ru/showthread.php?t=207018)

CampinCarl 03-01-2009 05:23 PM

Add javascript button to VB registration page
 
I'm trying to figure out how to add a button to the registration page that will run some javascript when clicked on.

Is there some option in the vb control panel that allows this, or do I have to modify some files or something?

Any help is greatly appreciated :)

Mr-Moo 03-01-2009 06:00 PM

Hello There,

I would love to help you!

If it is a javascript and includes no php then you can simply do this through the Vbulletin control panel. Please navigate yourself to the "Styles & Templates" and click on "Search in Templates".

You want to search for "register" and search in the template which is primary. Scroll through until you see a template file with the name "register". Double click and add your javascript code in the desired positions.

Hope that helps, let me know if you have any issues!

Dismounted 03-02-2009 05:08 AM

<a href="http://www.vbulletin.com/docs/html/styles_and_templates" target="_blank">The manual also talks about styles and templates.</a>

CampinCarl 03-08-2009 05:48 AM

Thank you both for your help this far. Now another question :)

I created 2 new textboxes via the template. Is there a way I can save the information the user enters in these textboxes to the users database?

I thought about editing the register.php file but then a vBulletin update might break my custom code?

Dismounted 03-08-2009 10:32 AM

What you are probably looking for is a custom profile field - again, have a look in the manual for that.

CampinCarl 03-08-2009 10:07 PM

Thanks, I actually knew about the custom user fields but didn't think to work my javascript around them.

Now one last question until I have this small project completed (and I did look in the manual but couldn't find help on it!):

When a user is registering, is it possible to check a custom field to see if another user already has the value in that field? I don't want any 2 users having the same value in the custom field I created.

Dismounted 03-09-2009 05:03 AM

To do that, you will need to add a plugin to check the fields, and spit an error if needed. The hook you probably want is userdata_presave.


All times are GMT. The time now is 05:02 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.00988 seconds
  • Memory Usage 1,717KB
  • 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
  • (7)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