You are here:  » How could I create a splash page?

Support Forum



How could I create a splash page?

Submitted by mally on Tue, 2009-07-21 18:55 in

Hello David

I've created an adult product price comparison website using pricetapestry and Once on the site, the adult content consists of adult related pic's (semi naked people, nothing more than you would see at the local newsagents)

I've got 2 suggestions, feedback would be appreciated.

1) Make a page appear where the user is informed that adult pictures are on the site and to confirm their age.
2) Replace of the images with a censored image and have a button on the screen that reveals the true image.

Can I have your thoughts David? I don't want to prevent page seo, so I'm guessing number 2 might be the best option however I'm not sure programming wise whats the best choice?

Thanks Mally

Submitted by support on Wed, 2009-07-22 11:24

Hi Mally,

I like the idea of option 2), as otherwise search engines are just going to think that the "Please confirm your age" page is your home page.

This could be done quite neatly using a cookie, so anywhere that images are displayed (on your home page this is most likely to be within html/featured.php) simply replace the $product["image_url"] value if the cookie is not set. The distribution version of html/featured.php contains the following line:

<?php if ($product["image_url"]): ?>

...so you would ADD on the next line:

<?php if (!$_COOKIE["ageconfirmed"]) $product["image_url"] = "/images/censored.gif";  ?>

Then, on your homepage, you can simply have a text message asking the visitor to confirm their age (using the same cookie to hide it if they have already done so):

<?php if (!$_COOKIE["ageconfirmed"]) print "<a href='?confirmage=TRUE'>I am over 18</a>"?>

...and to handle that link, add the following right at the very top of the same page (presumably index.php):

<?php
if ($_GET["confirmage"])
{
  setcookie("ageconfirmed","1",strtotime("+1 Year"));
  header("Location: /");
  exit();
}
?>

That should do the trick quite nicely!

Cheers,
David.