diff --git a/www/kb-show.php3 b/www/kb-show.php3 index 17bf4cbce5dc05e4d5b39123c7803e005d6bfec2..b4516af558b9232e7ed03eda452e5e9a7009a9bb 100644 --- a/www/kb-show.php3 +++ b/www/kb-show.php3 @@ -1,68 +1,16 @@ - - - - \n"; -} -else { - echo " - Printable version of this document
\n"; -} - -# -# Admin users get a menu. -# -if (($this_user = CheckLogin($ignore))) { - $isadmin = ISADMIN(); -} -else { - $isadmin = 0; -} - -# -# Check record. -# -if (isset($idx) && $idx != "") { - if (! TBvalid_integer($idx)) { - PAGEARGERROR("Invalid characters in $idx"); - } - $query_result = - DBQueryFatal("select * from knowledge_base_entries ". - "where idx='$idx'"); - if (! mysql_num_rows($query_result)) { - USERERROR("No such knowledge_base entry: $idx", 1); - } - $row = mysql_fetch_array($query_result); - $xref_tag = $row['xref_tag']; -} -elseif (isset($xref_tag) && $xref_tag != "") { +if (isset($xref_tag) && $xref_tag != "") { if (! preg_match("/^[-\w]+$/", $xref_tag)) { PAGEARGERROR("Invalid characters in $xref_tag"); } @@ -75,78 +23,9 @@ elseif (isset($xref_tag) && $xref_tag != "") { $row = mysql_fetch_array($query_result); $idx = $row['idx']; } - -else { - PAGEARGERROR("Must supply a knowledge_base index or xref tag"); -} - - -echo "
Knowledge Base Entry: $idx $xref_tag
". - "(Search Again)
\n"; -echo "

\n"; - -if (!$printable && $isadmin) { - SUBPAGESTART(); - SUBMENUSTART("Options"); - - WRITESUBMENUBUTTON("Modify Entry", - "kb-manage.php3?idx=$idx&action=edit"); - WRITESUBMENUBUTTON("Delete Entry", - "kb-manage.php3?idx=$idx&action=delete"); - WRITESUBMENUBUTTON("Add Entry", "kb-manage.php3"); - SUBMENUEND(); -} - -echo "
\n"; -echo "" . $row['title'] . "\n"; -echo "

\n"; -echo $row['body']; - -echo "

\n"; -echo ""; -echo "Posted by " . $row['creator_uid'] . " on " . $row['date_created']; -if (isset($row['date_modified'])) { - echo ", "; - echo "Modified by " . $row['modifier_uid'] . " on " .$row['date_modified']; -} -echo "
\n"; - -# -# Get other similar topics and list the titles. -# -if (!$printable) { - $query_result = - DBQueryFatal("select * from knowledge_base_entries ". - "where section='". $row['section'] . "'"); - - if (mysql_num_rows($query_result)) { - echo "
"; - echo "Other similar topics:
\n"; - echo "
\n"; - echo "\n"; - echo "
\n"; - } -} - -if (!$printable && $isadmin) { - echo "
\n"; - SUBPAGEEND(); -} - -if ($printable) { - echo " - \n"; +if (isset($idx)) { + header("Location: $WIKIDOCURL/kb${idx}"); } else { - PAGEFOOTER(); -} -?> + header("Location: $WIKIDOCURL/KnowledgeBase"); +}