diff --git a/action.php b/action.php
index 5d9ab43..d88b0e2 100644
--- a/action.php
+++ b/action.php
@@ -61,6 +61,15 @@ switch ($VARS['action']) {
if ($insert) {
$data['uid'] = $_SESSION['uid'];
$database->insert('publications', $data);
+ // Make a header to get started
+ $database->insert('tiles', [
+ "pubid" => $database->id(),
+ "page" => 1,
+ "styleid" => 1,
+ "content" => "
" . $VARS['name'] . "
",
+ "width" => $VARS['columns'],
+ "order" => 0]
+ );
} else {
$database->update('publications', $data, ['pubid' => $VARS['pubid']]);
}
@@ -68,6 +77,7 @@ switch ($VARS['action']) {
returnToSender("pub_saved");
case "deletepub":
if ($database->has('publications', ['pubid' => $VARS['pubid']])) {
+ $database->delete('tiles', ['pubid' => $VARS['pubid']]);
$database->delete('publications', ['pubid' => $VARS['pubid']]);
returnToSender("pub_deleted");
}
diff --git a/lib/gencontent.php b/lib/gencontent.php
index 9b46a71..306cb31 100644
--- a/lib/gencontent.php
+++ b/lib/gencontent.php
@@ -16,6 +16,15 @@ if (!defined("IN_NEWSPEN")) {
}
ob_end_flush();
ob_start();
+
+if (defined("EDIT_MODE") && EDIT_MODE == true) {
+ ?>
+
+