diff --git a/root/language/en/mods/portal/portal_news_module.php b/root/language/en/mods/portal/portal_news_module.php index 17cbdf4e..c8084731 100644 --- a/root/language/en/mods/portal/portal_news_module.php +++ b/root/language/en/mods/portal/portal_news_module.php @@ -46,25 +46,25 @@ $lang = array_merge($lang, array( // ACP 'ACP_PORTAL_NEWS_SETTINGS' => 'News settings', - 'ACP_PORTAL_NEWS_SETTINGS_EXPLAIN' => 'This is where you customize the news block.', + 'ACP_PORTAL_NEWS_SETTINGS_EXP' => 'This is where you customize the news block.', 'PORTAL_NEWS_STYLE' => 'Compact news block style', - 'PORTAL_NEWS_STYLE_EXPLAIN' => '"Yes" means use the compact style for news. "No" means use the large style (text view).', + 'PORTAL_NEWS_STYLE_EXP' => '"Yes" means use the compact style for news. "No" means use the large style (text view).', 'PORTAL_SHOW_ALL_NEWS' => 'Show all of the articles in this forum', - 'PORTAL_SHOW_ALL_NEWS_EXPLAIN' => 'Includes stickies.', + 'PORTAL_SHOW_ALL_NEWS_EXP' => 'Includes stickies.', 'PORTAL_NUMBER_OF_NEWS' => 'Number of news articles on the portal', - 'PORTAL_NUMBER_OF_NEWS_EXPLAIN' => '0 means infinite', + 'PORTAL_NUMBER_OF_NEWS_EXP' => '0 means infinite', 'PORTAL_NEWS_LENGTH' => 'Max length of news article', - 'PORTAL_NEWS_LENGTH_EXPLAIN' => '0 means infinite', + 'PORTAL_NEWS_LENGTH_EXP' => '0 means infinite', 'PORTAL_NEWS_FORUM' => 'News Forums', - 'PORTAL_NEWS_FORUM_EXPLAIN' => 'Forum(s) we pull the articles from, leave blank to pull from all forums. If "Exclude forums" is set to "Yes", select the forums you want to exclude.
If "Exclude forums" is set to "No" select the forums you want to see.
Select/Deselect multiple forums by holding CTRL and clicking.', + 'PORTAL_NEWS_FORUM_EXP' => 'Forum(s) we pull the articles from, leave blank to pull from all forums. If "Exclude forums" is set to "Yes", select the forums you want to exclude.
If "Exclude forums" is set to "No" select the forums you want to see.
Select/Deselect multiple forums by holding CTRL and clicking.', 'PORTAL_NEWS_EXCLUDE' => 'Exclude forums', - 'PORTAL_NEWS_EXCLUDE_EXPLAIN' => 'Select "Yes" if you want to exlude the selected forums from the news block, and "No" if you want to see only the selected forums in the news block.', + 'PORTAL_NEWS_EXCLUDE_EXP' => 'Select "Yes" if you want to exlude the selected forums from the news block, and "No" if you want to see only the selected forums in the news block.', 'PORTAL_NEWS_PERMISSIONS' => 'Enable/disable permissions', - 'PORTAL_NEWS_PERMISSIONS_EXPLAIN' => 'Take forum viewing permissions into account when displaying news', + 'PORTAL_NEWS_PERMISSIONS_EXP' => 'Take forum viewing permissions into account when displaying news', 'PORTAL_NEWS_SHOW_LAST' => 'Sort in order to the newest posts', - 'PORTAL_NEWS_SHOW_LAST_EXPLAIN' => 'When activated, the newest will be sorted in order to the newest posts. When deactivated, the news will be sorted in order to the newest topic.', + 'PORTAL_NEWS_SHOW_LAST_EXP' => 'When activated, the newest will be sorted in order to the newest posts. When deactivated, the news will be sorted in order to the newest topic.', 'PORTAL_NEWS_ARCHIVE' => 'Enable the news archive system', - 'PORTAL_NEWS_ARCHIVE_EXPLAIN' => 'If enabled the news archive system / page numbers will be displayed.', + 'PORTAL_NEWS_ARCHIVE_EXP' => 'If enabled the news archive system / page numbers will be displayed.', )); ?> \ No newline at end of file diff --git a/root/portal/includes/functions.php b/root/portal/includes/functions.php index 0c6c60d0..dd114e2c 100644 --- a/root/portal/includes/functions.php +++ b/root/portal/includes/functions.php @@ -239,7 +239,7 @@ function phpbb_fetch_posts($forum_from, $permissions, $number_of_posts, $text_le while ($row = $db->sql_fetchrow($result)) { $attachments = array(); - if(($auth->acl_get('u_download') && ($auth->acl_get('f_download', $row['forum_id']) || $row['forum_id'] == 0)) && $config['allow_attachments'] && $row['post_id']) + if(($auth->acl_get('u_download') && ($auth->acl_get('f_download', $row['forum_id']) || $row['forum_id'] == 0)) && $config['allow_attachments'] && $row['post_id'] && $row['post_attachment']) { // Pull attachment data $sql2 = 'SELECT * diff --git a/root/portal/modules/portal_leaders.php b/root/portal/modules/portal_leaders.php index fdf9dace..44fdcfd1 100644 --- a/root/portal/modules/portal_leaders.php +++ b/root/portal/modules/portal_leaders.php @@ -146,58 +146,6 @@ class portal_leaders_module } else { - - - $user_ary = $auth->acl_get_list(false, array('a_', 'm_'), false); - - $admin_id_ary = $mod_id_ary = $forum_id_ary = array(); - foreach ($user_ary as $forum_id => $forum_ary) - { - foreach ($forum_ary as $auth_option => $id_ary) - { - if (!$forum_id && $auth_option == 'a_') - { - $admin_id_ary = array_merge($admin_id_ary, $id_ary); - continue; - } - else - { - $mod_id_ary = array_merge($mod_id_ary, $id_ary); - } - - if ($forum_id) - { - foreach ($id_ary as $id) - { - $forum_id_ary[$id][] = $forum_id; - } - } - } - } - - $admin_id_ary = array_unique($admin_id_ary); - $mod_id_ary = array_unique($mod_id_ary); - - // Admin group id... - $sql = 'SELECT group_id - FROM ' . GROUPS_TABLE . " - WHERE group_name = 'ADMINISTRATORS'"; - $result = $db->sql_query($sql); - $admin_group_id = (int) $db->sql_fetchfield('group_id'); - $db->sql_freeresult($result); - - $sql = 'SELECT forum_id, forum_name - FROM ' . FORUMS_TABLE . ' - WHERE forum_type = ' . FORUM_POST; - $result = $db->sql_query($sql); - - $forums = array(); - while ($row = $db->sql_fetchrow($result)) - { - $forums[$row['forum_id']] = $row['forum_name']; - } - $db->sql_freeresult($result); - $sql = $db->sql_build_query('SELECT', array( 'SELECT' => 'u.user_id, u.group_id as default_group, u.username, u.user_colour, u.user_allow_pm, g.group_id, g.group_name, g.group_colour, g.group_type, ug.user_id as ug_user_id', 'FROM' => array( @@ -209,34 +157,21 @@ class portal_leaders_module 'FROM' => array(USER_GROUP_TABLE => 'ug'), 'ON' => 'ug.group_id = g.group_id AND ug.user_pending = 0 AND ug.user_id = ' . $user->data['user_id'] )), - 'WHERE' => $db->sql_in_set('u.user_id', array_unique(array_merge($admin_id_ary, $mod_id_ary))) . ' - AND u.group_id = g.group_id', + 'WHERE' => 'u.group_id = g.group_id AND ' . $db->sql_in_set('g.group_name', array('ADMINISTRATORS', 'GLOBAL_MODERATORS')), 'ORDER_BY' => 'g.group_name ASC, u.username_clean ASC' )); $result = $db->sql_query($sql); - + while ($row = $db->sql_fetchrow($result)) { - $which_row = (in_array($row['user_id'], $admin_id_ary)) ? 'admin' : 'mod'; - - // We sort out admins not having the admin group as default - // The drawback is that only those admins are displayed which are within - // the special group 'Administrators' and also having it assigned as their default group. - // - might change - if ($which_row == 'admin' && $row['default_group'] != $admin_group_id) + if ($row['group_name'] == 'ADMINISTRATORS') { - // Remove from admin_id_ary, because the user may be a mod instead - unset($admin_id_ary[array_search($row['user_id'], $admin_id_ary)]); - - if (!in_array($row['user_id'], $mod_id_ary)) - { - continue; - } - else - { - $which_row = 'mod'; - } + $which_row = 'admin'; + } + elseif ($row['group_name'] == 'GLOBAL_MODERATORS') + { + $which_row = 'mod'; } if ($row['group_type'] == GROUP_HIDDEN && !$auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel') && $row['ug_user_id'] != $user->data['user_id'])