PDA

View Full Version : let guests change theme?


AlexC
05-03-2011, 01:30 PM
I was wondering if it was possible to alter a file somewhere that would allow guests to change the theme?

I'd like to be able to let my guests change the theme of my site, as well as my members.

I deleted part of the changestyle.php file and that let the guests change it, but it won't stay. The moment I change the page, it goes back to the default.

Kaeliah
05-03-2011, 08:39 PM
That's because when users change the theme, it's recorded in the database what theme they picked. Guests don't have this so the information isn't stored and it goes back to the default. The only option really is to create a new table and store guest IP and theme settings, although personally I think it's a waste of space.:eye:

AlexC
05-03-2011, 09:24 PM
It's for a very special project I'm working on. Changable themes for guests is a highly massive part of it.

Could you show me how to do that? Would there be any way to perhaps delete it every week or so that it doesn't get burdened with entries?

Kaeliah
05-03-2011, 11:45 PM
I can explain it for you.

What you'll need is a new table in your database with a couple fields. 1 for an IP, 1 for the theme name and 1 for the date. Then you'll want the coding to detect if someone is a guest and if they are insert a new entry into the table with the information. Simple as that. You'll also want a cron job to run weekly and erase entries over 1-2 weeks old depending on how many guests you get per day.

fadillzzz
05-04-2011, 12:46 AM
Or use cookies instead....

Kaeliah
05-04-2011, 01:03 AM
Yeah cookies elude me still.

AlexC
05-04-2011, 08:04 AM
Okay - I can do the mySQL part, but not the coding part. I'm not good at creating code from scratch. I'll see what I can do about the crib job. (don't know anything about cookies).