Browse Source

Fixed bad query.

pull/24/head
Teknikode 4 years ago
parent
commit
ecc3840231
2 changed files with 4 additions and 4 deletions
  1. 2
    2
      blog/publish_post.php
  2. 2
    2
      templates/default/js/blog.js

+ 2
- 2
blog/publish_post.php View File

@@ -6,11 +6,11 @@ $id = 0;
if(isset($_POST) && $logged_in)
{
$id = rawurldecode($_POST['id']);
$publish = rawurldecode($_POST['publish']);
$post = $db->select('blog', "id=? LIMIT 1", array($id));
if ($post)
{
$success = true;
$publish = $post['publish'];
if ($success && !$user->admin && $post_select['author_id'] != $user->id)
{
$error = "You are not allowed to publish this post.";
@@ -24,7 +24,7 @@ if(isset($_POST) && $logged_in)
if ($success)
{
$data = array(
"publish" => $publish,
"published" => $publish,
"date_published" => date("Y-m-d H:i:s",time())
);


+ 2
- 2
templates/default/js/blog.js View File

@@ -237,7 +237,7 @@ function linkPostUnpublish(selector)
$.ajax({
type: "POST",
url: "../../../publish_post.php",
data: "publish=FALSE&id="+post_id,
data: "publish=0&id="+post_id,
success: function(html)
{
if(html=='true')
@@ -262,7 +262,7 @@ function linkPostPublish(selector)
$.ajax({
type: "POST",
url: "../../../publish_post.php",
data: "publish=TRUE&id="+post_id,
data: "publish=1&id="+post_id,
success: function(html)
{
if(html=='true')

Loading…
Cancel
Save