Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Oh No!:themes in php?>

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Oh No!:themes in php?>

Postby sarjanajava » 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
sarjanajava
New php-forum User
New php-forum User
 
Posts: 41
Joined: Wed Nov 27, 2002 10:59 pm

Postby Joan Garnet » 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
Joan Garnet
Moderator
Moderator
 
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars

themes

Postby sarjanajava » 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
sarjanajava
New php-forum User
New php-forum User
 
Posts: 41
Joined: Wed Nov 27, 2002 10:59 pm

Postby Joan Garnet » 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
Joan Garnet
Moderator
Moderator
 
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars

Re: Oh No!:themes in php?>

Postby WiZARD » 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">
User avatar
WiZARD
Moderator
Moderator
 
Posts: 1257
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol

Re2:Oh No!:themes in php?>

Postby sarjanajava » Tue Jan 21, 2003 8:01 am

can u give me full coding? thanks
User avatar
sarjanajava
New php-forum User
New php-forum User
 
Posts: 41
Joined: Wed Nov 27, 2002 10:59 pm

Re: Re2:Oh No!:themes in php?>

Postby xlordt » 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)
User avatar
xlordt
New php-forum User
New php-forum User
 
Posts: 34
Joined: Thu Dec 12, 2002 9:00 pm
Location: NJ


Return to PHP coding => General

Who is online

Users browsing this forum: Baidu [Spider], Google [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron