X-Git-Url: http://git.jankratochvil.net/?p=www.energie.vellum.cz.git;a=blobdiff_plain;f=obsah.php;h=4aa257e2ccabebff0a52d7c2e925375bed1a5158;hp=978dfc6f86d7a4e67387b5c2df7a8ecbe5e69618;hb=HEAD;hpb=1416b4a806fd6cfd7d5c06f2496d3816ab8eb3c5
diff --git a/obsah.php b/obsah.php
index 978dfc6..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))
@@ -37,18 +41,19 @@
print("Èíslo ".$month_a["name_full"]."
\n");
}
$contents=$sep_obsah_contents.$row["contents"];
- $contents=htmlspecialchars($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",
+ $contents=ereg_replace("$sep_obsah_contents("
+ .quotemeta(ereg_replace("\\|.*\$","",$article_row["name"]))
+ .")([\n$page_obsah_contents])",
"$sep_obsah_contents"
.""
."\\1"
- ."$page_obsah_contents",$contents);
+ ."\\2",$contents);
mysql_free_result($article_result);
$contents=ereg_replace("http://[^[:space:]$page_obsah_contents$sep_obsah_contents]+",