Page 1 of 1

Random home page

Posted: Tue Jun 20, 2006 3:34 pm
by Dr.CSS
anyone know how to make a random home page show up eg., each time a site is visited a diff. page shows up as home page?

Re: Random home page

Posted: Tue Jun 20, 2006 3:43 pm
by cyberman
Are you meaning something like this

http://forum.cmsmadesimple.org/index.ph ... 744.0.html

Re: Random home page

Posted: Tue Jun 20, 2006 6:39 pm
by Dr.CSS
sort of but i would like to feature a random page/template on each visit...
as you might know i have a lot of templates, now they all have a global content block with the same thing on every page so a set home page is not neccesary(?sp) i'm just trying to show templates...

Re: Random home page

Posted: Mon Oct 30, 2006 5:22 pm
by jmansa
Hi Mark.

Did you figure out how to make it show random templates??? I need the same!

Re: Random home page

Posted: Tue Oct 31, 2006 4:44 am
by Dr.CSS
No

Re: Random home page

Posted: Tue Oct 31, 2006 5:12 am
by robsta
I'd just use Internet Explorer for mac... for most websites you never know what you're going to get...

but seriously... the hack previously posted will do the trick... just make up a separate script to choose from a cast of home pages... so if you've got four do a ceil or floor on the rand(4) in the redirect script.... but you'll either have to assign a switch to tell the script where to send it to or tidy up your database so that the pages are in order... do a switch.

Re: Random home page

Posted: Tue Oct 31, 2006 5:16 am
by robsta
ACTUALLY

In your case as every pageĀ  is the same... get the separate redirect script to grab all pages from the database... assign them to an array ... then choose randomly from the array... then redirect to the page in chosen

Yup that's a smarter way and no switch required.