Cheers!
Kirk
Code: Select all
<?php include("includes/MySQL_Functions.php"); include("includes/page_functions.php");
$mysql = new MySQL_Functions();
$mysql->connect();
$page = $mysql->query("SELECT * FROM pages WHERE url='".mysql_real_escape_string($_SERVER['PHP_SELF'])."' LIMIT 1", "single");
if($page==""){
$mysql->insert("INSERT INTO pages(url, title, description, content) VALUES('".mysql_real_escape_string($_SERVER['PHP_SELF'])."', '".mysql_real_escape_string(basename($_SERVER['SCRIPT_NAME']))."', ' ', 'Lorem ipsum dolor sit amet.')");
$page = $mysql->query("SELECT * FROM pages WHERE id='".$mysql->get_last_id()."' LIMIT 1", "single");
if(isset($_COOKIE['admin'])){
}else{
$mysql->close();
redirect("./");
}
}
//$galleries = $mysql->query("SELECT gallery.id, gallery.name FROM gallery, page_gallery WHERE gallery.id=page_gallery.gallery_id AND page_gallery.page_id='".$page["id"]."'");
$mysql->close();
?>
<meta name="description" content="<?=$page["description"]?>" />
<title><?=$page["title"]?></title>
<?php if(isset($_COOKIE['admin'])){?><a href="edit_page.php?edit-field=<?=$page["id"]?>" rel="lyteframe[EditPage]" title="Page Editor" rev="width: 800px; height: 600px; scrolling: no;">Edit Page</a><br /><br /><?php }?>
<?=$page["content"]?>