]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/display.php
Changed occurances of *php3 to *php.
[SourceForge/phpwiki.git] / lib / display.php
1 <!-- $Id: display.php,v 1.2 2000-10-08 18:12:14 wainstead 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 = "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 .= "Describe $pagename<a href='$ScriptUrl?edit=$enc_name'>?</a> here.\n";
32    }
33
34    GeneratePage('BROWSE', $html, $pagename, $pagehash);
35    flush();
36
37    IncreaseHitCount($dbi, $pagename);
38 ?>