]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/display.php
internationalization patch (based on Jan Nieuwenhuizen's original patch)
[SourceForge/phpwiki.git] / lib / display.php
1 <!-- $Id: display.php,v 1.3 2000-10-19 21:36:50 ahollosi Exp $ -->
2 <?php
3    /*
4       display.php: render a page. This has all the display 
5       logic in it, except for the search boxes.
6    */
7  
8    // if we got GET data, the first item is always a page name
9    // if it wasn't this file would not have been included
10
11    if ($argv[0]) {
12       $pagename = rawurldecode($argv[0]);
13    } else { 
14       $pagename = gettext("FrontPage");
15
16       // if there is no FrontPage, create a basic set of Wiki pages
17       if (! IsWikiPage($dbi, $pagename)) {
18          include "lib/setupwiki.php";
19       }
20    }
21
22    $html = "";
23    $enc_name = rawurlencode($pagename);
24    $pagehash = RetrievePage($dbi, $pagename, $WikiPageStore);
25
26    if (is_array($pagehash)) {
27       // we render the page if it's a hash, else ask the user to write one.
28       // This file returns a variable $html containing all the HTML markup
29       include("lib/transform.php");
30    } else {
31       $html .= sprintf(gettext("Describe %s here."),
32                        "$pagename<a href='$ScriptUrl?edit=$enc_name'>?</a>");
33    }
34
35    GeneratePage('BROWSE', $html, $pagename, $pagehash);
36    flush();
37
38    IncreaseHitCount($dbi, $pagename);
39 ?>