Css And Theme

Started on the old forum in December 2008 · view the original in the archive · old links redirect here

6 replies · 639 views · started 17 years ago · 1 min read

2 participants
kiss Senior · 294 posts #1

Hi,i have a litle problem and i cant resolve it. Demo:

function webhead($uthm,$pgtitle) { $ret = "<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >"; $ret .= "<head>"; $ret .= "<title>$pgtitle</title>"; $ret .= "<link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico" />"; $ret .= "<link rel="stylesheet" type="text/css" href="default.css" />"; //Default css theme $ret .= "</head><body>"; return $ret; } ///// and i try something like this: function webhead($uthm,$pgtitle) { $ret = "<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >"; $ret .= "<head>"; $ret .= "<title>$pgtitle</title>"; $ret .= "<link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico" />"; if($getuthm!="") { $ret .= "<style type="text/css"> body { background-color: #0000ff font-family: Georgia; color: #000000 } </style>"; //theme for registered users,after login }else{ $ret .= "<link rel="stylesheet" type="text/css" href="default.css" />"; //theme for non-registered users,not login } $ret .= "</head><body>"; return $ret; } //////////////////// It not working and i dont know why,maybe i make the code wrong or what,anybody some ideas,coding?

www.inbuzunar.mobi -Your mobile portal pocket

Guest #2

QUOTE (kiss @ Dec 8 2008, 03:02 PM) <{POST_SNAPBACK}>

Hi,i have a litle problem and i cant resolve it. Demo:

function webhead($uthm,$pgtitle) { $ret = "<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >"; $ret .= "<head>"; $ret .= "<title>$pgtitle</title>"; $ret .= "<link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico" />"; $ret .= "<link rel="stylesheet" type="text/css" href="default.css" />"; //Default css theme $ret .= "</head><body>"; return $ret; } ///// and i try something like this: function webhead($uthm,$pgtitle) { $ret = "<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >"; $ret .= "<head>"; $ret .= "<title>$pgtitle</title>"; $ret .= "<link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico" />"; if($getuthm!="") { $ret .= "<style type="text/css"> body { background-color: #0000ff font-family: Georgia; color: #000000 } </style>"; //theme for registered users,after login }else{ $ret .= "<link rel="stylesheet" type="text/css" href="default.css" />"; //theme for non-registered users,not login } $ret .= "</head><body>"; return $ret; } //////////////////// It not working and i dont know why,maybe i make the code wrong or what,anybody some ideas,coding?


ENGLISH only!

kiss Senior · 294 posts #3

What part you dont understand?If you dont know,like the usual 😉 pls dont make offtopic...@Regele

www.inbuzunar.mobi -Your mobile portal pocket

something else Fellow · 2,296 posts #4

The strings dont match up on your function for a start function webhead($uthm,$pgtitle) and if($getuthm!="")

so $getuthm will always never be equal to ""

and secondly why are u using 2 differnt types of css set up?

why use href="default.css

and then use in page css for user themes?

Guest #5

lool.. for exemple you take this existing function:

$getuthm = mysql_fetch_array(mysql_query("SELECT theme FROM klubro_users WHERE id='".$uid."'")); $uth = $getuthm[0];

if($uth==NULL) {

if($id==NULL) { $uth= "tema1";//aici e tema pt neinregistrati/unregistered users }else{ $uth = "tema2";//tema pt cei logati/logged users }

}else{

$uth= $uth;//tema aleasa de userii inregistrati, in caz ca au aleso/theme for registered users if they already choosen it.

}

ps: you can manage yourself with the css....i guess pmpl

kiss Senior · 294 posts #6

It not working but thanx for intention.Btw i use 1st default.css for non registered users and second the css style code because in the second part users add the code by data base something like this:

$sql = @mysql_fetch_array(mysql_query("SELECT background,  color, font-family FROM noi2_users WHERE id='".$uid."'"));
$ret .= "<style type=\"text/css\">
body
{
background-color: $sql[0];
font-family: $sql[1];
color: $sql[2];
}

www.inbuzunar.mobi -Your mobile portal pocket

something else Fellow · 2,296 posts #7

So why not use: $ret .= "<link rel="stylesheet" type="text/css" href="theme.php" />";

then in theme.php u can open and close php where ever you need it

background-color: <?$sql[0]?>; 🙂

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close