Oh No!:themes in php?>

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
User avatar
sarjanajava
New php-forum User
New php-forum User
Posts: 39
Joined: Wed Nov 27, 2002 10:59 pm
Contact:

Wed Jan 15, 2003 7:31 am

how can we use php coding with CSS to set a theme in webpage. for example phpnuke
thanks

User avatar
Joan Garnet
Moderator
Moderator
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars
Contact:

Wed Jan 15, 2003 4:16 pm

Maybe you mean to dinamically select a style from a form or from a value kept in a database ?

Code: Select all

<link href="<?php echo $my_css; ?>" rel="stylesheet" rev="stylesheet" type="text/css">


:?:

User avatar
sarjanajava
New php-forum User
New php-forum User
Posts: 39
Joined: Wed Nov 27, 2002 10:59 pm
Contact:

Sat Jan 18, 2003 3:05 am

i mean that how can i set up themes in my site , for example like phpnuke

what coding ?

User avatar
Joan Garnet
Moderator
Moderator
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars
Contact:

Sat Jan 18, 2003 5:17 am

That's it.
You need different .css files with different styles and then link them as you want.
When a user registers to your site, he can choose the login, password and style.
It can be saved in a txt file or if you have Mysql access, in a table.

User avatar
WiZARD
Moderator
Moderator
Posts: 1240
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol
Contact:

Sat Jan 18, 2003 7:10 am

Principle as same in all programm:
common.php

Code: Select all

<?PHP
$theme="silver"
.......
?>

index.php

Code: Select all

<link href="<?=$theme; ?>.css" rel="stylesheet" rev="stylesheet" type="text/css">
"Sex,Drugs and Rock&Roll " replaced at "Sucks,Bugs and Plug&Play";
Image

User avatar
sarjanajava
New php-forum User
New php-forum User
Posts: 39
Joined: Wed Nov 27, 2002 10:59 pm
Contact:

Tue Jan 21, 2003 8:01 am

can u give me full coding? thanks

User avatar
xlordt
New php-forum User
New php-forum User
Posts: 34
Joined: Thu Dec 12, 2002 9:00 pm
Location: NJ
Contact:

Tue Jan 21, 2003 8:41 am

sarjanajava wrote:can u give me full coding? thanks


he just did give you the full code.. all you have to do is edit common.php where is says

$theme ="silver";

or what ever theme that you like to add then.. in the index page of your site.. you will add...

<link href="<?=$theme; ?>.css" rel="stylesheet" rev="stylesheet" type="text/css">

this is pointing at your theme dir where your subdir is (silver) and it uses the style.css file for its colors.. for example if you wanted to just add it on one page then just do ..

Code: Select all

$theme ="silver";

<link href="<?=$theme; ?>.css" rel="stylesheet" rev="stylesheet" type="text/css">


you can add that to your index page as well
i dont know to mutch about themes but i do know that is how
you do it (im still a newbie at php)
Computer/Programm rox.. (php, c/c++ will take over soon muhahah

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests