energie_obsah.contents now permitted NULL to show just the title image
[www.energie.vellum.cz.git] / common.php
index 34f3ec6..85835de 100644 (file)
@@ -245,7 +245,7 @@ function title_month($year,$month)
                        );
 }
 
-function title_icons_table_month($year,$month,$month_last,$sequential)
+function title_icons_table_month($year,$month,$month_last,$sequential,$has_contents)
 {
        global $tb_clanek;
 
@@ -256,7 +256,9 @@ function title_icons_table_month($year,$month,$month_last,$sequential)
                                .img($month_a["icon"],"titulní stránka ".$month_a["name_full"])."</td></tr>\n"
                        ."<tr><td align=\"left\" valign=\"top\" class=\"nowrap\">\n"
                                ."&bull;&nbsp;<a href=\"title.php?year=$year&amp;month=$month\">titulní strana</a><br />\n"
-                               ."&bull;&nbsp;<a href=\"obsah.php?year=$year&amp;month=$month\">obsah</a><br />\n");
+                       );
+       if ($has_contents)
+               print("&bull;&nbsp;<a href=\"obsah.php?year=$year&amp;month=$month\">obsah</a><br />\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("&bull;&nbsp;<a href=\"clanek.php?year=$year&amp;month=$month&amp;id=".$row["id"]."\">"
@@ -275,7 +277,7 @@ function title_icons($year,$month)
                .(isset($year) ? "</a>" : "")
                ."</h2>\n");
 
-       $result=db_query("select year,month,month_last,sequential from $tb_obsah"
+       $result=db_query("select year,month,month_last,sequential,contents is not null as has_contents from $tb_obsah"
                        .(isset($year) || isset($month) ? " where" : "")
                        .(isset($year ) ? " year=$year"   : "")
                        .(isset($year) && isset($month) ? " and" : "")
@@ -321,7 +323,7 @@ function title_icons($year,$month)
                print("<td align=\"center\" valign=\"top\""
                                .($row["month_last"]!=$row["month"] ? " colspan=\"".($row["month_last"]+1-$row["month"])."\"" : "")
                                .">");
-               title_icons_table_month($year,$row["month"]+1,$row["month_last"]+1,$row["sequential"]);
+               title_icons_table_month($year,$row["month"]+1,$row["month_last"]+1,$row["sequential"],$row["has_contents"]);
                print("</td>\n");
                $month=$row["month_last"];
                }