4 #-- This is an example standalone lite-CMS Homepage based on ewiki.php
6 # - it requires PHP4.1+
7 # - you should install it as index.php into your dedicated webspace
8 # - copy the ewiki.php there, too
9 # - DON'T upload the tools/ directory, as this requires a lot more
10 # setup to be used securely
11 # - HTML Editors usually allow you to tweak the layout without
12 # garbaging the PHP code inside
13 # - authentication is done using JavaScript+Cookies
14 # - requires a MySQL database, just visit http://freesql.org/ and
15 # get happy (if your provider doesn't provide one)
16 # - there will be no pages initially, you must first create some
17 # - most config options are in the upper area of this file:
19 $HOMEPAGE_TITLE = 'MyHomepage';
20 $LOGIN_PASSWORD = 'ewiki';
21 $AUTHOR_NAME = 'your_nickname_here';
22 $MYSQL_HOST = 'localhost';
25 $MYSQL_DATABASE = 'test';
29 mysql_connect($MYSQL_HOST, $MYSQL_USER, $MYSQL_PASSWORD);
30 mysql_query("use $MYSQL_DATABASE");
33 #-- no errors shown from here
36 #-- check for password
37 if ($LOGIN_PASSWORD == "password") die("poor");
38 if ($_COOKIE["password"]) {
39 if ($LOGIN_PASSWORD == $_COOKIE["password"]) {
40 $ewiki_author = $AUTHOR_NAME;
43 $page_content == "<h3>password wrong</h3>";
48 define("EWIKI_EDIT_AUTHENTICATE", 1);
49 define("EWIKI_SCRIPT", substr(__FILE__, strrpos(__FILE__, "/") + 1) . "?page=");
50 define("EWIKI_SCRIPT_BINARY", substr(__FILE__, strrpos(__FILE__, "/") + 1) . "?binary=");
51 define("EWIKI_PAGE_INDEX", $HOMEPAGE_TITLE);
52 define("EWIKI_CONTROL_LINE", 0);
53 define("EWIKI_T_CANNOTCHANGEPAGE", "You must first login to change a page.");
57 if (empty($page_content)) {
58 $page_content = ewiki_page();
62 ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
65 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
66 <title><?php echo($ewiki_title); ?></title>
67 <meta name="GENERATOR" content="ewiki" />
68 <meta name="ROBOTS" content="INDEX,FOLLOW" />
70 <style type="text/css">
73 background-color:#6666ee;
77 background-color:#111166;
79 border: 2px solid #000055;
84 a,a:link { color: #ffff33; text-decoration: none; }
85 a:active { color: #FF6666; }
86 a:visited { color: #660000; }
87 a:hover { font-weight:900; background-color:#ffff00; color:#000000; }
88 .menu a { color:#ffffff; }
89 .menu a:hover { color:#000000; }
93 <script type="text/javascript">
98 var password = window.prompt("Please enter the administrator password:");
99 window.document.cookie = "password=" + password;
100 window.document.location.reload();
105 window.document.cookie = "password=";
116 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="10" WIDTH="90%">
119 <TD WIDTH="120" VALIGN="TOP">
123 <h3>Welcome to my Homepage!</h3>
126 <A HREF=".">Startpage</A> <BR>
128 <A HREF="?page=EMailMe">EMailMe</A> <BR>
130 <A HREF="?page=MyLinks">MyLinks</A> <BR>
140 echo "<A HREF=\"javascript:logout()\">Logout</A><BR>";
141 echo "<A HREF=\"?page=edit/$ewiki_title\">EditThisPage</A><BR>";
142 echo "<A HREF=\"?page=info/$ewiki_title\">PageInfo</A><BR>";
147 echo "<A HREF=\"?page=links/$ewiki_title\">Links to here</A><BR><BR>";
149 echo "<SMALL><A HREF=\"javascript:login()\">EditorLogin</A><BR></SMALL>";
158 <TD VALIGN="TOP" WIDTH="90%">
159 <DIV CLASS="content">