From 250a3701a5200ca9ae314469921b43c21ef09445 Mon Sep 17 00:00:00 2001 From: short <> Date: Wed, 9 Oct 2002 00:02:53 +0000 Subject: [PATCH] Article name optional format: fullname|shortname - is used in indexes, everywhere else --- clanek.php | 2 +- common.php | 2 +- obsah.php | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/clanek.php b/clanek.php index 00f581e..662c0a1 100644 --- a/clanek.php +++ b/clanek.php @@ -28,7 +28,7 @@ caption { color: aqua; background-color: transparent; } function print_article($row) { - print("

".htmlspecialchars($row["name"])."

\n".$row["contents"]); + print("

".htmlspecialchars(ereg_replace("\\|.*\$","",$row["name"]))."

\n".$row["contents"]); } if (isset($id)) diff --git a/common.php b/common.php index 85835de..461fb6a 100644 --- a/common.php +++ b/common.php @@ -262,7 +262,7 @@ function title_icons_table_month($year,$month,$month_last,$sequential,$has_conte $result=db_query("select name,id from $tb_clanek where year=$year and month=$month order by id"); while ($row=mysql_fetch_array($result)) print("• " - .htmlspecialchars($row["name"])."
\n"); + .htmlspecialchars(ereg_replace("^.*\\|","",$row["name"]))."
\n"); mysql_free_result($result); print(""); } diff --git a/obsah.php b/obsah.php index 1203d72..4aa257e 100644 --- a/obsah.php +++ b/obsah.php @@ -47,7 +47,9 @@ . " and month=".$row["month"] ); while ($article_row=mysql_fetch_array($article_result)) - $contents=ereg_replace("$sep_obsah_contents(".quotemeta($article_row["name"]).")([\n$page_obsah_contents])", + $contents=ereg_replace("$sep_obsah_contents(" + .quotemeta(ereg_replace("\\|.*\$","",$article_row["name"])) + .")([\n$page_obsah_contents])", "$sep_obsah_contents" ."" ."\\1" -- 1.8.3.1