File diff suppressed because it is too large
Load Diff
@@ -57,6 +57,7 @@ $lang = array_merge($lang, array(
|
||||
'DELETE_MODULE_CONFIRM' => 'Bist du sicher, dass du das Modul "%1$s" löschen möchtest?',
|
||||
'MODULE_RESET_SUCCESS' => 'Modul Einstellungen erfolgreich zurückgesetzt.',
|
||||
'MODULE_RESET_CONFIRM' => 'Bist du sicher, dass du die Einstellungen des Moduls "%1$s" zurücksetzen willst?',
|
||||
'MODULE_NOT_EXISTS' => 'Das gewählte Modul existiert nicht.',
|
||||
|
||||
'MODULE_OPTIONS' => 'Modul Optionen',
|
||||
'MODULE_NAME' => 'Modul Name',
|
||||
|
||||
@@ -56,6 +56,7 @@ $lang = array_merge($lang, array(
|
||||
'DELETE_MODULE_CONFIRM' => 'Are you sure you wish to delete the module "%1$s"?',
|
||||
'MODULE_RESET_SUCCESS' => 'Successfully reset the module settings.',
|
||||
'MODULE_RESET_CONFIRM' => 'Are you sure you wish to reset the settings of the module "%1$s"?',
|
||||
'MODULE_NOT_EXISTS' => 'The selected module does not exist.',
|
||||
|
||||
'MODULE_OPTIONS' => 'Module options',
|
||||
'MODULE_NAME' => 'Module name',
|
||||
|
||||
@@ -872,3 +872,35 @@ function check_file_src($value, $key, $module_id, $force_error = true)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the groups a user is in
|
||||
*
|
||||
* @return array Array containing the user's groups
|
||||
*/
|
||||
function get_user_groups()
|
||||
{
|
||||
global $cache, $db, $user;
|
||||
|
||||
$groups_ary = $cache->get('_user_groups_' . $user->data['user_id']);
|
||||
|
||||
if ($groups_ary === false)
|
||||
{
|
||||
// get user's groups
|
||||
$sql = 'SELECT group_id
|
||||
FROM ' . USER_GROUP_TABLE . '
|
||||
WHERE user_id = ' . (int) $user->data['user_id'] . '
|
||||
ORDER BY group_id ASC';
|
||||
$result = $db->sql_query($sql);
|
||||
while($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$groups_ary[] = $row['group_id'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// save data in cache for 60 seconds
|
||||
$cache->put('_user_groups_' . $user->data['user_id'], $groups_ary, 60);
|
||||
}
|
||||
|
||||
return $groups_ary;
|
||||
}
|
||||
|
||||
@@ -181,17 +181,7 @@ class portal_calendar_module
|
||||
}
|
||||
array_multisort($time_ary, SORT_NUMERIC, $events);
|
||||
|
||||
// get user's groups
|
||||
$sql = 'SELECT group_id
|
||||
FROM ' . USER_GROUP_TABLE . '
|
||||
WHERE user_id = ' . (int) $user->data['user_id'] . '
|
||||
ORDER BY group_id ASC';
|
||||
$result = $db->sql_query($sql);
|
||||
while($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$groups_ary[] = $row['group_id'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
$groups_ary = get_user_groups();
|
||||
|
||||
foreach($events as $key => $cur_event)
|
||||
{
|
||||
|
||||
@@ -69,18 +69,8 @@ class portal_links_module
|
||||
$links = $this->utf_unserialize($portal_config['board3_links_array_' . $module_id]);
|
||||
|
||||
// get user's groups
|
||||
$sql = 'SELECT group_id
|
||||
FROM ' . USER_GROUP_TABLE . '
|
||||
WHERE user_id = ' . (int) $user->data['user_id'] . '
|
||||
ORDER BY group_id ASC';
|
||||
$result = $db->sql_query($sql);
|
||||
while($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$groups_ary[] = $row['group_id'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
$groups_ary = get_user_groups();
|
||||
|
||||
for ($i = 0; $i < sizeof($links); $i++)
|
||||
{
|
||||
if($links[$i]['type'] == self::LINK_INT)
|
||||
|
||||
@@ -68,20 +68,10 @@ class portal_main_menu_module
|
||||
$portal_config = obtain_portal_config();
|
||||
|
||||
$links = $this->utf_unserialize($portal_config['board3_menu_array_' . $module_id]);
|
||||
|
||||
|
||||
// get user's groups
|
||||
$sql = 'SELECT group_id
|
||||
FROM ' . USER_GROUP_TABLE . '
|
||||
WHERE user_id = ' . (int) $user->data['user_id'] . '
|
||||
ORDER BY group_id ASC';
|
||||
$result = $db->sql_query($sql);
|
||||
while($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$groups_ary[] = $row['group_id'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
$groups_ary = get_user_groups();
|
||||
|
||||
for ($i = 0; $i < sizeof($links); $i++)
|
||||
{
|
||||
if($links[$i]['type'] == self::LINK_CAT)
|
||||
|
||||
@@ -52,7 +52,7 @@ class portal_news_module
|
||||
global $config, $template, $db, $user, $auth, $cache, $phpEx, $phpbb_root_path;
|
||||
|
||||
$news = request_var('news', -1);
|
||||
$news = ($news > $config['board3_news_length_' . $module_id] -1) ? -1 : $news;
|
||||
$news = ($news > $config['board3_number_of_news_' . $module_id] -1) ? -1 : $news;
|
||||
$user->add_lang('viewforum');
|
||||
$start = request_var('np', 0);
|
||||
$start = ($start < 0) ? 0 : $start;
|
||||
|
||||
Reference in New Issue
Block a user