X-Git-Url: https://git.jankratochvil.net/?a=blobdiff_plain;f=common.php;h=93df63c5ec8ff83a7e7b6d8a3bef9c9dc003427b;hb=03d36b034bbe5c674a89de64ba021f694bf11370;hp=69ffa306aaf97c4efeb8b27ecabbe97066fe18ce;hpb=958b747cca654215a5ca7a1138508952e2a522de;p=www.energie.vellum.cz.git diff --git a/common.php b/common.php index 69ffa30..93df63c 100644 --- a/common.php +++ b/common.php @@ -10,15 +10,36 @@ unset($viewcvs); $cvs_id_split=split(" ",$cvs_id); if (count($cvs_id_split)==8) { + $cvs_id_split[2]="" + ."" + .$cvs_id_split[2].""; $cvs_id_split[1]="".$cvs_id_split[1].""; $cvs_id_split[5]="".$cvs_id_split[5].""; } $cvs_id_html=join(" ",$cvs_id_split); + if (!isset($head)) + $head=""; + if (!isset($energie_base)) + $energie_base=""; + + unset($have_ent); + if (isset($HTTP_GET_VARS[ "have_ent"])) + $have_ent=true; + if (isset($HTTP_GET_VARS["amp;have_ent"])) + $have_ent=false; + if ((!isset($detect_ent) || $detect_ent) && !isset($have_ent) && $HTTP_SERVER_VARS["REQUEST_METHOD"]=="GET") + $head.=''."\n"; + fixampvars(); + $have_js=(isset($HTTP_GET_VARS["have_js"]) || isset($HTTP_POST_VARS["have_js"]) ? "?have_js=1" : ""); if (isset($detect_js) && !$have_js) - $head.=''."\n"; + $head.=''."\n"; $user_agent=(!isset($HTTP_SERVER_VARS["HTTP_USER_AGENT"]) ? "" : $HTTP_SERVER_VARS["HTTP_USER_AGENT"]); if (ereg("[[:<:]]MSIE ([0-9]+)\\.",$user_agent,$msie_major_a)) @@ -29,15 +50,17 @@ $have_style=!isset($mozilla_major) || $mozilla_major!=4; $have_css=true; // doesn't hurt anybody AFAIK -function addpercents($url) +function fixampvars() { - $r=$c=""; - foreach(preg_split('//', $url, -1, PREG_SPLIT_NO_EMPTY) as $c) - if (ereg("[a-zA-Z0-9]",$c)) - $r.=$c; - else - $r.=sprintf("%%%02X",ord($c)); - return($r); + $ars=array("HTTP_GET_VARS","HTTP_POST_VARS"); + foreach ($ars as $ar) { + foreach ($GLOBALS[$ar] as $key=>$val) { + if (substr($key,0,4)!="amp;") + continue; + unset($GLOBALS[$ar][$key]); + $GLOBALS[$ar][substr($key,4)]=$val; + } + } } function fatal($msg="UNKNOWN") @@ -168,7 +191,7 @@ function img_size($width,$height) function img($file,$alt,$attrs="") { - list($width,$height)=getimagesize($file); + list($width,$height)=getimagesize(ereg_replace("\\.mng\$",".gif",$file)); $alt=htmlspecialchars($alt); return("\"$alt\""); @@ -176,7 +199,10 @@ function img($file,$alt,$attrs="") function gsm_banking() { - return(img("img/sluzby_bankovni_pggsm.gif","Paegas GSM banking","class=\"img-align\"")); + global $energie_base; + + return(img($energie_base."img/sluzby_bankovni_pggsm.".(image_supported("video/x-mng") ? "mng" : "gif"), + "Paegas GSM banking","class=\"img-align\"")); } function price_a() @@ -358,6 +384,8 @@ function img_href($filename,$text) function print_pdf_layout($name,$base) { + global $energie_base; + $imgfmt=(image_supported("image/png") ? "png" : "gif"); ?>

Shodný je dostupný ve dvou rùzných formátech souboru. V pøípadì, @@ -374,14 +402,15 @@ zvolte pros

  • - +
    ".img("img/adobe-pdficon-alpha.gif","Adobe PDF").""); ?>
    ".img($energie_base."img/adobe-pdficon-alpha.".(image_supported("image/png") ? "png" : "gif"), + "Adobe PDF").""); ?>
    Soubor je ve formátu Adobe Acrobat, pro jeho pøeètení si prosím nainstalujte @@ -599,11 +628,31 @@ function footer_img($url,$text,$size) { global $footer_LOCAL; if (!isset($footer_LOCAL)) - return("\"$text\""); + return("\"$text\""); else return($text); } +function a_href($url,$contents) +{ + global $have_ent,$energie_base; + + $r="$contents"; + return($r); +} + function footer($delimit=true) { // deadlock prevention: @@ -612,21 +661,21 @@ function footer($delimit=true) exit(); $footer_passed=true; - global $cvs_id_html,$viewcvs,$viewcvs,$HTTP_SERVER_VARS; + global $cvs_id_html,$viewcvs,$viewcvs,$HTTP_SERVER_VARS,$energie_base; if ($delimit) print("

     

    \n"); - $uri="uri=".addpercents("http://".$HTTP_SERVER_VARS["HTTP_HOST"].$HTTP_SERVER_VARS["REQUEST_URI"]); + $uri="uri=".urlencode("http://".$HTTP_SERVER_VARS["HTTP_HOST"].$HTTP_SERVER_VARS["REQUEST_URI"]); ?>
    - +