$blogentry_id = !empty($_POST['blogentry_id']) ? $_POST['blogentry_id'] : (!empty($_GET['blogentry_id']) ? $_GET['blogentry_id'] : NULL); // TRACKBACK COMPATIBILITY if (empty($_POST['e_id']) && !empty($blogentry_id)) { $_POST['e_id'] = $blogentry_id; } // CREATE BLOG OBJECT $blog = new se_blog($user->user_exists ? $user->user_info['user_id'] : NULL); // TRACKBACKS if ($task == "trackback") { // Redirect if no data if (!empty($blogentry_id) && empty($_POST['url']) && empty($_GET['url'])) { $blogentry_info = $blog->blog_entry_info($blogentry_id); header('Location: ' . $url->url_create('blog_entry', $blogentry_info['user_username'], $blogentry_id)); exit; } echo $blog->blog_trackback_receive(); exit; } /* ***** ACTIONS BELOW THIS LINE REQUIRE THE USER TO BE LOGGED IN ***** */ if (!$user->user_exists) { echo json_encode(array('result' => FALSE)); exit; } // DELETE if ($task == "deleteblog") { $result = $blog->blog_entry_delete($blogentry_id); echo json_encode(array('result' => $result ? 'success' : 'failure')); exit; } elseif ($task == "previewblog") { $page = "blog"; $owner =& $user;