Beispiel #1
0
}

if (isset($message) && $message) {
    $tool_content .= $message . "<br/>";
}

//show blog post
if ($action == "showPost") {
    $tool_content .= action_bar(array(
            array('title' => $langBack,
                    'url' => "$_SERVER[SCRIPT_NAME]?$url_params&amp;action=showBlog",
                    'icon' => 'fa-reply',
                    'level' => 'primary-label')
    ));
    $post = new BlogPost();
    if ($post->loadFromDB($pId)) {
        if ($blog_type == 'course_blog') {
            $allow_to_edit = $post->permEdit($is_editor, $stud_allow_create, $uid);
        } elseif ($blog_type == 'perso_blog') {
            $allow_to_edit = $is_blog_editor;
        }
        $post->incViews();
        $sharing_content = '';
        $rating_content = '';
        if ($sharing_allowed) {
            $sharing_content = ($sharing_enabled) ? print_sharing_links($urlServer."modules/blog/index.php?$url_params&amp;action=showPost&amp;pId=".$post->getId(), $post->getTitle()) : '';
        }
        if ($ratings_enabled) {
            $rating = new Rating('up_down', 'blogpost', $post->getId());
            if ($blog_type == 'course_blog') {
                $rating_content = $rating->put($is_editor, $uid, $course_id);