return($r);
}
-function img_size($width,$height=0)
+function img_size($width,$height)
{
- if (!$height)
- list($width,$height)=getimagesize($width);
return("style=\"border:0;width:${width}px;height:${height}px\" width=\"$width\" height=\"$height\"");
}
+function img($file,$alt,$attrs="")
+{
+ list($width,$height)=getimagesize($file);
+ return("<img src=\"$file\" alt=\"".htmlspecialchars($alt)."\" ".img_size($width,$height)
+ .($attrs=="" ? "" : " ".$attrs)." />");
+}
+
function gsm_banking()
{
- return("<img src=\"img/sluzby_bankovni_pggsm.gif\" ".img_size(89,31)." alt=\"Paegas GSM banking\" class=\"img-align\" />");
+ return(img("img/sluzby_bankovni_pggsm.gif","Paegas GSM banking","class=\"img-align\""));
}
function price_a()
return(""
."<table border=\"0\" width=\"100%\">\n"
."<tr><td align=\"center\"><table border=\"1\" cellpadding=\"10\">\n"
- ."<tr><td align=\"center\"><img src=\"".$month_a["img"]."\" ".img_size($month_a["img"])
- ." alt=\"titulní stránka ".$month_a["name"]."\" /></td></tr>\n"
+ ."<tr><td align=\"center\">".img($month_a["img"],"titulní stránka ".$month_a["name"])."</td></tr>\n"
."</table></td></tr>\n"
."</table>\n"
);
{
$month_a=month_a($year,$month,$month_last);
print("<a href=\"title.php?year=$year&month=$month\">"
- ."<img src=\"".$month_a["icon"]."\" ".img_size($month_a["icon"])
- ." alt=\"titulní stránka ".$month_a["name"]."\" /></a><br />"
+ .img($month_a["icon"],"titulní stránka ".$month_a["name"])."</a><br />"
."<a href=\"obsah.php?year=$year&month=$month\">obsah ".$month_a["name"]."</a>"
);
}
";
heading();
?>
-<h1 class="centered"><img src="img/eap-title<?php
-
- if (image_supported("image/png"))
- print(".png");
- else
- print(".gif");
-
- ?>" <?php print(img_size(522,60)); ?> alt="Energie & Peníze" /></h1>
+<h1 class="centered"><?php
+ print(img("img/eap-title.".(image_supported("image/png") ? "png" : "gif"),"Energie & Peníze"));
+ ?></h1>
<ul>
<li><a href="obsah.php">Obsahy v¹ech roèníkù</a></li>
<li><a href="title.php">V¹echny roèníky</a></li>