views:

1444

answers:

3

Hi,

I'm starting a Wordpress Blog that will have adult content on it, so I'll need a first-time-only splash page in Wordpress. The first-time-only issue, I can fix with a cookie (although I am aware that not everyone has cookies enabled)

What I could do is, create a script that loads another page if a cookie isn't present. Or I could make the splash page be my home page, and if the cookie is present, redirect.

But that's not really what I'm looking for. I don't want to hassle with pages. In stead I'm looking for a lightbox-y solution, that darkens the background (the home page) and shows a panel with the choice to stay or leave.

I haven't got a clue on how to start this. I am familiar with PHP, Javascript and CSS, so I'm not even asking for code. I just want a web programmer's view on this, and some help on how to create the splash-page the way I would like it. Or is it a stupid idea?

+1  A: 

I'd use a lightbox solution.

e.g.
http://leandrovieira.com/projects/jquery/lightbox/

This includes examples of how to use it.

seanyboy
+1  A: 

I would just create the CSS for it, get it all ready to go, then stick it into the header with your condition. This way, you know that everypage will display it, and you can;t be "caught with your pants down" if you get linked to.

My only concern would be to make sure that the lightbox effect covers anything graphic, as I'm sure you don't want it displayed before the user agrees to seeing it.

Cory Dee
+1  A: 

There shouldn't be any problems with creating a little bit of JavaScript code that checks a cookie and displays a lightbox if the cookie is not set. The JavaScript can simple display a div with the panel with the choice to stay or leave. And perhaps an other div to dim out the background, but you can do that in any way you see fit.

Emil Rasmussen