Exemple #1
0
    $blogentry_blogentrycat_id = $_POST['blogentry_blogentrycat_id'];
    $blogentry_body = str_replace("\r\n", "", htmlspecialchars_decode($blogentry_body));
    // GET CUSTOM BLOG STYLE IF ALLOWED
    if ($user->level_info['level_blog_style']) {
        $blogstyle_info = $database->database_fetch_assoc($database->database_query("SELECT blogstyle_css FROM se_blogstyles WHERE blogstyle_user_id='{$owner->user_info['user_id']}' LIMIT 1"));
        $global_css = $blogstyle_info['blogstyle_css'];
    }
    // GET ARCHIVE AND CATEGORIES
    $archive_list = $blog->blog_archive_generate();
    $category_list = $blog->blog_categories_generate();
    // ASSIGN VARIABLES AND DISPLAY BLOG PAGE
    $smarty->assign('total_blogentries', 1);
    $smarty->assign('entries', array(array('blogentry_id' => $blogentry_id, 'blogentry_title' => $blogentry_title, 'blogentry_body' => $blogentry_body, 'blogentry_blogentrycat_id' => $blogentry_blogentrycat_id)));
    $smarty->assign_by_ref('archive_list', $archive_list);
    $smarty->assign_by_ref('category_list', $category_list);
    $smarty->assign('p', 1);
    $smarty->assign('maxpage', 1);
    $smarty->assign('p_start', 1);
    $smarty->assign('p_end', 1);
    ob_end_clean();
    include "footer.php";
    exit;
} elseif ($task == "subscribeblog") {
    $result = $blog->blog_subscription_create($owner->user_info['user_id']);
    echo json_encode(array('result' => $result ? 'success' : 'failure'));
    exit;
} elseif ($task == "unsubscribeblog") {
    $result = $blog->blog_subscription_delete($owner->user_info['user_id']);
    echo json_encode(array('result' => $result ? 'success' : 'failure'));
    exit;
}