vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   (Easy enough) What is the right code, to get username in plugin (https://vborg.vbsupport.ru/showthread.php?t=211222)

basketmen 04-14-2009 08:45 PM

(Easy enough) What is the right code, to get username in plugin
 
i have a custom plugin, here is below the content


Quote:

if ($_POST['do'] == 'addmember')
{
if (empty($_POST['email']))
{
$_POST['emailconfirm'] = $_POST['email'] = 'username@mydomain.com';
}
else
{
$_POST['emailconfirm'] = $_POST['email'];
}
}




i want code in bold above to get member username




i had try put these code there

$username
$bbuserinfo[username]
$userinfo[username]
$userinfo['username']
$vbulletin->userinfo[username]
$vbulletin->userinfo['username']




but no one works, please help guys what is the right code to get member username in plugin

Dismounted 04-15-2009 05:20 AM

And the plugin is hooked at?

basketmen 04-15-2009 06:43 PM

Quote:

Originally Posted by Dismounted (Post 1791535)
And the plugin is hooked at?

the Hook is register_start


how is it guys, who know the right code to get member username in that plugin?

BBR-APBT 04-15-2009 07:18 PM

Quote:

Originally Posted by basketmen (Post 1791899)
the Hook is register_start


how is it guys, who know the right code to get member username in that plugin?

If you are doing that in register_start you wont be able to pull a username I don't think. Since they are just registering they don't have a username yet. When you are logged in it will not even let you go to the register page.

What exactly are you trying to do maybe we can help another way.

basketmen 04-15-2009 10:29 PM

Quote:

Originally Posted by BBR-APBT (Post 1791917)
If you are doing that in register_start you wont be able to pull a username I don't think. Since they are just registering they don't have a username yet. When you are logged in it will not even let you go to the register page.

What exactly are you trying to do maybe we can help another way.

i want to make member email when registering to username@myforumdomain.com


and this plugin almost working like that, just how to change username to each member real username


Quote:

if ($_POST['do'] == 'addmember')
{
if (empty($_POST['email']))
{
$_POST['emailconfirm'] = $_POST['email'] = 'username@mydomain.com';
}
else
{
$_POST['emailconfirm'] = $_POST['email'];
}
}




btw when people registering in domain.com/register.php and they wrong to type captcha, the username field is still already filled with they username (the registering proccess is not finishing yet), so maybe i can get that username in email field like that



if you know please let me know what is the code to get member username in plugin

BBR-APBT 04-15-2009 10:40 PM

Code:

$_POST['emailconfirm'] = $_POST['email'] = '$_POST['username']@mydomain.com';
Did you try the above code? Try it and let me know how it works for you.

Dismounted 04-16-2009 01:31 AM

PHP Code:

$customemail $vbulletin->GPC['username'] . '@mydomain.com'

BTW, you should really do is at _complete, or _process, as vBulletin still does checks before registering the user. Also, at _complete, you will have the full user details.

basketmen 04-21-2009 11:31 PM

Quote:

Originally Posted by Dismounted (Post 1792134)
PHP Code:

$customemail $vbulletin->GPC['username'] . '@mydomain.com'

BTW, you should really do is at _complete, or _process, as vBulletin still does checks before registering the user. Also, at _complete, you will have the full user details.

many thanks this is works

thank you for BBR-APBT too


regrads for both of you, GBU


All times are GMT. The time now is 03:58 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.01076 seconds
  • Memory Usage 1,737KB
  • 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)bbcode_code_printable
  • (2)bbcode_php_printable
  • (6)bbcode_quote_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