Article name optional format: fullname|shortname
authorshort <>
Wed, 9 Oct 2002 00:02:53 +0000 (00:02 +0000)
committershort <>
Wed, 9 Oct 2002 00:02:53 +0000 (00:02 +0000)
 - <shortname> is used in indexes, <fullname> everywhere else

clanek.php
common.php
obsah.php

index 00f581e..662c0a1 100644 (file)
@@ -28,7 +28,7 @@ caption     { color: aqua; background-color: transparent; }
 
 function print_article($row)
 {
 
 function print_article($row)
 {
-       print("<h2>".htmlspecialchars($row["name"])."</h2>\n".$row["contents"]);
+       print("<h2>".htmlspecialchars(ereg_replace("\\|.*\$","",$row["name"]))."</h2>\n".$row["contents"]);
 }
 
        if (isset($id))
 }
 
        if (isset($id))
index 85835de..461fb6a 100644 (file)
@@ -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("&bull;&nbsp;<a href=\"clanek.php?year=$year&amp;month=$month&amp;id=".$row["id"]."\">"
        $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("&bull;&nbsp;<a href=\"clanek.php?year=$year&amp;month=$month&amp;id=".$row["id"]."\">"
-                               .htmlspecialchars($row["name"])."</a><br />\n");
+                               .htmlspecialchars(ereg_replace("^.*\\|","",$row["name"]))."</a><br />\n");
        mysql_free_result($result);
        print("</td></tr></table>");
 }
        mysql_free_result($result);
        print("</td></tr></table>");
 }
index 1203d72..4aa257e 100644 (file)
--- a/obsah.php
+++ b/obsah.php
@@ -47,7 +47,9 @@
                                .  " and month=".$row["month"]
                                );
                while ($article_row=mysql_fetch_array($article_result))
                                .  " 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"
                                                        ."<a href=\"clanek.php?year=".$row["year"]."&amp;month=".$row["month"]."&amp;id=".$article_row["id"]."\">"
                                                        ."\\1</a>"
                                        "$sep_obsah_contents"
                                                        ."<a href=\"clanek.php?year=".$row["year"]."&amp;month=".$row["month"]."&amp;id=".$article_row["id"]."\">"
                                                        ."\\1</a>"