+function db_array() (differentiate from db_row()!)
[www.energie.vellum.cz.git] / common.php
index ab99ea7..4c6a1aa 100644 (file)
@@ -105,6 +105,14 @@ function db_row($query)
        return($r);
 }
 
+function db_array($query)
+{
+       $q=db_query($query);
+       $r=mysql_fetch_array($q);
+       mysql_free_result($q);
+       return($r);
+}
+
 function db_item($query)
 {
        $row=db_row($query);
@@ -210,11 +218,14 @@ function title_month($year,$month)
 
 function title_icons_table_month($year,$month,$month_last,$sequential)
 {
+       global $tb_clanek;
+
        $month_a=month_a($year,$month,$month_last,$sequential);
        print("<a href=\"title.php?year=$year&amp;month=$month\">"
                                .img($month_a["icon"],"titulní stránka ".$month_a["name_full"])."</a><br />"
-                       ."<a href=\"obsah.php?year=$year&amp;month=$month\">obsah ".$month_a["name"]."</a>"
-                       );
+                       ."<a href=\"obsah.php?year=$year&amp;month=$month\">obsah ".$month_a["name"]."</a>");
+       if (db_item("select count(*) from $tb_clanek where year=$year and month=$month"))
+               print("<br /><a href=\"clanek.php?year=$year&amp;month=$month\">ukázka èlánkù</a>");
 }
 
 function title_icons($year,$month)
@@ -361,7 +372,7 @@ function heading()
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs" lang="cs">
 <head><title>Energie &amp; peníze<?php
        if (isset($title_tail))
-               print(": $title_tail");
+               print(": ".htmlspecialchars($title_tail));
        print("</title>\n");
        if ($have_css) {
 ?><style type="text/css"><!--