',
$width,
$height,
($align ? 'align="'.$align.'" ' : ''),
($extras ? $extras : '')
);
}
# resize_image()
# tag the output of make_image() and resize it manually
#
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(' style="height:%d; width:%d;">', $height, $width);
return $str;
}
# make_image()
# return an IMG tag for a given file (relative to the images dir)
#
function make_image($file, $alt = false, $align = false, $extras = false, $dir = false, $border = 0) {
if (!$dir) {
$dir = "/gifs";
}
if ($size = @getimagesize($_SERVER['DOCUMENT_ROOT'].$dir.'/'.$file)) {
$image = sprintf('',
$dir,
$file,
$border,
$size[3],
($alt ? $alt : ''),
($align ? ' align="'.$align.'"' : ''),
($extras ? ' '.$extras : '')
);
} else {
$image = sprintf('',
$dir,
$file,
$border,
($alt ? $alt : ''),
($align ? ' align="'.$align.'"' : ''),
($extras ? ' '.$extras : '')
);
}
return $image;
}
# print_image()
# print an IMG tag for a given file
#
function print_image($file, $alt = false, $align = false, $extras = false, $dir = false, $border = 0) {
print make_image($file, $alt, $align, $extras, $dir);
}
# make_submit()
# - make a submit button image
#
function make_submit($file, $alt = false, $align = false, $extras = false, $dir = false, $border = 0) {
if (!$dir) {
$dir = "/gifs";
}
$return = make_image($file, $alt, $align, $extras, $dir, $border);
$return = str_replace(' border="' . $border . '"', '', ' | ', $color);
}
# hdelim()
# print a horizontal delimiter (just a wide line);
#
function hdelim($color = '#000000') {
echo '
';
}
# make_link()
# return a hyperlink to something, within the site
#
function make_link($url, $linktext=false, $target=false, $extras=false) {
return sprintf("%s",
$url,
($target ? ' target="'.$target.'"' : ''),
($extras ? ' '.$extras : ''),
($linktext ? $linktext : $url)
);
}
# print_link()
# echo a hyperlink to something, within the site
#
function print_link($url, $linktext = false, $target = false, $extras = false) {
echo make_link($url, $linktext, $target, $extras);
}
# make_email()
# make an e-mail hyperlink
#
function make_email($email, $linktext = false) {
return sprintf("%s",
$email,
($linktext ? $linktext : $email)
);
}
# print_email()
# echo an e-mail hyperlink
#
function print_email($email, $linktext = false) {
echo make_email($email, $linktext);
}
# commonheader()
#
#
function commonHeader($title = false, $padding = true) {
global $SIDEBAR_DATA;
ob_start();
?>
PHP-GTK
|
|
" cellspacing="0">
");
}
?>
|
|
|
|
All rights reserved.
|
Last updated:
|
";
return $div;
}
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim: expandtab sw=4 ts=4 fdm=marker softtabstop=4
*/
?>