Source for file blog.php
Documentation is available at blog.php
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004-2008 Dokeos SPRL
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) various contributors
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact address: Dokeos, rue du Corbeau, 108, B-1030 Brussels, Belgium
==============================================================================
This file takes care of all blog navigation and displaying.
==============================================================================
==============================================================================
==============================================================================
// name of the language file that needs to be included
$blog_id = intval($_GET['blog_id']);
include ('../inc/global.inc.php');
/* ------------ ACCESS RIGHTS ------------ */
// notice for unauthorized people.
if(isset ($_GET['id_session']))
$_SESSION['id_session'] = $_GET['id_session'];
require_once (api_get_path(LIBRARY_PATH). "/display.lib.php");
require_once (api_get_path(LIBRARY_PATH). "/text.lib.php");
require_once (api_get_path(LIBRARY_PATH). "/blog.lib.php");
require_once (api_get_path(LIBRARY_PATH). "/fckeditor.lib.php");
$MonthsLong = array (get_lang("JanuaryLong"), get_lang("FebruaryLong"), get_lang("MarchLong"), get_lang("AprilLong"), get_lang("MayLong"), get_lang("JuneLong"), get_lang("JulyLong"), get_lang("AugustLong"), get_lang("SeptemberLong"), get_lang("OctoberLong"), get_lang("NovemberLong"), get_lang("DecemberLong"));
$current_page = $_GET['action'];
==============================================================================
==============================================================================
if ($_POST['new_post_submit'])
Blog :: create_post($_POST['post_title'], $_POST['post_full_text'], $_POST['post_file_comment'],$blog_id);
if ($_POST['edit_post_submit'])
Blog :: edit_post($_POST['post_id'], $_POST['post_title'], $_POST['post_full_text'], $blog_id);
if ($_POST['new_comment_submit'])
Blog :: create_comment($_POST['comment_title'], $_POST['comment_text'], $_POST['post_file_comment'],$blog_id, (int) $_GET['post_id'], $_POST['comment_parent_id']);
if ($_POST['new_task_submit'])
Blog :: create_task($blog_id, $_POST['task_name'], $_POST['task_description'], $_POST['chkArticleDelete'], $_POST['chkArticleEdit'], $_POST['chkCommentsDelete'], $_POST['task_color']);
if ($_POST['edit_task_submit'])
Blog :: edit_task($_POST['blog_id'], $_POST['task_id'], $_POST['task_name'], $_POST['task_description'], $_POST['chkArticleDelete'], $_POST['chkArticleEdit'],$_POST['chkCommentsDelete'], $_POST['task_color']);
if ($_POST['assign_task_submit'])
Blog :: assign_task($blog_id, $_POST['task_user_id'], $_POST['task_task_id'], $_POST['task_year']. "-". $_POST['task_month']. "-". $_POST['task_day']);
if ($_POST['assign_task_edit_submit'])
Blog :: edit_assigned_task($blog_id, $_POST['task_user_id'], $_POST['task_task_id'], $_POST['task_year']. "-". $_POST['task_month']. "-". $_POST['task_day'], $_POST['old_user_id'], $_POST['old_task_id'], $_POST['old_target_date']);
if ($_POST['new_task_execution_submit'])
Blog :: create_comment($_POST['comment_title'], $_POST['comment_text'], $blog_id, (int) $_GET['post_id'], $_POST['comment_parent_id'], $_POST['task_id']);
foreach ($_POST['user'] as $index => $user_id)
if ($_POST['unregister'])
foreach ($_POST['user'] as $index => $user_id)
if ($_GET['action'] == 'manage_tasks')
if ($_GET['do'] == 'delete')
if ($_GET['do'] == 'delete_assignment')
if ($_GET['action'] == 'view_post')
$task_id = (isset ($_GET['task_id']) && is_numeric($_GET['task_id'])) ? $_GET['task_id'] : 0;
if ($_GET['do'] == 'delete_comment')
if (api_is_allowed('BLOG_'. $blog_id, 'article_comments_delete', $task_id))
$message = get_lang('ActionNotAllowed');
if ($_GET['do'] == 'delete_article')
$current_page = ''; // Article is gone, go to blog home
$message = get_lang('ActionNotAllowed');
if ($_GET['do'] == 'rate')
if ($_GET['type'] == 'post')
Blog :: add_rating('post', $blog_id, (int) $_GET['post_id'], (int) $_GET['rating']);
if ($_GET['type'] == 'comment')
Blog :: add_rating('comment', $blog_id, (int) $_GET['comment_id'], (int) $_GET['rating']);
==============================================================================
==============================================================================
$htmlHeadXtra[] = "<script src=\"tbl_change.js\" type=\"text/javascript\" language=\"javascript\"></script>";
$interbreadcrumb[] = array ("url" => "blog.php?blog_id=$blog_id", "name" => Blog :: get_blog_title($blog_id));
$interbreadcrumb[] = array ("url" => "blog.php?blog_id=$blog_id", "name" => Blog :: get_blog_title($blog_id));
$interbreadcrumb[] = array ("url" => "blog.php?blog_id=$blog_id", "name" => Blog :: get_blog_title($blog_id));
$interbreadcrumb[] = array ("url" => "blog.php?blog_id=$blog_id", "name" => Blog :: get_blog_title($blog_id));
case "view_search_result" :
$interbreadcrumb[] = array ("url" => "blog.php?blog_id=$blog_id", "name" => Blog :: get_blog_title($blog_id));
$nameTools = get_lang('ExecuteThisTask');
$interbreadcrumb[] = array ("url" => "blog.php?blog_id=$blog_id", "name" => Blog :: get_blog_title($blog_id));
//Display::display_header($nameTools,'Blogs');
<td width="220" class="blog_left" valign="top">
$month = (int) $_GET['month'] ? (int) $_GET['month'] : (int) date('m');
$year = (int) $_GET['year'] ? (int) $_GET['year'] : date('Y');
<td class="blog_menu_title"> <?php echo get_lang('ThisBlog') ?></td>
<li><a href=" <?php echo api_get_self(); ?>?blog_id= <?php echo $blog_id ?>" title=" <?php echo get_lang('Home') ?>"> <?php echo get_lang('Home') ?></a></li>
<?php if(api_is_allowed('BLOG_'. $blog_id, 'article_add')) { ?><li><a href=" <?php echo api_get_self(); ?>?action=new_post&blog_id= <?php echo $blog_id ?>" title=" <?php echo get_lang('NewPost') ?>"> <?php echo get_lang('NewPost') ?></a></li> <?php } ?>
<?php if(api_is_allowed('BLOG_'. $blog_id, 'task_management')) { ?><li><a href=" <?php echo api_get_self(); ?>?action=manage_tasks&blog_id= <?php echo $blog_id ?>" title=" <?php echo get_lang('ManageTasks') ?>"> <?php echo get_lang('TaskManager') ?></a></li> <?php } ?>
<?php if(api_is_allowed('BLOG_'. $blog_id, 'member_management')) { ?><li><a href=" <?php echo api_get_self(); ?>?action=manage_members&blog_id= <?php echo $blog_id ?>" title=" <?php echo get_lang('ManageMembers') ?>"> <?php echo get_lang('MemberManager') ?></a></li> <?php } ?>
<td class="blog_menu_title"> <?php echo get_lang('Search') ?></td>
<form action="blog.php" method="get" enctype="multipart/form-data">
<input type="hidden" name="blog_id" value=" <?php echo $blog_id ?>" />
<input type="hidden" name="action" value="view_search_result" />
<input type="text" size="20" name="q" value=" <?php echo (isset ($_GET['q']) ? $_GET['q'] : ''); ?>" /><input type="submit" value="Go" />
<td class="blog_menu_title"> <?php echo get_lang('MyTasks') ?></td>
<td class="blog_menu_title"> <?php echo get_lang('FavoriteBlogs') ?></td>
<td class="blog_menu_title"> <?php echo get_lang('TopTen') ?></td>
<td valign="top" class="blog_right">
$current_page = "manage_tasks";
if (isset ($_GET['task_id']) && is_numeric($_GET['task_id']))
$task_id = (int) $_GET['task_id'];
SELECT COUNT(*) as `number`
FROM ". $tbl_blogs_tasks_rel_user. "
`blog_id` = ". $blog_id. " AND
if (api_is_allowed('BLOG_'. $blog_id, 'article_add', $user_task ? $task_id : 0))
$task_id = (isset ($_GET['task_id']) && is_numeric($_GET['task_id'])) ? $_GET['task_id'] : 0;
if ($_GET['do'] == 'add')
if ($_GET['do'] == 'assign')
if ($_GET['do'] == 'edit')
if ($_GET['do'] == 'edit_assignment')
<a href=" <?php echo api_get_self(); ?>?action=manage_rights&blog_id= <?php echo $blog_id ?>" title=" <?php echo get_lang('ManageRights') ?>"> <?php echo get_lang('RightsManager') ?></a>
if (isset ($_GET['post_id']))
case 'view_search_result' :
if (isset ($_GET['filter']) && !empty ($_GET['filter']))
|