X-Git-Url: https://git.jankratochvil.net/?a=blobdiff_plain;f=obsah.php;h=1213d27066204af966dc89595354e74a22bb105e;hb=60a709272016a3082b7df61e3d116334c0de267f;hp=4addde7cc656b20fbf813ea64a65749ab0ab4337;hpb=2fcd486ab1a2b13e09e95d1f0d485cebec37499e;p=www.energie.vellum.cz.git
diff --git a/obsah.php b/obsah.php
index 4addde7..1213d27 100644
--- a/obsah.php
+++ b/obsah.php
@@ -13,8 +13,10 @@
$title_tail="Obsahy v¹ech èísel";
else if (!$month)
$title_tail="Obsahy èísel roku $year";
- else
- $title_tail="Obsah èísla $year/".month_full($year,$month);
+ else {
+ $month_a=month_a($year,$month);
+ $title_tail="Obsah èísla ".$month_a["name_full"];
+ }
$head_css="
.page { font-style: italic; }
@@ -22,24 +24,40 @@
heading();
print("
$title_tail
\n");
- db_connect();
$result=db_query("select year,month,month_last,contents from $tb_obsah"
- .($year ? " where year='$year'" : "")
- .($month ? " and month='$month'" : "")
+ .($year ? " where year=$year" : "")
+ .($month ? " and month=$month" : "")
." order by year,month"
);
if (!mysql_num_rows($result))
fatal("Obsah po¾adovan".($month ? "ého èísla" : "ých èísel")." bohu¾el není ulo¾en");
while ($row=mysql_fetch_array($result)) {
- if (!$month)
- print("Èíslo ".$row["year"]."/".month_full($row["year"],$row["month"],$row["month_last"])."
\n");
+ if (!$month) {
+ $month_a=month_a($row["year"],$row["month"],$row["month_last"]);
+ print("Èíslo ".$month_a["name_full"]."
\n");
+ }
$contents=$sep_obsah_contents.$row["contents"];
+
+ $article_result=db_query("select name,id from $tb_clanek"
+ ." where year=".$row[ "year"]
+ . " and month=".$row["month"]
+ );
+ while ($article_row=mysql_fetch_array($article_result))
+ $contents=ereg_replace("$sep_obsah_contents(".quotemeta($article_row["name"]).")$page_obsah_contents",
+ "$sep_obsah_contents"
+ .""
+ ."\\1"
+ ."$page_obsah_contents",$contents);
+ mysql_free_result($article_result);
+
$contents=ereg_replace("http://[^[:space:]$page_obsah_contents$sep_obsah_contents]+",
"\\0",$contents);
- $contents=ereg_replace("$page_obsah_contents([^$sep_obsah_contents]+)",
- "
strana ... \\1
",$contents);
+ $contents=ereg_replace("$page_obsah_contents([^$sep_obsah_contents$appendix_obsah_contents]+)",
+ "
strana ... \\1",$contents);
$contents=ereg_replace("\n","
\n\t\t",$contents);
- $contents=ereg_replace("$sep_obsah_contents([^$sep_obsah_contents]*)","\t\\1\n",$contents);
+ $contents=ereg_replace("$sep_obsah_contents([^$sep_obsah_contents$appendix_obsah_contents]*)","\t\\1\n",$contents);
+ if (1Pøílohy:\n".ereg_replace("\t","\t\t",$contents_a[1])."\t
\n";
print("\n");
}
mysql_free_result($result);