X-Git-Url: https://git.jankratochvil.net/?a=blobdiff_plain;f=common.php;h=118f447b1a335a6d8b1a3e24dc9536bb9051b7d7;hb=0fba5aa6fc0e9c92ec49f7153564eca739ab84be;hp=d66927fbaa3ccd1f1e5240f7a2ff07086cd46f2c;hpb=47ab3e6dace011856d9829a5f910913d7ae9d96e;p=www.energie.vellum.cz.git diff --git a/common.php b/common.php index d66927f..118f447 100644 --- a/common.php +++ b/common.php @@ -43,6 +43,7 @@ function fatal($msg="UNKNOWN") { global $admin_mail; + heading(false/*title*/); // it is always safe print("\n

 
 


Nastala chyba pøi zpracování: $msg!

\n" ."

Mù¾ete tento problém nahlásit správci tohoto webu.

\n"); footer(); @@ -70,7 +71,7 @@ function prepvar($name,$regex=".",$require=true) if (!isset($v)) return(0); - $globals[$name]=$v; + $GLOBALS[$name]=$v; return($v); } @@ -97,7 +98,7 @@ function db_query($query) return($r); } -function db_row($query) +function db_row($query) // pure indexes { $q=db_query($query); $r=mysql_fetch_row($q); @@ -105,7 +106,7 @@ function db_row($query) return($r); } -function db_array($query) +function db_array($query) // field-names associative { $q=db_query($query); $r=mysql_fetch_array($q); @@ -221,11 +222,19 @@ function title_icons_table_month($year,$month,$month_last,$sequential) global $tb_clanek; $month_a=month_a($year,$month,$month_last,$sequential); - print("" - .img($month_a["icon"],"titulní stránka ".$month_a["name_full"])."
" - ."obsah ".$month_a["name"].""); - if (db_item("select count(*) from $tb_clanek where year=$year and month=$month")) - print("
ukázka èlánkù"); + print("" + ."\n" + ."\n" + ."
".$month_a["name"]."
" + .img($month_a["icon"],"titulní stránka ".$month_a["name_full"])."
\n" + ."• titulní strana
\n" + ."• obsah
\n"); + $result=db_query("select name,id from $tb_clanek where year=$year and month=$month order by id"); + while ($row=mysql_fetch_array($result)) + print("• " + .htmlspecialchars($row["name"])."
\n"); + mysql_free_result($result); + print("
"); } function title_icons($year,$month) @@ -244,7 +253,7 @@ function title_icons($year,$month) .(isset($year) && isset($month) ? " and" : "") .(isset($month) ? " month=$month" : "") ." order by year,month"); - $split=6; + $split=4; // $year variable changes its meaning here!!! if (isset($year)) @@ -339,6 +348,15 @@ function data_href($filename,$text) return("$text (".usersize(filesize($filename)).")"); } +function footer_img($url,$text,$size) +{ + global $footer_LOCAL; + if (!isset($footer_LOCAL)) + return("\"$text\""); + else + return($text); +} + function footer($delimit=true) { // deadlock prevention: @@ -356,11 +374,12 @@ function footer($delimit=true) + print($uri); ?>">
alt="Valid XHTML 1.1!" /> alt="Valid CSS!" />
=4) - print(''."\n"); + if (!isset($msie_major) || $msie_major>=4) { + print(''."\n"); + } ?> -Energie & peníze<?php +<head><?php + print("<title>$title_prefix"); if (isset($title_tail)) print(": ".htmlspecialchars($title_tail)); print("\n"); @@ -414,7 +444,7 @@ h1,h2 { color: yellow; background-color: transparent; } print($head); print("\n"); if ($title) print("

"