cvs: phpweb /include layout.inc
| From: | Gabor Hojtsy | Date: | Sun, 02 Mar 2003 17:56:09 +0000 |
| Subject: | cvs: phpweb /include layout.inc | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-16011@lists.php.net to get a copy of this message | ||
goba Sun Mar 2 12:56:09 2003 EDT
Modified files:
/phpweb/include layout.inc
Log:
Fixing some validity problems, so the images will be right and
the form option tags will have closing pairs...
Index: phpweb/include/layout.inc
diff -u phpweb/include/layout.inc:1.124 phpweb/include/layout.inc:1.125
--- phpweb/include/layout.inc:1.124 Sun Mar 2 12:33:30 2003
+++ phpweb/include/layout.inc Sun Mar 2 12:56:09 2003
@@ -1,6 +1,6 @@
<?php
-/* $Id: layout.inc,v 1.124 2003/03/02 17:33:30 goba Exp $ */
+/* $Id: layout.inc,v 1.125 2003/03/02 17:56:09 goba Exp $ */
// Print an image for a sized spacer
function spacer($width = 1, $height = 1, $return = false, $align = false, $extras = false)
@@ -16,13 +16,13 @@
# resize_image()
# tag the output of make_image() and resize it manually
+# (considering possible HTML/XHTML image tag endings)
#
function resize_image($img, $width=1, $height=1) {
- $str = preg_replace('/width=\"([0-9]+?)\"/i', '', $img );
- $str = preg_replace('/height=\"([0-9]+?)\"/i', '', $str );
- $str = substr($str,0,-1) . sprintf(' height="%s" width="%s" />',
$height, $width );
- return $str;
+ $str = preg_replace('!width=\"([0-9]+?)\"!i', '', $img );
+ $str = preg_replace('!height=\"([0-9]+?)\"!i', '', $str );
+ return preg_replace('!/?>$!', sprintf(' height="%s"
width="%s" />', $height, $width), $str);
}
# make_image()
@@ -35,7 +35,7 @@
$dir = '/images';
}
if ($size = @getimagesize($HTTP_SERVER_VARS['DOCUMENT_ROOT'].$dir.'/'.$file))
{
- $image = sprintf('<img src="%s/%s" border="%d" %s ALT="%s"
%s%s />',
+ $image = sprintf('<img src="%s/%s" border="%d" %s alt="%s"
%s%s />',
$dir,
$file,
$border,
@@ -45,7 +45,7 @@
($extras ? ' '.$extras : '')
);
} else {
- $image = sprintf('<img src="%s/%s" border="%d" ALT="%s"
%s%s />',
+ $image = sprintf('<img src="%s/%s" border="%d" alt="%s"
%s%s />',
$dir,
$file,
$border,
@@ -249,13 +249,13 @@
<input class="small" type="text" name="pattern" value=""
size="30" accesskey="s" />
<small>in the</small>
<select name="show" class="small">
-<option value="quickref" selected>function list
-<option value="wholesite">whole site
-<option value="manual">online documentation [en]
-<option value="bugdb">bug database
-<option value="maillist">general mailing list
-<option value="devlist">developer mailing list
-<option value="phpdoc">documentation mailing list
+<option value="quickref" selected>function list</option>
+<option value="wholesite">whole site</option>
+<option value="manual">online documentation [en]</option>
+<option value="bugdb">bug database</option>
+<option value="maillist">general mailing list</option>
+<option value="devlist">developer mailing list</option>
+<option value="phpdoc">documentation mailing list </option>
</select>
<?php echo make_submit('small_submit_white.gif', 'search',
'bottom'); ?>
</form>