$trand = rand(1,3);
$kgName = 'H'; // Hochdorf
if ($trand == 2) $kgName = 'S';
else if ($trand == 3) $kgName = 'V';
// get the full request URI
$myUrl = $_SERVER['REQUEST_URI'];
$CornersPath = '/home/***/public_html/xxx'.$TemplatePath.'/corner';
if (preg_match('/hochdorf-ho/i', $myUrl)) {$kgName = 'H'; $tempCornerImage=jpg_count($CornersPath, $kgName);}
if (preg_match('/schietingen-sc/i', $myUrl)) {$kgName = 'S'; $tempCornerImage=jpg_count($CornersPath, $kgName);}
if (preg_match('/vollmaringen-vo/i', $myUrl)) {$kgName = 'V'; $tempCornerImage=jpg_count($CornersPath, $kgName);}
...
if ($tempViewCorner) {
echo "
.corner { background:url(".$TemplatePath."/corner/".$kgName.sprintf("%03d",rand(1,$tempCornerImage)) .".jpg) top left no-repeat; }
";
...
Lesezeichen