2 // display.php: fetch page or get default content
3 // calls transform.php for actual transformation of wiki markup to HTML
4 rcs_id('$Id: display.php,v 1.5 2000-12-30 21:09:13 ahollosi Exp $');
6 // if we got GET data, the first item is always a page name
7 // if it wasn't this file would not have been included
9 if (!empty($argv[0])) {
10 $pagename = rawurldecode($argv[0]);
12 $pagename = gettext("FrontPage");
14 // if there is no FrontPage, create a basic set of Wiki pages
15 if (! IsWikiPage($dbi, $pagename)) {
16 include "lib/setupwiki.php";
21 $enc_name = rawurlencode($pagename);
22 $pagehash = RetrievePage($dbi, $pagename, $WikiPageStore);
24 // we render the page if it exists, else ask the user to write one.
25 if (is_array($pagehash)) {
26 // transform.php returns $html containing all the HTML markup
27 include("lib/transform.php");
29 $html .= sprintf(gettext("Describe %s here."),
30 "$pagename<a href='$ScriptUrl?edit=$enc_name'>?</a>");
33 GeneratePage('BROWSE', $html, $pagename, $pagehash);
36 IncreaseHitCount($dbi, $pagename);