js (or php?) help
- Started
- Last post
- 6 Responses
- nocomply
Hey guys,
So I need to make a site where the homepage loads normally, but when any links are clicked a disclaimer appears where the user must accept the terms and conditions before loading any additional pages/content.
The catch is that I want to incorporate this into a Wordpress website.
I could use javascript which I'm more familiar with, but that would be easier to bypass than php since it loads on the client side so I'm thinking it's not the best solution.
I really don't know how to go about creating it in php, but I feel like it's not that hard to do. Any ideas?
Thanks!
- bigtrick0
what you're asking isn't hard to do, but it is a bit more complex than a forum reply can encompass. basically in php you need to change all the links in your wordpress template to be of some common class that a php function can rewrite with a link to your t&c. you need a session variable for the t&c acceptance and a cookie that stores the t&c acceptance status also. and finally you need to write that function in php that does the link redirection.
the above isn't really a good guide on how to do it, just the barest sketch, really, but to go into more detail would require more time and more hand gestures. basically, for a php programmer, what you're asking would be a 2-5 hour task, i think, depending on what your site is like.
- bigtrick0
i wrote all that shit and then i did a google search for wp plugins - came up with this one:
http://wordpress.org/extend/plug…
good luck.
- acescence0
that plugin is unfortunately broken in recent versions of wordpress due to a slightly different way query vars are handled.
the concept is similar to how you'd create your own login system, not the whole verifying a user exists and checking password, etc., but as bigtrick said setting a session var and cookie and kicking people out to a page if they're not authenticated. you could probably grab and adapt some code from some kind of similar tutorial
- T-Dawg0
You might be able to do this using jquery and fancybox (lightbox)
http://fancybox.net/homeif no session is detected, popup the lightbox
- nocomply0
Thanks guys. That gives me a good place to start some research.
But based on what has been said, would anyone be interested in the work? I could probably get it done on my own, but that "2-5 hour task" would likely take me more than twice as long. I'm pretty certain the client has the funds to make it worth your while. This project isn't scheduled to start for over a month.
- acescence0
sure, send me an email.