diff --git a/www/User.php b/www/User.php index fb0ace3..b1fd6ba 100644 --- a/www/User.php +++ b/www/User.php @@ -1,3 +1,4 @@ +. */ -. */ -fetchArray(); } +function ExtractStyle(&$category) +{ + $s = "background-color:" . $category["backcolor"] . ";"; + $s .= "color:" . $category["forecolor"] . ";"; + + if ($category["font"] != "") + { + $params = explode(";", $category["font"]); + + // size ; xx ; 93 italic ; 92 bold ; face name + + $s .= "font-size:" . $params[0] . "px;"; + if ($params[2] == "93") + $s .= "font-style:italic;"; + if ($params[3] == "92") + $s .= "font-weight:bold;"; + $s .= "font-family:" . $params[4] . ";"; + } + + $category["style"] = $s; +} + function LoadUser($name) { global $db; @@ -79,7 +100,10 @@ function LoadUser($name) $user->categories = array(); while ($row = $result->fetchArray()) + { + ExtractStyle($row); array_push($user->categories, $row); + } $result = $db->query("SELECT * FROM preference WHERE user='$user->id' ORDER by name"); diff --git a/www/index.php b/www/index.php index 27d5f5e..d05ce66 100644 --- a/www/index.php +++ b/www/index.php @@ -1,3 +1,4 @@ +. */ -fetchArray()) else $tr_class = ""; } - echo "