//show blog post if ($action == "showPost") { $tool_content .= action_bar(array( array('title' => $langBack, 'url' => "$_SERVER[SCRIPT_NAME]?$url_params&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&action=showPost&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); } elseif ($blog_type == 'perso_blog') { //in this case send user_id as third argument instead of course_id which is 0 //since we only need this info for identifying user's blog $rating_content = $rating->put(NULL, $uid, $user_id); } }