X-Git-Url: http://git.jankratochvil.net/?a=blobdiff_plain;f=common.php;h=d66927fbaa3ccd1f1e5240f7a2ff07086cd46f2c;hb=b6706dbfce855578ede6abdc3a810f17c81d61f7;hp=4c6a1aad33d89f510de5c18a2fbfbf138ea722a0;hpb=5edc2041acd486869b4b5644afb800bcc3e71b7f;p=www.energie.vellum.cz.git diff --git a/common.php b/common.php index 4c6a1aa..d66927f 100644 --- a/common.php +++ b/common.php @@ -10,7 +10,7 @@ $cvs_id_split=split(" ",$cvs_id); if (count($cvs_id_split)==8) { $cvs_id_split[1]="".$cvs_id_split[1].""; - $cvs_id_split[5]="".$cvs_id_split[5].""; + $cvs_id_split[5]="".$cvs_id_split[5].""; } $cvs_id_html=join(" ",$cvs_id_split); @@ -19,7 +19,7 @@ if (isset($detect_js) && !$have_js) $head.=''."\n"; - $user_agent=$HTTP_SERVER_VARS["HTTP_USER_AGENT"]; + $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)) $msie_major=$msie_major_a[1]; else if (ereg("[[:<:]]Mozilla/([0-9]+)\\.",$user_agent,$mozilla_major_a)) @@ -233,7 +233,7 @@ function title_icons($year,$month) global $tb_obsah; print("

" - .(isset($year) ? "" : "") + .(isset($year) ? "" : "") .title_name(&$year,&$month) .(isset($year) ? "" : "") ."

\n"); @@ -262,7 +262,7 @@ function title_icons($year,$month) $year=$row["year"]; print("" - .(!isset($wanted_year) ? "

 

" : "") + .(!isset($wanted_year) ? "

 

" : "") ."
\n" ."\n" ); @@ -281,7 +281,7 @@ function title_icons($year,$month) print(""); $month++; } - print("
Roèník $year (obsahy èísel)
"); title_icons_table_month($year,$row["month"]+1,$row["month_last"]+1,$row["sequential"]); @@ -324,6 +324,21 @@ function dirnameslashed($filename) return($r); } +function usersize($size) +{ + $suffix_a=array("","k","M","G","T"); + while ($size>=1000 && sizeof($suffix_a)>=2) { + $size/=1000; + array_shift($suffix_a); + } + return(round($size)." ".$suffix_a[0]."B"); +} + +function data_href($filename,$text) +{ + return("$text (".usersize(filesize($filename)).")"); +} + function footer($delimit=true) { // deadlock prevention: @@ -335,19 +350,20 @@ function footer($delimit=true) global $cvs_id_html,$viewcvs,$viewcvs,$HTTP_SERVER_VARS; if ($delimit) print("

 

\n"); + $uri="uri=".addpercents("http://".$HTTP_SERVER_VARS["HTTP_HOST"].$HTTP_SERVER_VARS["REQUEST_URI"]); ?>
alt="Valid XHTML 1.0!" />"> alt="Valid XHTML 1.1!" /> alt="Valid CSS!" />
- =4) - print(''."\n"); + print(''."\n"); ?> - - + + Energie & peníze<?php if (isset($title_tail)) print(": ".htmlspecialchars($title_tail)); print("\n"); if ($have_css) { ?>