This is my first (public) extension for Expression Engine. A site I am working on for a client needed a way to display the Terms of Use every time a user logs in…and it needed to be on a by-computer basis, rather than a by-user basis, since more than one person will be using the same login credentials.
What Roadblock does is look every time someone logs in to see if they have been shown a message yet, and how long ago. If they have not yet seen the roadblock, or if it was over a specified length of time ago, the roadblock will be displayed (or, optionally, they will be sent to a url of your choosing). Although I built it for displaying the term of use, it would also be useful for displaying reminders or instructions. Please note: There is no checking to ensure that the user “agrees” to the message. If you need their access to the site to be conditional on accepting an agreement, you will have to look elsewhere.
Installation
Download the file ext.roadblock.zip. Inside the archive you will find two files: lang.roadblock.php goes in your language/english folder and ext.roadblock.php goes in the extensions folder. You can now enable it in the extensions section of your control panel.
Settings
Users should see the roadblock The interval between displays of the roadblock for each user.
Track users by We can either keep track of who has seen the roadblock by User ID or by Computer. The latter option uses cookies, meaning that if the same user logs on using two different computers (or browsers) they will be shown the roadblock twice.
Url to redirect to By default, the roadblock message will be shown in your User Message template (as defined in the Specialty Templates section of the CP) with a link to this address at the bottom. Normally, this would be the home page of you website (which it is set to by default). Optionally, you can leave the remaining settings fields blank, in which case this address will be used as the roadblock itself. This option allows you to create a unique template for the roadblock message, or create additional functionality within it.
Title & Text This is the actual content of the roadblock message. Anything you put in the Text field will be run through EE’s Xhtml processor.
Link text The link to continue on to the website.
Url to redirect to when the roadblock is not shown If this field is filled in, the user will be routed directly to the specified url when the roadblock is not shown, bypassing the Expression Engine “you are logged in” confirmation message.
Disclaimer
Remember, this is my first real extension, and I have tested it on my own system but if it blows up you installation of Expression Engine I cannon be held responsible. Use at your own risk!
If you have questions, find bugs, or otherwise need help, please see my post on the Expression Engine Forums.
Comments:
Dude on March 31, 2009 at 5:08am#1
Could this be what I’m looking for?