Location: PHPKode > projects > 230 CMS > 230CMS 0.8/include/themes/notebook/notebook.php
<?php
if(stristr(htmlentities($_SERVER['PHP_SELF']), "notebook.php")){
	die("You cannot access this file directly!");
}
//The Notepad++ like theme

include_once("230.php");

/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++DON'T EDIT THESE. THESE ARE THE FUNCTIONS FOR THE EDIT BAR AND CREATE-PAGE BARS++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
function createBar() {
	$box .= "<form method='post' action='special.php?e=create'>";
	$box .= "<label='pagename'>What's the page's name you'd like to create? </label>";
	$box .= "<input type='text' name='pagename' size='55' value='' />";
	$box .= "<input type='submit' name='create' value='Create Page' />";
	$box .= "</form>";
	
	return $box;
}

function editBar() {
	global $newrow;
	require_once("230.php");
	if(is_numeric($_GET['id']) && $_GET['id'] > 0)
	{
		$id = htmlentities($_GET['id']);
		$r = query("SELECT * FROM ". DATABASE_PREFIX ."articles WHERE id = '".safeQuery($id)."' LIMIT 1");
		$newrow = mysql_fetch_array($r);
		
	}
	elseif(isset($_GET['title']))
	{
	
		$pagename = htmlentities($_GET['title']);
		$r = query("SELECT * FROM ". DATABASE_PREFIX ."articles WHERE pagename = '".safeQuery($pagename)."' AND revision = 'No' LIMIT 1");
		$newrow = mysql_fetch_array($r);
		
	}
	else
	{
		echo 'You cannot edit this page!';
	}
	//$boxEdit .= "<div class='editBar' align='right'>";
	//$boxEdit .= "<table cellpadding='5px'>";
	$boxEdit .= "<form method='post' action='special.php?e=edit' />";
	$boxEdit .= "<label='pagename'>Edit this page </label>";
	//$boxEdit .= "<label='id'>PageID</label></td></tr>";
	//$page = $row['pagename']
	$boxEdit .= "<select name='pagename'>";
	$boxEdit .= '<option selected>'.$newrow['pagename'].'</option>';
		/*if($page == $row['pagename'])
		{
			echo 'selected';
		}*/
	$boxEdit .= "</select>";
	$boxEdit .= "<select name='id'>";
	$boxEdit .= '<option selected>'.$newrow['id'].'</option>';
	$boxEdit .= "</select>";
	$boxEdit .= "<input type='submit' name='edit' value='Edit Page'/>";
	$boxEdit .= "</form>";

	return $boxEdit;
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title><?php echo SITENAME.'::'.$title;?></title>
<meta content='7 days' name='revisit' />
<meta content='7 days' name='revisit-after' />
<meta content='230 CMS' name='generator' />
<?php if($row['revision']== 'Yes') echo "<meta content =\"NOINDEX, NOFOLLOW, NOARCHIVE\" name=\"robots\" />\n";?>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<link title="sheet" rel="StyleSheet" type="text/css" href="include/themes/notebook/notebook.css" >
</head>
<body>
<div id="siteTitle">
<?php echo '<a href="index.php">'.SITENAME.'</a>';?><div id="subTitle"><?php echo SITE_SUBTITLE;?></div>
</div>
	
<div id="editBar">
	<?php echo editBar();?>
</div>
	
<div id="leftsideBar">
	
</div>
	
<div id="content">	
<h1><?php echo $title;?></h1>
<br>		
			
<?php echo parsedcontent();?>
			
<div id="Author">Edited by: <?php echo '<a href="index.php?user='.$name.'">'.$name.'</a>';?></div>
<div id="sitebars">
		<?echo "<table>";
		echo '<tbody><tr>';
		
		/*CHANGES FORM r0.4b: The "Admin", "All Pages" and "Revisions" forms use GET instead of POST methods. 
		This is a solution to the "Firefox Resend" dialog popup that appears whenever you click on the Back button of the browser.
		*/
		
		if($_SESSION['logged']=true){
			if($_SESSION['admin']=='1'){
				echo "<td><span></span><form method='get' action='special.php?admin=admin'><input type='submit' name='admin' value='Admin'/></form></td>";
			}
			if($_SESSION['admin']=='1' || $_SESSION['moderator']=='1'){
			//$bottomMenu .= '<td><span></span><form method="post" action="/users/createArticle.php"><input type="submit" value="Create Page"/></form></td>';
			}
			if($_SESSION['admin']=='1' || $_SESSION['moderator']=='1' || $_SESSION['registered']=='1'){
			//$bottomMenu .= '<td><span></span><form method="post" action="/users/updatePage.php"><input type="submit" value="Edit Page"/></form></td>';
			//$bottomMenu .= '<td><span></span><form method="post" action="/users/updateUserpage.php"><input type="submit" value="Edit Userpage"/></form></td>';
				echo "<td><span></span><form method='post' action='special.php?page=logout'><input type='submit' name='logout' value='Logout'/></form></td>";
			}
		}
		echo "<td><span></span><form method='get' action='index.php'><input type='submit' name='' value='Home'/></form></td>";
		echo "<td><span></span><form method='get' action='all.php'><input type='submit' name='allpages' value='All pages'/></form></td>";
		echo "<td><span></span><form method='get' action='revisions.php'><input type='submit' name='allrevs' value='Revisions'/></form></td>";
		if(empty($_SESSION['username']))
		{
			echo "<td><span></span><form method='get' action='special.php?page=login'><input type='submit' name= 'page' value='login'/></form></td>";
		}
		//echo '<td><span></span><form method="post" action="textFormatting.php"><input type="submit" value="Help"/></form></td>';
		echo '</tr>';
		echo '</tbody></table>';?>
</div>
</div>
<br>
<div id="createBar">
<?php echo createBar();?>
</div>
<br>
<div id="footer"><?php include_once("include/themes/footer.php"); echo footer();?></div>
<br>
</body>
</html>
<?php
//THE END!!
?>

Return current item: 230 CMS