cvs: phpweb /include layout.inc

From: Date: Sun, 04 May 2003 15:36:44 +0000
Subject: cvs: phpweb /include layout.inc
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-17304@lists.php.net to get a copy of this message
alindeman Sun May 4 11:36:44 2003 EDT Modified files: /phpweb/include layout.inc Log: My last commit didn't work, because there is no 'note' CSS class. Just convert <P> tags to <br>'s, to keep everything looking the same. Index: phpweb/include/layout.inc diff -u phpweb/include/layout.inc:1.144 phpweb/include/layout.inc:1.145 --- phpweb/include/layout.inc:1.144 Sun May 4 07:27:51 2003 +++ phpweb/include/layout.inc Sun May 4 11:36:44 2003 @@ -1,6 +1,6 @@ <?php -/* $Id: layout.inc,v 1.144 2003/05/04 11:27:51 goba Exp $ */ +/* $Id: layout.inc,v 1.145 2003/05/04 15:36:44 alindeman Exp $ */ // Print an image for a sized spacer function spacer($width = 1, $height = 1, $return = false, $align = false, $extras = false) @@ -392,18 +392,23 @@ $text = preg_replace("/((mailto|http|ftp|nntp|news):.+?)(&gt;|\\s|\\)|\"|\\.\\s|$)/","<a href=\"\\1\">\\1</a>\\3",$text); /* this 'fixing' code will go away eventually. */ - $fixes = array('<br>','<p>','</p>'); + $fixes = array('<br>', '</p>'); reset($fixes); while (list(,$f)=each($fixes)) { $text=str_replace(htmlspecialchars($f), $f, $text); $text=str_replace(htmlspecialchars(strtoupper($f)), $f, $text); } - /* Make sure <p> tags stay in the CSS "note" class*/ - $text = str_replace (array ('<P>', '<p>'), '<p class="note">', $text); + /* <p> tags make things look awfully weird (breaks things out of the <code> + tag). Just convert them to <br>'s + */ + $text = str_replace (array ('<P>', '<p>'), '<br>', $text); + + /* Remove </p> tags to prevent it from showing up in the note */ + $text = str_replace (array ('</P>', '</p>'), '', $text); /* preserve linebreaks */ - $text = str_replace("\n", "<br>", $text); + $text = str_replace("\n", "<br>", $text); /* this will only break long lines */ if (function_exists("wordwrap")) {

« previous php.mirrors (#17304) next »