예제 #1
0
파일: index.php 프로젝트: nikosv/openeclass
 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);
     }
 }
 if ($comments_enabled && ($post->getCommenting() == 1)) {
     $comm = new Commenting('blogpost', $post->getId());
     $comment_content = "<a class='btn btn-primary btn-xs pull-right' href='$_SERVER[SCRIPT_NAME]?$url_params&amp;action=showPost&amp;pId=".$post->getId()."#comments_title'>$langComments (".$comm->getCommentsNum().")</a>";
 } else {
     $comment_content = "<div class=\"blog_post_empty_space\"></div>";
 }            
 $tool_content .= "<div class='panel panel-action-btn-default'>
                     <div class='panel-heading'>
                         <div class='pull-right'>
                             ". action_button(array(
                                 array(
                                     'title' => $langEditChange,
                                     'url' => "$_SERVER[SCRIPT_NAME]?$url_params&amp;action=editPost&amp;pId=".$post->getId(),
                                     'icon' => 'fa-edit',
                                     'show' => $allow_to_edit
                                 ),
                                 array(
                                     'title' => $langDelete,
예제 #2
0
 /***blog posts area***/
 $tool_content .= "<div class='row'>";
 $tool_content .= "<div class='col-sm-9'>";
 foreach ($posts as $post) {
     $sharing_content = '';
     $rating_content = '';
     if ($sharing_allowed) {
         $sharing_content = $sharing_enabled ? print_sharing_links($urlServer . "modules/blog/index.php?course={$course_code}&amp;action=showPost&amp;pId=" . $post->getId(), $post->getTitle()) : '';
     }
     if ($ratings_enabled) {
         $rating = new Rating('up_down', 'blogpost', $post->getId());
         $rating_content = $rating->put($is_editor, $uid, $course_id);
     }
     if ($comments_enabled) {
         $comm = new Commenting('blogpost', $post->getId());
         $comment_content = "<a class='btn btn-primary btn-xs pull-right' href='{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;action=showPost&amp;pId=" . $post->getId() . "#comments_title'>{$langComments} (" . $comm->getCommentsNum() . ")</a>";
     } else {
         $comment_content = "<div class=\"blog_post_empty_space\"></div>";
     }
     $tool_content .= "<div class='panel panel-action-btn-default'>\r\n                                <div class='panel-heading'>\r\n                                    <div class='pull-right'>\r\n                                        " . action_button(array(array('title' => $langModify, 'url' => "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;action=editPost&amp;pId=" . $post->getId(), 'icon' => 'fa-edit', 'show' => $post->permEdit($is_editor, $stud_allow_create, $uid)), array('title' => $langDelete, 'url' => "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;action=delPost&amp;pId=" . $post->getId(), 'icon' => 'fa-times', 'class' => 'delete', 'confirm' => $langSureToDelBlogPost, 'show' => $post->permEdit($is_editor, $stud_allow_create, $uid)))) . "\r\n                                    </div>\r\n                                    <h3 class='panel-title'>\r\n                                        <a href='{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;action=showPost&amp;pId=" . $post->getId() . "'>" . q($post->getTitle()) . "</a>\r\n                                    </h3>                                    \r\n                                </div>\r\n                                <div class='panel-body'>\r\n                                    <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(ellipsize_html($post->getContent(), $num_chars_teaser_break, "<strong>&nbsp;...<a href='{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;action=showPost&amp;pId=" . $post->getId() . "'> <span class='smaller'>[{$langMore}]</span></a></strong>")) . "\r\n                                    {$comment_content}\r\n                                </div>\r\n                                <div class='panel-footer'>\r\n                                    <div class='row'>\r\n                                        <div class='col-sm-6'>{$rating_content}</div>\r\n                                        <div class='col-sm-6 text-right'>{$sharing_content}</div>\r\n                                    </div>                                    \r\n                                </div>\r\n                             </div>";
 }
 //display navigation links
 $tool_content .= $blog->navLinksHTML($page, $posts_per_page);
 $tool_content .= "</div>";
 /***end of blog posts area***/
 /***sidebar area***/
 $tool_content .= "<div class='col-sm-3'>";
 $tool_content .= $blog->popularBlogPostsHTML($num_popular);
 $tool_content .= $blog->chronologicalTreeHTML(date('n', strtotime($posts[0]->getTime())), date('Y', strtotime($posts[0]->getTime())));
 $tool_content .= "</div></div>";
 /***end of sidebar area***/