Compare commits

..

No commits in common. "2b69f73dbe845c03d90dd691483a8989f18b209e" and "f81bfc8f3e2a2c68158cc07a11f94d0f0ca09efc" have entirely different histories.

2 changed files with 19 additions and 36 deletions

View file

@ -8,27 +8,26 @@ include_once($COMMONS."/header.php");
*/
function display_blog_preview($blogpost_id, $blogpost_addr, $title, $abstract,
$date_posted, $tags){
print_r("
<div class=\"blog-preview\">
<table class=\"noborder-table\" style=\"width: 100%;\">
<tr><td>");
if(is_null($blogpost_addr)) {
printf("
<div class=\"blog-preview\">
<a href=\"http://www.zdenekborovec-dev.cz/blog/article?blogpost_id=%s\">
<h3>
%s
</h3>
</a>
", $blogpost_id, $title);
}
else {
printf("
<div class=\"blog-preview\">
<a href=\"http://www.zdenekborovec-dev.cz/blog/article/%s\">
<h3>
%s
</h3>
</a></td>
</a>
", $blogpost_addr, $title);
if (isset($_COOKIE["PHPSESSID"]) &&
(bool)($_SESSION["current_user"]->permissions & 128)) {
print_r("<td style=\"display: inline-block; text-align: right;
width: 100%;\">");
printf("<a
href=\"http://www.zdenekborovec-dev.cz/blog/writearticle?guid=%s\"
style=\"border: dotted black;\">edit</a></td>", $blogpost_id);
}
print_r("</tr></table>");
print_r("<table class=\"noborder-table\" style=\"width: 100%;\">
<tr><td class=\"blog-tags\">");

View file

@ -175,7 +175,6 @@ function remove_blogpost_tags($conn, $blogpost_id) {
* (space-separated).
* @param $abstract Abstract for 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,
$content) {
@ -198,9 +197,6 @@ function publish_blogpost($conn, $blogpost_addr, $title, $tagStr, $abstract,
// Add the new tags to the blogpost
add_tags_to_blogpost($conn, $blogpost_id, $tagStr);
// Return the newly generated blogposts id.
return $blogpost_id;
}
/**
@ -266,26 +262,14 @@ if(isset($_POST["submit"])) {
$abstract, $content);
}
else {
$blogpostId = publish_blogpost($conn, $address, $title, $tagsStr,
$abstract, $content);
publish_blogpost($conn, $address, $title, $tagsStr, $abstract,
$content);
}
generate_atom_feed($conn);
// Show button to generate the article
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;
header("Location: http://www.zdenekborovec-dev.cz/blog");
die();
}
if(isset($_GET["guid"])) {
@ -364,7 +348,7 @@ printf("
<input name=\"submit\" type=\"submit\" value=\"Send File\">
</form>
</article>
", $blogId_prefill, $title_prefill, $address_prefill, $tagStr_prefill,
$abstract_prefill, $content_prefill);
", $blogId_prefill, $title_prefill, $address_prefill, $tagStr_prefill, $abstract_prefill,
$content_prefill);
include_once($COMMONS."/footer.php");
?>