Пример #1
0
                                <h3 class='panel-title'>
                                    ".q($post->getTitle())."
                                </h3>
                            </div>
                            <div class='panel-body'><div class='label label-success'>" . nice_format($post->getTime(), true). "</div><small>".$langBlogPostUser.display_user($post->getAuthor(), false, false)."</small><br><br>".standard_text_escape($post->getContent())."</div>
                            <div class='panel-footer'>
                                <div class='row'>
                                    <div class='col-sm-6'>$rating_content</div>
                                    <div class='col-sm-6 text-right'>$sharing_content</div>
                                </div>
                            </div>
                        </div>";
        
        if ($comments_enabled) {
            if ($post->getCommenting() == 1) {
                commenting_add_js(); //add js files needed for comments
                $comm = new Commenting('blogpost', $post->getId());
            if ($blog_type == 'course_blog') {
                $tool_content .= $comm->put($course_code, $is_editor, $uid, true);
            } elseif ($blog_type == 'perso_blog') {
                $tool_content .= $comm->put(NULL, $is_blog_editor, $uid, true);
            }
            }
        }
        
    } else {
        Session::Messages($langBlogPostNotFound);
        redirect_to_home_page("modules/blog/index.php?$url_params");  
    }

}
Пример #2
0
require_once 'class.blog.php';
require_once 'class.blogpost.php';
require_once 'include/course_settings.php';
require_once 'modules/sharing/sharing.php';
define('RSS', 'modules/blog/rss.php?course=' . $course_code);
load_js('tools.js');
$pageName = $langBlog;
$head_content .= '<script type="text/javascript">var langEmptyGroupName = "' . $langEmptyBlogPostTitle . '";</script>';
//check if commenting is enabled for blogs
$comments_enabled = setting_get(SETTING_BLOG_COMMENT_ENABLE, $course_id);
//check if rating is enabled for blogs
$ratings_enabled = setting_get(SETTING_BLOG_RATING_ENABLE, $course_id);
$sharing_allowed = is_sharing_allowed($course_id);
$sharing_enabled = setting_get(SETTING_BLOG_SHARING_ENABLE, $course_id);
if ($comments_enabled == 1) {
    commenting_add_js();
    //add js files needed for comments
}
//define allowed actions
$allowed_actions = array("showBlog", "showPost", "createPost", "editPost", "delPost", "savePost", "settings");
//initialize $_REQUEST vars
$action = isset($_REQUEST['action']) && in_array($_REQUEST['action'], $allowed_actions) ? $_REQUEST['action'] : "showBlog";
$pId = isset($_REQUEST['pId']) ? intval($_REQUEST['pId']) : 0;
$page = isset($_REQUEST['page']) ? intval($_REQUEST['page']) : 0;
//config setting allowing students to create posts and edit/delete own posts
$stud_allow_create = setting_get(SETTING_BLOG_STUDENT_POST, $course_id);
$posts_per_page = 10;
$num_popular = 5;
//number of popular blog posts to show in sidebar
$num_chars_teaser_break = 500;
//chars before teaser break