Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions

Reply
 
Thread Tools Display Modes
  #21  
Old 06-08-2009, 08:20 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Of course it's an unknown column 'user.userid' in the field list - you aren't joining to the user table, so how would it get that field? But in the query you wrote, you use "$vbulletin->GPC['i']" which is a variable that is passed. That doesn't mean that line is still in the database. Have you looked at that table which testing this process and seen whether the row you want is still there?

What I was saying about global.php is that it's called in the register.php page, so I'm not sure it needs to be called again.
Reply With Quote
  #22  
Old 06-09-2009, 07:05 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
$userdata $db->query_first("
    SELECT u.username
    FROM " 
TABLE_PREFIX "useractivation AS ua
    LEFT JOIN " 
TABLE_PREFIX "user AS u USING (userid) 
    WHERE ua.activationid = '" 
$vbulletin->db->escape_string($vbulletin->GPC['i']) . "'
    AND ua.emailchange = 0
    LIMIT 1
"
);

$username $userdata['username']; 
Reply With Quote
  #23  
Old 06-09-2009, 01:37 PM
powerful_rogue powerful_rogue is offline
 
Join Date: Jan 2007
Location: Kent
Posts: 603
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
Of course it's an unknown column 'user.userid' in the field list - you aren't joining to the user table, so how would it get that field? But in the query you wrote, you use "$vbulletin->GPC['i']" which is a variable that is passed. That doesn't mean that line is still in the database. Have you looked at that table which testing this process and seen whether the row you want is still there?

What I was saying about global.php is that it's called in the register.php page, so I'm not sure it needs to be called again.
Hi Lynne,
I knew that about the unknown column, I was just showing how I got a database error that confirmed the correct activationID was being associated with the user.

Quote:
Originally Posted by Dismounted View Post
PHP Code:
$userdata $db->query_first("
    SELECT u.username
    FROM " 
TABLE_PREFIX "useractivation AS ua
    LEFT JOIN " 
TABLE_PREFIX "user AS u USING (userid) 
    WHERE ua.activationid = '" 
$vbulletin->db->escape_string($vbulletin->GPC['i']) . "'
    AND ua.emailchange = 0
    LIMIT 1
"
);

$username $userdata['username']; 
Hi Discountinued.

I replaced

PHP Code:
$username htmlspecialchars_uni($vbulletin->userinfo['username']); 
with the above query, however it then throws up this error after confirming the email address

Quote:
Fatal error: Call to a member function save() on a non-object in /home/dc/public_html/testsite/register.php on line 1079
Reply With Quote
  #24  
Old 06-09-2009, 03:00 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try removing the global.php line and see what happens.
Reply With Quote
  #25  
Old 06-09-2009, 03:23 PM
powerful_rogue powerful_rogue is offline
 
Join Date: Jan 2007
Location: Kent
Posts: 603
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Lynne,

Still comes back with the same error.
Reply With Quote
  #26  
Old 06-09-2009, 03:53 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Again I'll suggest that you take a look at the useractivation table during this process. I'm still not convinced that that row isn't deleted and thus you wouldn't get any result from that query.
Reply With Quote
  #27  
Old 06-10-2009, 06:24 AM
powerful_rogue powerful_rogue is offline
 
Join Date: Jan 2007
Location: Kent
Posts: 603
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Lynne,

Looking through register.php it looks like your right.

Line 1023
PHP Code:
// delete activationid
        
$db->query_write("DELETE FROM " TABLE_PREFIX "useractivation WHERE userid=$userinfo[userid] AND type=0"); 
Line 1068
PHP Code:
($hook vBulletinHook::fetch_hook('register_activate_process')) ? eval($hook) : false
It deletes the activationid before it gets to the hook I need to use.

Looks like I might be a bit stuffed! I dont suppose you know of any other ways I may be able to resolve this.
Reply With Quote
  #28  
Old 06-10-2009, 07:11 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Catch and hold the username at an earlier hook?
Reply With Quote
  #29  
Old 06-10-2009, 08:32 AM
powerful_rogue powerful_rogue is offline
 
Join Date: Jan 2007
Location: Kent
Posts: 603
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks dismounted.
Is this an easy thing to do?
Reply With Quote
  #30  
Old 06-10-2009, 02:17 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by powerful_rogue View Post
Thanks dismounted.
Is this an easy thing to do?
Again, look at register.php. That is the best thing to do. Find this right around line 1000:
PHP Code:
    $userinfo verify_id('user'$vbulletin->GPC['u'], 11);

    (
$hook vBulletinHook::fetch_hook('register_activate_start')) ? eval($hook) : false
You really need to look at the page you are using plugins for to see what is already going on.
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: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.07086 seconds
  • Memory Usage 2,285KB
  • Queries Executed 12 (?)
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
  • (6)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete