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

Script to create a new user

Discussion in 'XenForo Development Discussions' started by Сергей Жуков, Oct 11, 2011.

  1. Good day to all!
    I want to make a general registration between forums and blogs.
    I would like to receive information, in which tables to add new records.
    I tried to compare the base before and after registering a new user having trouble with the concept of logic (a lot of different hashes).
  2. ragtek

    ragtek Guest

    you can use the xf registration to create a automatic blog user.

    For this, i would suggest to use/extend the xenforo user datawriter to create the blog user after the xf user was created
  3. No no. Just when a user logs on the blog, he can use these data and on the forum. I knowhow to implement it, I need only to know what database fields are filled immediately.
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    That is handled by the datawriter:


    The _getFields function defines the tables and fields for a user. Those tables are:

    Pereira likes this.
  5. I just need to create a query to the database that the forum knew that he had a particular user. I do not have the means to create a user forum. This makes it quiteforeign script. That is why I want to know what tables and fields for them to change the actual values​​, and what "formal", the "standard".
  6. Fuhrmann

    Fuhrmann Well-Known Member

    You want to use a script which runs automatically and create new users? Ca you explain better?
  7. James

    James Well-Known Member

    Look at library/XenForo/DataWriter/User.php
  8. No. I'm in the engine forum did not want to run. I just need a script from a third party to add a new user to form queries to the database XF.
  9. For expamle:
    INSERT INTO user (name, email, datareg, something, somthing_standart) VALUES ('Sergey', 'email@tratata.ru', time(), 0, 0);)
  10. James

    James Well-Known Member

    That's not recommended, as you can't just add them to the table without affecting others. You need to add the permissions, etc.
  11. Well anyway it all right and so on are described in the database
  12. SheepCow

    SheepCow Well-Known Member

    The problem you'll have doing it that way is the user won't be able to login to the forum, and I suspect other things related to the user will start to go wrong (also if any of the fields change your script will stop working). If you use the XenForo User datawriter you'll automagically get any changes to the XenForo database structure as it changes (because they'll have to change the datawriter which you'll be using :)).

    From an MVC point of view, you're basically fiddling the model in to an invalid state
  13. JaredNZ

    JaredNZ Member

    Сергей Жуков - > Can you please post the script you used?

    Thank you
  14. Если честно, то мне разработчики так и не дали внятного ответа
  15. arr0w

    arr0w Member

    Works like a charm. Thanks a lot! :)
  16. Ben'

    Ben' Member

    Thank you very much

Share This Page