5 /* assign it manually to force it to value "0" if it would be unset */
6 $year =prepvar("year" ,"[0-9]+",false/*required*/);
7 $month=prepvar("month","[0-9]+",false/*required*/);
13 $title_tail="Obsahy v¹ech èísel";
15 $title_tail="Obsahy èísel roku $year";
17 $month_a=month_a($year,$month);
18 $title_tail="Obsah èísla ".$month_a["name"];
22 .page { font-style: italic; }
25 print("<h1>$title_tail</h1>\n");
27 $result=db_query("select year,month,month_last,contents from $tb_obsah"
28 .($year ? " where year=$year" : "")
29 .($month ? " and month=$month" : "")
30 ." order by year,month"
32 if (!mysql_num_rows($result))
33 fatal("Obsah po¾adovan".($month ? "ého èísla" : "ých èísel")." bohu¾el není ulo¾en");
34 while ($row=mysql_fetch_array($result)) {
36 $month_a=month_a($row["year"],$row["month"],$row["month_last"]);
37 print("<h2>Èíslo ".$month_a["name"]."</h2>\n");
39 $contents=htmlspecialchars($sep_obsah_contents.$row["contents"]);
40 $contents=ereg_replace("http://[^[:space:]$page_obsah_contents$sep_obsah_contents]+",
41 "<a href=\"\\0\">\\0</a>",$contents);
42 $contents=ereg_replace("$page_obsah_contents([^$sep_obsah_contents]+)",
43 "<br /><div class=\"page\">strana ... \\1</div>",$contents);
44 $contents=ereg_replace("\n","<br />\n\t\t",$contents);
45 $contents=ereg_replace("$sep_obsah_contents([^$sep_obsah_contents]*)","\t<li>\\1</li>\n",$contents);
46 print("<ul>\n$contents</ul>\n");
48 mysql_free_result($result);