$user_id)
{
Blog :: set_user_subscribed(mysql_real_escape_string($_GET['blog_id']), mysql_real_escape_string($user_id));
}
}
if ($_POST['unregister'])
{
foreach ($_POST['user'] as $index => $user_id)
{
Blog :: set_user_unsubscribed(mysql_real_escape_string($_GET['blog_id']), mysql_real_escape_string($user_id));
}
}
if ($_GET['register'])
{
Blog :: set_user_subscribed(mysql_real_escape_string($_GET['blog_id']), mysql_real_escape_string($_GET['user_id']));
$flag = 1;
}
if ($_GET['unregister'])
{
Blog :: set_user_unsubscribed(mysql_real_escape_string($_GET['blog_id']), mysql_real_escape_string($_GET['user_id']));
}
if ($_GET['action'] == 'manage_tasks')
{
if ($_GET['do'] == 'delete')
Blog :: delete_task($blog_id, mysql_real_escape_string($_GET['task_id']));
if ($_GET['do'] == 'delete_assignment')
Blog :: delete_assigned_task($blog_id, mysql_real_escape_string($_GET['assignment_id']));
}
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_to_edit('BLOG_'.$blog_id, 'article_comments_delete', $task_id))
{
Blog :: delete_comment($blog_id, mysql_real_escape_string($_GET['comment_id']));
}
else
{
$error = true;
$message = get_lang('ActionNotAllowed');
}
}
if ($_GET['do'] == 'delete_article')
{
if (api_is_allowed_to_edit('BLOG_'.$blog_id, 'article_delete', $task_id))
{
Blog :: delete_post($blog_id, mysql_real_escape_string($_GET['article_id']));
$current_page = ''; // Article is gone, go to blog home
}
else
{
$error = true;
$message = get_lang('ActionNotAllowed');
}
}
if ($_GET['do'] == 'rate')
{
if ($_GET['type'] == 'post')
{
if (api_is_allowed_to_edit('BLOG_'.$blog_id, 'article_rate'))
{
Blog :: add_rating('post', $blog_id, mysql_real_escape_string($_GET['post_id']), mysql_real_escape_string($_GET['rating']));
}
}
if ($_GET['type'] == 'comment')
{
if (api_is_allowed_to_edit('BLOG_'.$blog_id, 'article_comments_add'))
{
Blog :: add_rating('comment', $blog_id, mysql_real_escape_string($_GET['comment_id']), mysql_real_escape_string($_GET['rating']));
}
}
}
}
/*
==============================================================================
DISPLAY
==============================================================================
*/
$htmlHeadXtra[] = "";
// Set bredcrumb
switch ($current_page)
{
case "new_post" :
$nameTools = get_lang('NewPost');
$interbreadcrumb[] = array ("url" => "blog.php?blog_id=$blog_id", "name" => Blog :: get_blog_title($blog_id));
Display :: display_header($nameTools, 'blogs');
break;
case "manage_tasks" :
$nameTools = get_lang('TaskManager');
$interbreadcrumb[] = array ("url" => "blog.php?blog_id=$blog_id", "name" => Blog :: get_blog_title($blog_id));
Display :: display_header($nameTools, 'blogs');
break;
case "manage_members" :
$nameTools = get_lang('MemberManager');
$interbreadcrumb[] = array ("url" => "blog.php?blog_id=$blog_id", "name" => Blog :: get_blog_title($blog_id));
Display :: display_header($nameTools, 'blogs');
break;
case "manage_rights" :
$nameTools = get_lang('RightsManager');
$interbreadcrumb[] = array ("url" => "blog.php?blog_id=$blog_id", "name" => Blog :: get_blog_title($blog_id));
Display :: display_header($nameTools, 'blogs');
break;
case "view_search_result" :
$nameTools = get_lang('SearchResults');
$interbreadcrumb[] = array ("url" => "blog.php?blog_id=$blog_id", "name" => Blog :: get_blog_title($blog_id));
Display :: display_header($nameTools, 'blogs');
break;
case "execute_task" :
$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');
break;
default :
$nameTools = Blog :: get_blog_title($blog_id);
Display :: display_header($nameTools, 'blogs');
}
//Display::display_header($nameTools,'Blogs');
?>