$user_id) { Blog :: set_user_subscribed((int)$_GET['blog_id'], $user_id); } } } if (!empty($_POST['unregister'])) { if (is_array($_POST['user'])) { foreach ($_POST['user'] as $index => $user_id) { Blog :: set_user_unsubscribed((int)$_GET['blog_id'], $user_id); } } } if (!empty($_GET['register'])) { Blog :: set_user_subscribed((int)$_GET['blog_id'], (int)$_GET['user_id']); $flag = 1; } if (!empty($_GET['unregister'])) { Blog :: set_user_unsubscribed((int)$_GET['blog_id'], (int)$_GET['user_id']); } if (isset($_GET['action']) && $_GET['action'] == 'manage_tasks') { if (isset($_GET['do']) && $_GET['do'] == 'delete') Blog :: delete_task($blog_id, (int)$_GET['task_id']); if (isset($_GET['do']) && $_GET['do'] == 'delete_assignment') Blog :: delete_assigned_task($blog_id, Database::escape_string((int)$_GET['task_id']), Database::escape_string((int)$_GET['user_id'])); } if (isset($_GET['action']) && $_GET['action'] == 'view_post') { $task_id = (isset ($_GET['task_id']) && is_numeric($_GET['task_id'])) ? $_GET['task_id'] : 0; if (isset($_GET['do']) && $_GET['do'] == 'delete_comment') { if (api_is_allowed('BLOG_'.$blog_id, 'article_comments_delete', $task_id)) { Blog :: delete_comment($blog_id, (int)$_GET['post_id'],(int)$_GET['comment_id']); } else { $error = true; $message = get_lang('ActionNotAllowed'); } } if (isset($_GET['do']) && $_GET['do'] == 'delete_article') { if (api_is_allowed('BLOG_'.$blog_id, 'article_delete', $task_id)) { Blog :: delete_post($blog_id, (int)$_GET['article_id']); $current_page = ''; // Article is gone, go to blog home } else { $error = true; $message = get_lang('ActionNotAllowed'); } } if (isset($_GET['do']) && $_GET['do'] == 'rate') { if (isset($_GET['type']) && $_GET['type'] == 'post') { if (api_is_allowed('BLOG_'.$blog_id, 'article_rate')) { Blog :: add_rating('post', $blog_id, (int)$_GET['post_id'], (int)$_GET['rating']); } } if (isset($_GET['type']) && $_GET['type'] == 'comment') { if (api_is_allowed('BLOG_'.$blog_id, 'article_comments_add')) { Blog :: add_rating('comment', $blog_id, (int)$_GET['comment_id'], (int)$_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'); } /* ----------------------------------------------------------- Introduction section ----------------------------------------------------------- */ $fck_attribute['Width'] = '100%'; $fck_attribute['Height'] = '300'; $fck_attribute['ToolbarSet'] = 'Introduction'; Display::display_introduction_section(TOOL_BLOG); $fck_attribute = null; // Clearing this global variable immediatelly after it has been used. // //Display::display_header($nameTools,'Blogs'); ?>
|
'; Blog :: display_form_user_unsubscribe($blog_id); } else api_not_allowed(); break; case 'manage_rights' : Blog :: display_form_user_rights($blog_id); break; case 'manage_tasks' : if (api_is_allowed('BLOG_'.$blog_id, 'task_management')) { if (isset($_GET['do']) && $_GET['do'] == 'add') { Blog :: display_new_task_form($blog_id); } if (isset($_GET['do']) && $_GET['do'] == 'assign') { Blog :: display_assign_task_form($blog_id); } if (isset($_GET['do']) && $_GET['do'] == 'edit') { Blog :: display_edit_task_form($blog_id, Database::escape_string($_GET['task_id'])); } if (isset($_GET['do']) && $_GET['do'] == 'edit_assignment') { Blog :: display_edit_assigned_task_form($blog_id, Database::escape_string((int)$_GET['task_id']), Database::escape_string((int)$_GET['user_id'])); } Blog :: display_task_list($blog_id); echo ' '; Blog :: display_assigned_task_list($blog_id); echo ' '; } else api_not_allowed(); break; case 'execute_task' : if (isset ($_GET['post_id'])) Blog :: display_post($blog_id, Database::escape_string((int)$_GET['post_id'])); else Blog :: display_select_task_post($blog_id, Database::escape_string((int)$_GET['task_id'])); break; case 'view_search_result' : Blog :: display_search_results($blog_id, Database::escape_string($_GET['q'])); break; case '' : default : if (isset ($_GET['filter']) && !empty ($_GET['filter'])) { Blog :: display_day_results($blog_id, Database::escape_string($_GET['filter'])); } else { Blog :: display_blog_posts($blog_id); } } ?> |