Enabling/disabling permissions for news & announcements

(Required translations)
This commit is contained in:
Ice
2008-03-05 12:00:02 +00:00
parent 0a8140d449
commit 7ae7f81c86
8 changed files with 40 additions and 19 deletions

View File

@@ -21,7 +21,7 @@ if (!defined('IN_PORTAL'))
$announcement = request_var('announcement', -1);
if($announcement < 0)
{
$fetch_news = phpbb_fetch_posts($portal_config['portal_global_announcements_forum'], $portal_config['portal_number_of_announcements'], $portal_config['portal_announcements_length'], $portal_config['portal_announcements_day'], 'announcements');
$fetch_news = phpbb_fetch_posts($portal_config['portal_global_announcements_forum'], $portal_config['portal_announcements_permissions'], $portal_config['portal_number_of_announcements'], $portal_config['portal_announcements_length'], $portal_config['portal_announcements_day'], 'announcements');
if (count($fetch_news) == 0)
{
@@ -85,7 +85,7 @@ if($announcement < 0)
}
else
{
$fetch_news = phpbb_fetch_posts($portal_config['portal_global_announcements_forum'], $portal_config['portal_number_of_announcements'], 0, $portal_config['portal_announcements_day'], 'announcements');
$fetch_news = phpbb_fetch_posts($portal_config['portal_global_announcements_forum'], $portal_config['portal_announcements_permissions'], $portal_config['portal_number_of_announcements'], 0, $portal_config['portal_announcements_day'], 'announcements');
$i = $announcement;
$forum_id = $fetch_news[$i]['forum_id'];

View File

@@ -33,7 +33,7 @@ $template->assign_vars(array(
$news = request_var('news', -1);
if($news < 0)
{
$fetch_news = phpbb_fetch_posts($portal_config['portal_news_forum'], $portal_config['portal_number_of_news'], $portal_config['portal_news_length'], 0, ($portal_config['portal_show_all_news']) ? 'news_all' : 'news');
$fetch_news = phpbb_fetch_posts($portal_config['portal_news_forum'], $portal_config['portal_news_permissions'], $portal_config['portal_number_of_news'], $portal_config['portal_news_length'], 0, ($portal_config['portal_show_all_news']) ? 'news_all' : 'news');
if (count($fetch_news) == 0)
{
@@ -91,7 +91,7 @@ if($news < 0)
}
else
{
$fetch_news = phpbb_fetch_posts($portal_config['portal_news_forum'], $portal_config['portal_number_of_news'], 0, 0, ($portal_config['portal_show_all_news']) ? 'news_all' : 'news');
$fetch_news = phpbb_fetch_posts($portal_config['portal_news_forum'], $portal_config['portal_news_permissions'], $portal_config['portal_number_of_news'], 0, 0, ($portal_config['portal_show_all_news']) ? 'news_all' : 'news');
$i = $news;
$forum_id = $fetch_news[$i]['forum_id'];

View File

@@ -71,7 +71,7 @@ function set_portal_config($config_name, $config_value)
include($phpbb_root_path . 'includes/message_parser.'.$phpEx);
// fetch post for news & announce
function phpbb_fetch_posts($forum_from, $number_of_posts, $text_length, $time, $type)
function phpbb_fetch_posts($forum_from, $permissions, $number_of_posts, $text_length, $time, $type)
{
global $db, $phpbb_root_path, $auth, $user, $bbcode_bitfield, $bbcode;
@@ -83,7 +83,12 @@ function phpbb_fetch_posts($forum_from, $number_of_posts, $text_length, $time, $
$str_where = '';
$allow_access = array_unique(array_keys($auth->acl_getf('f_read', true)));
if( $permissions )
{
$allow_access = array_unique(array_keys($auth->acl_getf('f_read', true)));
} else {
$allow_access = array_unique(array_keys($auth->acl_getf('f_', true)));
}
if( sizeof($allow_access) ){