cvs: phpweb / style.css /include layout.inc /manual add-note.php
| From: | jim winstead | Date: | Wed, 02 Jan 2002 00:37:02 +0000 |
| Subject: | cvs: phpweb / style.css /include layout.inc /manual add-note.php | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-8024@lists.php.net to get a copy of this message | ||
jimw Tue Jan 1 19:37:02 2002 EDT
Modified files:
/phpweb style.css
/phpweb/include layout.inc
/phpweb/manual add-note.php
Log:
highlight urls in notes, use <pre> instead of <tt> to preserve formatting, and say
that html is disallowed entirely (although we still preserve <p>, </p>, and <br>
until entries in the database are cleaned up).
Index: phpweb/style.css
diff -u phpweb/style.css:1.16 phpweb/style.css:1.17
--- phpweb/style.css:1.16 Fri Oct 19 19:21:07 2001
+++ phpweb/style.css Tue Jan 1 19:37:01 2002
@@ -36,6 +36,10 @@
font-size: 90%;
}
+pre.note {
+ font-size: 80%;
+}
+
h1 {
font-family: arial,helvetica,sans-serif;
font-size: 140%;
Index: phpweb/include/layout.inc
diff -u phpweb/include/layout.inc:1.60 phpweb/include/layout.inc:1.61
--- phpweb/include/layout.inc:1.60 Sun Dec 9 10:11:28 2001
+++ phpweb/include/layout.inc Tue Jan 1 19:37:01 2002
@@ -1,5 +1,5 @@
<?php
-/* $Id: layout.inc,v 1.60 2001/12/09 15:11:28 goba Exp $ */
+/* $Id: layout.inc,v 1.61 2002/01/02 00:37:01 jimw Exp $ */
# spacer()
# print a IMG tag for a sized spacer GIF
@@ -185,7 +185,6 @@
<head>
<title>PHP<?php if ($title) echo ": $title";?></title>
<link rel="stylesheet" href="/style.css">
- <meta name="MSSmartTagsPreventParsing" content="TRUE">
</head>
<body topmargin="0" leftmargin="0" marginheight="0"
marginwidth="0"
@@ -383,16 +382,24 @@
function clean_note($text) {
$text = htmlspecialchars(trim($text));
+
+ /* turn urls into links */
+ $text =
preg_replace("/((mailto|http|ftp|nntp|news):.+?)(>|\\s|\\)|\\.\\s|$)/","<a
href=\"\\1\">\\1</a>\\3",$text);
+
+ /* this 'fixing' code will go away eventually. */
$fixes = array('<br>','<p>','</p>');
reset($fixes);
while (list(,$f)=each($fixes)) {
$text=str_replace(htmlspecialchars($f), $f, $text);
$text=str_replace(htmlspecialchars(strtoupper($f)), $f, $text);
}
+
+ /* this will only break long lines */
if (function_exists("wordwrap")) {
$text = wordwrap($text);
}
- $text = "<tt>".nl2br($text)."</tt>";
+
+ $text = "<pre class=\"note\">".$text."</pre>";
return $text;
}
Index: phpweb/manual/add-note.php
diff -u phpweb/manual/add-note.php:1.31 phpweb/manual/add-note.php:1.32
--- phpweb/manual/add-note.php:1.31 Thu Dec 13 09:20:59 2001
+++ phpweb/manual/add-note.php Tue Jan 1 19:37:01 2002
@@ -71,10 +71,10 @@
address in the little one (usual anti-spam practices are OK, e.g.
johnNOSPAM@doe.NO_SPAM.com).</p>
-<p>Note that most HTML tags are not allowed in the posts. We tried
-allowing them in the past, but people invariably made a mess of
-things making the manual hard to read for everybody. You can include
-<p>, </p>, and <br> tags.</p>
+<p>Note that HTML tags are not allowed in the posts, but the note is presented
+in side a <pre> element so formatting is preserved. URLs will be turned
+into clickable links automatically. (Double-check that your note appears as you
+want during the preview. That's why it is there!)</p>
<p>Read the following note carefully. If your post falls into one of the
categories mentioned there, it will be rejected by one of the editors.</p>