X-Git-Url: https://git.jankratochvil.net/?a=blobdiff_plain;f=common.php;h=93df63c5ec8ff83a7e7b6d8a3bef9c9dc003427b;hb=03d36b034bbe5c674a89de64ba021f694bf11370;hp=3691b89dbba12699ec32280a54a4fd9e025b2f24;hpb=eaf9eedf3893df136b41689a349c378f6c7302d1;p=www.energie.vellum.cz.git diff --git a/common.php b/common.php index 3691b89..93df63c 100644 --- a/common.php +++ b/common.php @@ -2,7 +2,6 @@ error_reporting(E_ALL); setlocale(LC_ALL,"cs_CZ.iso-8859-2"); - fixampvars(); include("config.php"); @@ -11,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)) @@ -43,17 +63,6 @@ function fixampvars() } } -function addpercents($url) -{ - $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); -} - function fatal($msg="UNKNOWN") { global $admin_mail; @@ -182,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\""); @@ -190,7 +199,9 @@ function img($file,$alt,$attrs="") function gsm_banking() { - return(img("img/sluzby_bankovni_pggsm.".(image_supported("video/x-mng") ? "mng" : "gif"), + global $energie_base; + + return(img($energie_base."img/sluzby_bankovni_pggsm.".(image_supported("video/x-mng") ? "mng" : "gif"), "Paegas GSM banking","class=\"img-align\"")); } @@ -373,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ì, @@ -389,7 +402,7 @@ zvolte pros

  • - @@ -397,7 +410,7 @@ zvolte pros
    ".img("img/adobe-pdficon-alpha.".(image_supported("image/png") ? "png" : "gif"), +
    ".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 @@ -615,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: @@ -628,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"]); ?>
    - +