1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.1 Run SQL Query on registration

Discussion in 'XenForo Questions and Support' started by Jake Hakoda Shirley, Jan 28, 2013.

  1. Jake Hakoda Shirley

    Jake Hakoda Shirley Active Member

  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    You will need an addon that extends either XenForo_ControllerPublic_Register or XenForo_DataWriter_User. The datawriter might be more appropriate, that way you can execute your code on all user inserts (registration, Admin CP).
     
  3. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    For the datawriter, look at the _postSave() function. You can use code like this:

    Code:
    if ($this->isInsert())
    {
    	$db->query("SQL HERE");
    }
    
    Fairly simple. You can modify the file or create an addon to extend the class.
     
  4. Jake Hakoda Shirley

    Jake Hakoda Shirley Active Member

     

Share This Page