Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 04-14-2009, 08:45 PM
basketmen's Avatar
basketmen basketmen is offline
 
Join Date: Nov 2006
Posts: 446
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default (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
Reply With Quote
  #2  
Old 04-15-2009, 05:20 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

And the plugin is hooked at?
Reply With Quote
  #3  
Old 04-15-2009, 06:43 PM
basketmen's Avatar
basketmen basketmen is offline
 
Join Date: Nov 2006
Posts: 446
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dismounted View Post
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?
Reply With Quote
  #4  
Old 04-15-2009, 07:18 PM
BBR-APBT's Avatar
BBR-APBT BBR-APBT is offline
 
Join Date: Feb 2009
Location: Maryland
Posts: 946
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by basketmen View Post
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.
Reply With Quote
  #5  
Old 04-15-2009, 10:29 PM
basketmen's Avatar
basketmen basketmen is offline
 
Join Date: Nov 2006
Posts: 446
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BBR-APBT View Post
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
Reply With Quote
  #6  
Old 04-15-2009, 10:40 PM
BBR-APBT's Avatar
BBR-APBT BBR-APBT is offline
 
Join Date: Feb 2009
Location: Maryland
Posts: 946
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 04-16-2009, 01:31 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 04-21-2009, 11:31 PM
basketmen's Avatar
basketmen basketmen is offline
 
Join Date: Nov 2006
Posts: 446
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dismounted View Post
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
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:34 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.07841 seconds
  • Memory Usage 2,234KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (2)bbcode_php
  • (6)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete