Fix for temporary ViewCVS location change: http://short.vellum.cz/cgi-bin/ -> /cgi/
[www.energie.vellum.cz.git] / index.php
index 76bc201..ae49cda 100644 (file)
--- a/index.php
+++ b/index.php
@@ -20,8 +20,9 @@
        <li><a href="title.php">V¹echny roèníky</a></li>
 <?php
 
-       $getdate=getdate();
-       $year=$getdate["year"];
+       // Current year may be different (higher) but when no such content exists
+       // yet, it is better to at least provide the last year.
+       $year=db_item("select max(year) from $tb_obsah");
 
        $result=db_query("select distinct year from $tb_obsah order by year");
        while (($row=mysql_fetch_array($result)))