X-Git-Url: https://git.jankratochvil.net/?p=www.energie.vellum.cz.git;a=blobdiff_plain;f=obsah.php;h=4aa257e2ccabebff0a52d7c2e925375bed1a5158;hp=669795d6358aea3178754cd39df8ea385cec1ad3;hb=HEAD;hpb=72ed4b0b640d8896f479b36c119cf61f3e7c7925
diff --git a/obsah.php b/obsah.php
index 669795d..4aa257e 100644
--- a/obsah.php
+++ b/obsah.php
@@ -21,12 +21,16 @@
$head_css="
.page { font-style: italic; }
";
- heading();
+
+ // Prevent indexing of pages with multiple months of the content, any
+ // websearch robot should get indexed the right one specific page anyway.
+ heading(true/*title*/,($year && $month)/*indexme*/);
+
print("
$title_tail
\n");
- $result=db_query("select year,month,month_last,contents from $tb_obsah"
- .($year ? " where year=$year" : "")
- .($month ? " and month=$month" : "")
+ $result=db_query("select year,month,month_last,contents from $tb_obsah where contents is not null"
+ .($year ? " and year=$year" : "")
+ .($month ? " and month=$month" : "")
." order by year,month"
);
if (!mysql_num_rows($result))
@@ -36,15 +40,30 @@
$month_a=month_a($row["year"],$row["month"],$row["month_last"]);
print("Èíslo ".$month_a["name_full"]."
\n");
}
- $contents=htmlspecialchars($sep_obsah_contents.$row["contents"]);
+ $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(ereg_replace("\\|.*\$","",$article_row["name"]))
+ .")([\n$page_obsah_contents])",
+ "$sep_obsah_contents"
+ .""
+ ."\\1"
+ ."\\2",$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$appendix_obsah_contents]+)",
- "
strana ... \\1
",$contents);
+ "
strana ... \\1",$contents);
$contents=ereg_replace("\n","
\n\t\t",$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";
+ $contents=$contents_a[0]."\tPøílohy:\n".ereg_replace("\t","\t\t",$contents_a[1])."\t
\n";
print("\n");
}
mysql_free_result($result);