Location: PHPKode > projects > Stack's Wiki > stacks-wiki-0.5.1/www/index.php
<?
session_start();

require_once("includes/params.php");
require_once("includes/page.php");

if (get_magic_quotes_gpc())
{
	$page = new Page(stripslashes($_REQUEST["id"]));
}
else
{
	$page = new Page($_REQUEST["id"]);
}
?>
<html>
<head>
	<title><? echo $wiki_title ?> :: <? echo $page->id ?></title>
	<script type="text/javascript" src="scripts/prototype.js"></script>
	<script type="text/javascript" src="scripts/scriptaculous.js"></script>
	<script type="text/javascript" src="scripts/messages.js"></script>
	<script type="text/javascript" src="scripts/index.js"></script>
	<link rel="stylesheet" href="styles/screen.css" type="text/css" />
	<!--[if gte IE 5.5000]>
	<style type="text/css">img { behavior: url('includes/pngbehavior.htc'); }</style>
	<![endif]-->
</head>
<body>

	<input type="hidden" id="id" value="<? echo $page->id ?>" />
	
	<div id="navigation_panel">
		<a href="index.php" title="Home Page">Home Page</a> ::
		<a href="categories.php" title="Categories">Categories</a>
		<hr />
	</div>
	
	<div id="content_panel" style="display: <? echo $_REQUEST['edit'] == '1' && isset($_SESSION[logged_in]) ? "none" : "block" ?>">
	<? echo $page->formatted_content; ?>
		<hr />
	</div>

	<div id="edit_panel" style="display: <? echo $_REQUEST['edit'] == '1' && isset($_SESSION[logged_in]) ? "block" : "none" ?>">
		<label for="raw_content">Raw Content:</label>
		<br />
		<textarea id="raw_content" cols="80" rows="24"><? echo $page->raw_content ?></textarea>
		<br />
		<table border="0">
			<tr>
				<td><label for="category">Category:</label></td>
				<td><label for="editor">Editor:</label></td>
			</tr>
			<tr>
				<td><input type="text" id="category" name="category" maxlength="50" value="<? echo $page->category ?>" /><div id="category_autocomplete" class="autocomplete"></div></td>
				<td><input type="text" id="editor" maxlength="50" value="<? 
					if (isset($_SESSION['last_editor'])) echo $_SESSION['last_editor'];
					elseif ($page->exists && $page->revised_on == null) echo $page->created_by;
					elseif ($page->exists) echo $page->revised_by;
					else echo "Anonymous Coward";
					?>" /></td>
			</tr>
		</table>
		<p class="content_footer">
			Press Ctrl-Enter to save, Esc to cancel
		</p>
		<hr />
	</div>
	
	<? if ($_REQUEST['edit'] == '1' && isset($_SESSION[logged_in])) { ?>
	<script type="text/javascript">
		Field.focus('raw_content');
	</script>
	<? } ?>
	
	<div id="locked_panel" style="display: none">
		<h1>This Page Is Locked For Editing</h1>
		<p>
			Someone is editing this page.  Please try again later.  Pages will
			automatically unlock after 10 minutes if an edit is abandoned.
		</p>
	</div>
	
	<div id="message_panel"></div>
	
	<div id="control_panel">
	
		<span id="default_controls" style="display: <? echo isset($_SESSION['logged_in']) ? "none" : "inline" ?>">
			<a href="#" id="show_login" title="Login">Login</a>
		</span>
		
		<span id="login_controls" style="display: none">
			<input type="password" id="password" />
			<a href="#" id="login" title="Login">Login</a> ::
			<a href="#" id="cancel_login" title="Cancel">Cancel</a>
			<span id="login_wait" style="display: none">Please wait...</span>
		</span>
		
		<span id="main_controls" style="display: <? echo isset($_SESSION['logged_in']) ? $_REQUEST['edit'] == "1" ? "none" : "inline" : "none" ?>">
			<a href="#" id="add_page" title="Add Page">Add A Page</a> ::
			<a href="#" id="edit_page" title="Edit Page">Edit This Page</a> ::
			<a href="#" id="delete_page" title="Delete Page">Delete This Page</a> ::
			<a href="#" id="logout" title="Log Out">Log Out</a>
			<span id="main_wait" style="display: none">Please wait...</span>
		</span>
		
		<span id="edit_controls" style="display: <? echo $_REQUEST['edit'] == "1" && isset($_SESSION['logged_in']) ? "inline" : "none" ?>">
			<a href="#" id="save_page" title="Save These Changes">Save These Changes</a> ::
			<a href="#" id="cancel_edit" title="Cancel">Cancel</a>
			<span id="edit_wait" style="display: none">Please wait...</span>
		</span>
		
		<span id="add_controls" style="display: none">
			<input type="text" id="new_page" />
			<a href="#" id="go_to" title="Go To This Page">Go To This Page</a> ::
			<a href="#" id="cancel_add" title="Cancel">Cancel</a>
			<span id="add_wait" style="display: none">Please wait...</span>
		</span>

	</div>

</body>
</html>
Return current item: Stack's Wiki