Exemple #1
0
 function createHandler($p)
 {
     $session = SessionHandler::getInstance();
     $o = new BlogEntry();
     $o->owner = $session->id;
     $o->subject = trim($p['subject']);
     $o->body = trim($p['body']);
     $o->time_created = sql_datetime(time());
     $o->time_published = sql_datetime(time());
     $o->id = $o->store();
     js_redirect('a/blogs/overview');
 }
Exemple #2
0
// Check permissions
if (!$g_user->hasPermission('plugin_blog_admin')) {
    camp_html_display_error(getGS('You do not have the right to manage blogs.'));
    exit;
}

$f_blog_id = Input::Get('f_blog_id', 'int');
$f_entry_id = Input::Get('f_entry_id', 'int');

if (!$f_entry_id) {
    $user_id = $g_user->getUserId();   
}

$BlogEntry = new BlogEntry($f_entry_id, $f_blog_id);

if ($BlogEntry->store($is_admin, $user_id)) {
    camp_html_add_msg(getGS('Post saved.'), 'ok');
    ?>
    <script language="javascript">
        window.opener.location.reload();
        window.close();
    </script>
    <?php
    exit();
}

?>
<head>
    <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<META HTTP-EQUIV="Expires" CONTENT="now">
	<link rel="stylesheet" type="text/css" href="<?php echo $Campsite['WEBSITE_URL']; ?>/admin-style/admin_stylesheet.css" />