[HELP] CMS Themes

x0by

New Member
Aug 27, 2018
9
0
Hello guys.

I need some help to finish my project..
I have a hotel and i want to add like buttons in the me page to change the layout/theme of the cms (Dark Theme and White Theme)
Does someone has something, that can help me more to get this function?

- x0by
 

Universo

New Member
Aug 25, 2018
20
7
Man, it's simple. Add a collum in users table called "theme" add a requisition in your global.php to check this collum and redirect to the themed version of your site.... You can put a simple submit button to get the information to fill the collum theme like "dark" or "white".
 

x0by

New Member
Aug 27, 2018
9
0
Man, it's simple. Add a collum in users table called "theme" add a requisition in your global.php to check this collum and redirect to the themed version of your site.... You can put a simple submit button to get the information to fill the collum theme like "dark" or "white".
I don't get it really.. it cant be so simple like you telling me
 

LeChris

https://habbo.codes/
Sep 30, 2013
2,786
1,395
Man, it's simple. Add a collum in users table called "theme" add a requisition in your global.php to check this collum and redirect to the themed version of your site.... You can put a simple submit button to get the information to fill the collum theme like "dark" or "white".
A better way would be to use Javascript and save it in the localStorage
 

Universo

New Member
Aug 25, 2018
20
7
First things first.
Do you know anything about css, html, php ??
If not, stop here, I will not code it for you.

If yes, follow my lead.
-You want to give users the option to change the theme,
1. Obviously you'll need 2 themed CSS for wich one, as for the black so to the light theme.
2. A button to change betwin them. This button will store the preference of the user for the theme in the db.
3. But for that you'll need to store it in a db (you can use the same as CMS just add the column "theme" at users table).

The simple logic is.
Add a request to the table at the global.php to guarantee it will affect every page in CMS. This request should refer to what the user preference is, if its dark theme or light theme.

This request will affect a variable placed in the path to the css in your index like this "./templates/style/<?php echo $ theme; ?> .css
$ theme will change if db return "dark" then the path will lead to ".templates / style / dark.css" SIMPLE!

The button ??? Man it could be a simple button to write the preference in the db at the column "theme", it could be placed where the hell you want ...

Hope you understand, I don't give the fish, I teach how to fishing xD
 
A better way would be to use Javascript and save it in the localStorage
He is with problem with simple html/php shit, don't destroy his life bringing javascript to it xD
 

Users who are viewing this thread

Top