article editor generates statically
This commit is contained in:
parent
c9533bf686
commit
bbe31d4f82
1 changed files with 22 additions and 6 deletions
|
@ -175,6 +175,7 @@ function remove_blogpost_tags($conn, $blogpost_id) {
|
||||||
* (space-separated).
|
* (space-separated).
|
||||||
* @param $abstract Abstract for the article.
|
* @param $abstract Abstract for the article.
|
||||||
* @param $content Content of the article.
|
* @param $content Content of the article.
|
||||||
|
* @returns The guid of the newly generated blogpost.
|
||||||
*/
|
*/
|
||||||
function publish_blogpost($conn, $blogpost_addr, $title, $tagStr, $abstract,
|
function publish_blogpost($conn, $blogpost_addr, $title, $tagStr, $abstract,
|
||||||
$content) {
|
$content) {
|
||||||
|
@ -197,6 +198,9 @@ function publish_blogpost($conn, $blogpost_addr, $title, $tagStr, $abstract,
|
||||||
|
|
||||||
// Add the new tags to the blogpost
|
// Add the new tags to the blogpost
|
||||||
add_tags_to_blogpost($conn, $blogpost_id, $tagStr);
|
add_tags_to_blogpost($conn, $blogpost_id, $tagStr);
|
||||||
|
|
||||||
|
// Return the newly generated blogposts id.
|
||||||
|
return $blogpost_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -262,14 +266,26 @@ if(isset($_POST["submit"])) {
|
||||||
$abstract, $content);
|
$abstract, $content);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
publish_blogpost($conn, $address, $title, $tagsStr, $abstract,
|
$blogpostId = publish_blogpost($conn, $address, $title, $tagsStr,
|
||||||
$content);
|
$abstract, $content);
|
||||||
}
|
}
|
||||||
|
|
||||||
generate_atom_feed($conn);
|
generate_atom_feed($conn);
|
||||||
|
|
||||||
header("Location: http://www.zdenekborovec-dev.cz/blog");
|
// Show button to generate the article
|
||||||
die();
|
printf("
|
||||||
|
<article>
|
||||||
|
<form method=\"post\"
|
||||||
|
action=\"http://www.zdenekborovec-dev.cz/blog/generatearticle/\">
|
||||||
|
<input type=\"hidden\" name=\"blogpost_id\" value=\"%s\">
|
||||||
|
<input type=\"hidden\" name=\"referer\"
|
||||||
|
value=\"http://www.zdenekborovec-dev.cz/blog/article/%s\">
|
||||||
|
<input name=\"submit\" type=\"submit\" value=\"Generate article\">
|
||||||
|
</form>
|
||||||
|
</article>
|
||||||
|
", $blogpostId, $address);
|
||||||
|
include_once($COMMONS."/footer.php");
|
||||||
|
die;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_GET["guid"])) {
|
if(isset($_GET["guid"])) {
|
||||||
|
@ -348,7 +364,7 @@ printf("
|
||||||
<input name=\"submit\" type=\"submit\" value=\"Send File\">
|
<input name=\"submit\" type=\"submit\" value=\"Send File\">
|
||||||
</form>
|
</form>
|
||||||
</article>
|
</article>
|
||||||
", $blogId_prefill, $title_prefill, $address_prefill, $tagStr_prefill, $abstract_prefill,
|
", $blogId_prefill, $title_prefill, $address_prefill, $tagStr_prefill,
|
||||||
$content_prefill);
|
$abstract_prefill, $content_prefill);
|
||||||
include_once($COMMONS."/footer.php");
|
include_once($COMMONS."/footer.php");
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in a new issue