Results 1 to 7 of 7

Reliable Variables in (registration_activate_process) hook

This is a discussion on Reliable Variables in (registration_activate_process) hook within the Off-Topic & Chit Chat forums, part of the Focus on Members category; I have an open post over a vBulletin.org about this one but was hoping I could run this past you ...

  1. #1
    Senior Member Citricguy's Avatar
    Real Name
    Josh
    Join Date
    Nov 2006
    Location
    Maui, Hawaii
    Posts
    143
    Liked
    0 times
    Blog Entries
    7

    Reliable Variables in (registration_activate_process) hook

    I have an open post over a vBulletin.org about this one but was hoping I could run this past you guys ( registration_activate_process variables problem - vBulletin.org Forum )

    The long and short of it is that I'm trying to create a plugin that runs at the registration_activate_process hook. (I'm assuming this is the best place to run "post-confirmed email/useraccount" code)

    So once the user clicks the "confirm my account" link in their confirmation email, the $vbulletin->userinfo[username]; variable during the run at registration_activate_process is set to "Unregistered" instead of the actual username like the other 60% of the time.

    Is there a way I can always, 100% of the time, pull the username of the user that just clicked the "email confirmation link" successfully? Another hook location, or variable?

    I hope that made sense... sometimes I think I have a harder time wording a question that actually working on it..

  2. #2
    Senior Member
    Real Name
    Michael Biddle
    Join Date
    Jan 2007
    Location
    Southern California
    Posts
    7,097
    Liked
    5 times
    What if you try
    PHP Code:
    $vbulletin->GPC['username'
    The Forum Hosting - Forum Hosting from the Forum Experts

  3. #3
    Senior Member Citricguy's Avatar
    Real Name
    Josh
    Join Date
    Nov 2006
    Location
    Maui, Hawaii
    Posts
    143
    Liked
    0 times
    Blog Entries
    7
    The variables were empty when I used:
    PHP Code:
    $vbulletin->GPC['username'
    But I think I may have pinpointed the problem (my head is so fried... lol)

    So when I have cookies disabled during registration I get:

    PHP Code:
    $vbulletin->userinfo[username] = Unregistered 
    And when cookies are enabled during registration I get:

    PHP Code:
    $vbulletin->userinfo[username] = Correct User Name 
    tested that theory 4 times now and it seems to be accurate.

    Any ideas for always being able to collect data from $vbulletin->userinfo[username] even if cookies are disabled on the userside during the registration_activate_process hook run?

  4. #4
    Senior Member
    Real Name
    Michael Biddle
    Join Date
    Jan 2007
    Location
    Southern California
    Posts
    7,097
    Liked
    5 times
    Ok try:
    PHP Code:
    $userinfo['username'
    The Forum Hosting - Forum Hosting from the Forum Experts

  5. #5
    Senior Member Citricguy's Avatar
    Real Name
    Josh
    Join Date
    Nov 2006
    Location
    Maui, Hawaii
    Posts
    143
    Liked
    0 times
    Blog Entries
    7
    That got it!! Thank you Michael!

    So what is the difference between $vbulletin->userinfo[username]; and $userinfo['username']; ?

  6. #6
    Senior Member
    Real Name
    Michael Biddle
    Join Date
    Jan 2007
    Location
    Southern California
    Posts
    7,097
    Liked
    5 times
    The second was in scope.
    The Forum Hosting - Forum Hosting from the Forum Experts

  7. #7
    Junior Member
    Real Name
    Greg
    Join Date
    Jan 2009
    Posts
    1
    Liked
    0 times
    This seems to be working flawlessly except lately i've noticed that it's missed out a few members and not added them to my mailing list.

    Any ideas why this would happen? Here's my plugin code;

    Code:
    $username = $userinfo['username']; 
    $email= $userinfo['email']; 
    $userid= $userinfo['userid']; 
    
    
    $xml = "<xmlrequest> 
        <username>admin</username> 
        <usertoken>XX8410b36f01de9fe7df722ab2864677afddfaXX</usertoken> 
        <requesttype>subscribers</requesttype> 
        <requestmethod>AddSubscriberToList</requestmethod> 
        <details> 
            <emailaddress>$email</emailaddress> 
            <mailinglist>1</mailinglist> 
            <format>html</format> 
            <confirmed>yes</confirmed> 
            <customfields> 
                <item> 
                    <fieldid>12</fieldid> 
                    <value>$username</value> 
                </item> 
                <item> 
                    <fieldid>13</fieldid> 
                    <value>$userid</value> 
                </item> 
            </customfields> 
        </details> 
    </xmlrequest> 
    "; 
    
    $ch = curl_init('http://www.maximum-jackson.com/interspire/xml.php'); 
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
    curl_setopt($ch, CURLOPT_POST, 1); 
    curl_setopt($ch, CURLOPT_POSTFIELDS, $xml); 
    $result = @curl_exec($ch); 
    if($result === false) { 
        echo "Error performing request"; 
    } 
    else { 
        $xml_doc = simplexml_load_string($result); 
        //echo 'Status is ', $xml_doc->status, '<br/>'; 
        if ($xml_doc->status == 'SUCCESS') { 
            //echo 'Data is ', $xml_doc->data, '<br/>'; 
        } else { 
            //echo 'Error is ', $xml_doc->errormessage, '<br/>'; 
        } 
    }  
    Any help would be greatly appreciated!

Similar Threads

  1. archive_global Hook used for PHP 5 as Fast CGI
    By redlabour in forum vBSEO Features Archive
    Replies: 2
    Last Post: 05-17-2007, 12:07 PM
  2. how do you find a reliable vb coder?
    By Rodney in forum Off-Topic & Chit Chat
    Replies: 8
    Last Post: 04-23-2007, 08:11 AM
  3. I paid, hook me up.. and..
    By rex_b in forum Pre-Sales Questions
    Replies: 3
    Last Post: 11-07-2005, 02:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •