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

Agree before entering

Discussion in 'XenForo Development Discussions' started by Matthew Hawley, Aug 13, 2013.

  1. Matthew Hawley

    Matthew Hawley Well-Known Member

    So, for my forum I need to create an addon that makes a user agree to something before entering taigachat. How would I go about doing this? Thanks!

    @Chris Deeming @King Kovifer @Waindigo
     
    Last edited: Aug 13, 2013
  2. JulianD

    JulianD Well-Known Member

    You need to make this check before the general controllers are called. I would suggest an approach like this:

    1) Listen to the init_dependencies code event or something else that probably better suits your needs. According to description, "This event is fired on virtually every page and is the first thing you can plug into.". This listener is where your "gateway" is placed. It will check if the user has agreed to your terms.
    2) I think a database table would be the best choice to keep record of the user's agreements. A record is created on this table only when an user agrees to the terms.
    3) I would create a controller where I explain the terms and include an appropriate call-to-action button. Obviously, the listener created in the first step would let the user pass if he enters this controller.
     
  3. Matthew Hawley

    Matthew Hawley Well-Known Member

    Okay...I dont know how to do any of that.
     
  4. Marcus

    Marcus Well-Known Member

    You can also use jquery to agree to something, then add the value fetched from javascript and store it together with the login data. The login data is then only handled if the agree value is also submitted (you would have to program that with a simple if statement in php).
     

Share This Page