Always display the LAST year content, not the current year (may not exist yet)
authorshort <>
Wed, 9 Jan 2002 20:43:41 +0000 (20:43 +0000)
committershort <>
Wed, 9 Jan 2002 20:43:41 +0000 (20:43 +0000)
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
 
        <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)))
 
        $result=db_query("select distinct year from $tb_obsah order by year");
        while (($row=mysql_fetch_array($result)))