cvs: phpweb / index.php style.css /include layout.inc /styles arial.css default.css verdana.css
| From: | James Cox | Date: | Wed, 30 Jan 2002 06:45:46 +0000 |
| Subject: | cvs: phpweb / index.php style.css /include layout.inc /styles arial.css default.css verdana.css | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-8372@lists.php.net to get a copy of this message | ||
imajes Wed Jan 30 01:45:46 2002 EDT
Added files:
/phpweb/styles arial.css default.css verdana.css
Removed files:
/phpweb style.css
Modified files:
/phpweb index.php
/phpweb/include layout.inc
Log:
ok, lets trial this out. to solve the problem everyone has with fonts (in that, everyone likes
their own font, etc), i've added some functionality to specify default fonts / styles.... so
it'll lay everything out depending on what your have in your cookie, with verdana being the
default style.
Index: phpweb/index.php
diff -u phpweb/index.php:1.187 phpweb/index.php:1.188
--- phpweb/index.php:1.187 Thu Jan 24 11:04:09 2002
+++ phpweb/index.php Wed Jan 30 01:45:45 2002
@@ -6,6 +6,11 @@
require_once 'prepend.inc';
+if (isset($setstyle)){
+ set_style($setstyle);
+ header("Location: http://$HTTP_HOST/");
+}
+
$SIDEBAR_DATA = '
<br>
<h3>What is PHP?</h3>
Index: phpweb/include/layout.inc
diff -u phpweb/include/layout.inc:1.68 phpweb/include/layout.inc:1.69
--- phpweb/include/layout.inc:1.68 Wed Jan 23 18:33:02 2002
+++ phpweb/include/layout.inc Wed Jan 30 01:45:46 2002
@@ -1,5 +1,5 @@
<?php
-/* $Id: layout.inc,v 1.68 2002/01/23 23:33:02 imajes Exp $ */
+/* $Id: layout.inc,v 1.69 2002/01/30 06:45:46 imajes Exp $ */
# spacer()
# print a IMG tag for a sized spacer GIF
@@ -57,6 +57,18 @@
return $image;
}
+# set_style()
+# Set the default style according to stylesheet
+#
+
+function set_style($style) {
+
+ if (isset($style)) {
+ setcookie("phpstyle", $style, time()+31449600, "", $HTTP_HOST);
+ }
+}
+
+
# print_image()
# print an IMG tag for a given file
#
@@ -179,12 +191,13 @@
function commonHeader($title="",$dont_enclose=0,$headers_gone=0) {
global $MYSITE, $enclosed;
global $SIDEBAR_DATA, $prevsearch;
+ global $phpstyle;
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>PHP<?php if ($title) echo ": $title";?></title>
- <link rel="stylesheet" href="/style.css">
+ <link rel="stylesheet" href="styles/<?php echo ($phpstyle) ? $phpstyle .
".css" : "verdana.css";?>">
</head>
<body topmargin="0" leftmargin="0" marginheight="0"
marginwidth="0"
@@ -201,8 +214,15 @@
<?php echo strftime("%A, %B %d, %Y"); ?>
</url-minder-ignore>
</b> <br>
- </font>
- </td>
+ </font><br>
+ Select Style:
+ <?php
+ print_link('/index.php?setstyle=verdana', 'verdana', 'false',
'clase="small"');
+ echo delim();
+ print_link('/index.php?setstyle=arial', 'arial', 'false',
'clase="small"');
+ echo delim();
+ print_link('/index.php?setstyle=default', 'no style', 'false',
'clase="small"');
+ ?></td>
</tr>
<tr bgcolor="#9999cc">
Index: phpweb/styles/arial.css
+++ phpweb/styles/arial.css
body, ul, td, th {
font-family: arial,helvetica,sans-serif;
font-size: 95%;
}
p {
font-family: arial,helvetica,sans-serif;
}
em {
font-weight: bold;
font-style: italic;
}
acronym {
border-bottom: 1px dashed #00cc00;
cursor: help;
}
error {
color: #cc0000;
}
newsDate {
font-size: 85%;
font-style: italic;
color: #6666cc;
}
sidebar {
font-size: 80%;
}
sidebar p {
text-align: left !important;
}
code, pre {
font-family: Courier, "Courier New", monospace;
font-size: 90%;
}
pre.note {
font-size: 90%; /* font size of less than 90% is impossible to read */
}
h1 {
font-family: arial,helvetica,sans-serif;
font-size: 140%;
font-weight: bold;
color: #000066;
}
h2 {
font-family: arial,helvetica,sans-serif;
font-size: 125%;
font-weight: bold;
color: #000066;
}
h3 {
font-family: arial,helvetica,sans-serif;
font-size: 110%;
font-weight: bold;
color: #000066;
}
h4 {
font-family: arial,helvetica,sans-serif;
font-size: 100%;
font-weight: bold;
color: #000066;
}
small {
font-family: arial,helvetica,sans-serif;
font-size: 75%;
}
a.small {
font-family: arial,helvetica,sans-serif;
font-size: 75%;
text-decoration: none;
}
tableTitle {
font-family: arial,helvetica,sans-serif;
font-weight: bold;
}
tableExtras {
font-family: arial,helvetica,sans-serif;
font-size: 85%;
color: #FFFFFF;
}
input {
font-family: arial,helvetica,sans-serif;
}
textarea {
font-family: arial,helvetica,sans-serif;
}
input.small, select.small {
font-family: arial,helvetica,sans-serif;
font-size: 75%;
}
textarea.small {
font-family: arial,helvetica,sans-serif;
font-size: 75%;
}
p.formerror {
border: 1px solid #ff0000;
color: #000000;
background: #ffeeee;
padding: 2px 4px;
}
Index: phpweb/styles/default.css
+++ phpweb/styles/default.css
body, ul, td, th {
font-size: 85%;
}
p {
font-size: 85%;
}
em {
font-weight: bold;
font-style: italic;
}
acronym {
border-bottom: 1px dashed #00cc00;
cursor: help;
}
error {
color: #cc0000;
}
newsDate {
font-size: 85%;
font-style: italic;
color: #6666cc;
}
sidebar {
font-size: 80%;
}
sidebar p {
text-align: left !important;
}
code, pre {
font-size: 90%;
}
pre.note {
font-size: 90%; /* font size of less than 90% is impossible to read */
}
h1 {
font-size: 140%;
font-weight: bold;
color: #000066;
}
h2 {
font-size: 125%;
font-weight: bold;
color: #000066;
}
h3 {
font-size: 110%;
font-weight: bold;
color: #000066;
}
h4 {
font-size: 100%;
font-weight: bold;
color: #000066;
}
small {
font-size: 75%;
}
a.small {
font-size: 75%;
text-decoration: none;
}
tableTitle {
font-weight: bold;
}
tableExtras {
font-size: 85%;
color: #FFFFFF;
}
textarea,small, input.small, select.small {
font-size: 75%;
}
p.formerror {
border: 1px solid #ff0000;
color: #000000;
background: #ffeeee;
padding: 2px 4px;
}
Index: phpweb/styles/verdana.css
+++ phpweb/styles/verdana.css
body, ul, td, th {
font-family: verdana,arial,helvetica,sans-serif;
font-size: 85%;
}
p {
font-family: verdana,arial,helvetica,sans-serif;
font-size: 85%;
}
em {
font-weight: bold;
font-style: italic;
}
acronym {
border-bottom: 1px dashed #00cc00;
cursor: help;
}
error {
color: #cc0000;
}
newsDate {
font-size: 85%;
font-style: italic;
color: #6666cc;
}
sidebar {
font-size: 80%;
}
sidebar p {
text-align: left !important;
}
code, pre {
font-family: Courier, "Courier New", monospace;
font-size: 90%;
}
pre.note {
font-size: 90%; /* font size of less than 90% is impossible to read */
}
h1 {
font-family: verdana,arial,helvetica,sans-serif;
font-size: 140%;
font-weight: bold;
color: #000066;
}
h2 {
font-family: verdana,arial,helvetica,sans-serif;
font-size: 125%;
font-weight: bold;
color: #000066;
}
h3 {
font-family: verdana,arial,helvetica,sans-serif;
font-size: 110%;
font-weight: bold;
color: #000066;
}
h4 {
font-family: verdana,arial,helvetica,sans-serif;
font-size: 100%;
font-weight: bold;
color: #000066;
}
small {
font-family: verdana,arial,helvetica,sans-serif;
font-size: 75%;
}
a.small {
font-family: verdana,arial,helvetica,sans-serif;
font-size: 75%;
text-decoration: none;
}
tableTitle {
font-family: verdana,arial,helvetica,sans-serif;
font-weight: bold;
}
tableExtras {
font-family: verdana,arial,helvetica,sans-serif;
font-size: 85%;
color: #FFFFFF;
}
input {
font-family: verdana,arial,helvetica,sans-serif;
}
textarea {
font-family: verdana,arial,helvetica,sans-serif;
}
input.small, select.small {
font-family: verdana,arial,helvetica,sans-serif;
font-size: 75%;
}
textarea.small {
font-family: verdana,arial,helvetica,sans-serif;
font-size: 75%;
}
p.formerror {
border: 1px solid #ff0000;
color: #000000;
background: #ffeeee;
padding: 2px 4px;
}