Random home page

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Random home page

Post 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?
cyberman

Re: Random home page

Post by cyberman »

Are you meaning something like this

http://forum.cmsmadesimple.org/index.ph ... 744.0.html
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Random home page

Post 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...
jmansa
Forum Members
Forum Members
Posts: 126
Joined: Thu Oct 19, 2006 2:46 pm

Re: Random home page

Post by jmansa »

Hi Mark.

Did you figure out how to make it show random templates??? I need the same!
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Random home page

Post by Dr.CSS »

No
User avatar
robsta
Forum Members
Forum Members
Posts: 131
Joined: Thu Oct 20, 2005 11:39 pm

Re: Random home page

Post 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.
User avatar
robsta
Forum Members
Forum Members
Posts: 131
Joined: Thu Oct 20, 2005 11:39 pm

Re: Random home page

Post 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.
Post Reply

Return to “CMSMS Core”