Merge pull request #559 from marc1706/ticket/558
[ticket/558] Fix coding guidelines infractions
This commit is contained in:
@@ -66,7 +66,7 @@ class portal_module
|
||||
define('PORTAL_CONFIG_TABLE', $this->phpbb_container->getParameter('board3.portal.config.table'));
|
||||
}
|
||||
|
||||
if(!function_exists('obtain_portal_config'))
|
||||
if (!function_exists('obtain_portal_config'))
|
||||
{
|
||||
include($this->root_path . 'includes/functions.' . $this->php_ext);
|
||||
}
|
||||
@@ -145,7 +145,7 @@ class portal_module
|
||||
'MODULE_SHOW_IMAGE' => (in_array($this->portal_columns->number_to_string($module_data['module_column']), array('center', 'top', 'bottom'))) ? false : true,
|
||||
));
|
||||
|
||||
if($module_data['module_classname'] != '\board3\portal\modules\custom')
|
||||
if ($module_data['module_classname'] != '\board3\portal\modules\custom')
|
||||
{
|
||||
$groups_ary = explode(',', $module_data['module_group_ids']);
|
||||
|
||||
@@ -154,7 +154,7 @@ class portal_module
|
||||
FROM ' . GROUPS_TABLE . '
|
||||
ORDER BY group_id ASC';
|
||||
$result = $this->db->sql_query($sql);
|
||||
while($row = $this->db->sql_fetchrow($result))
|
||||
while ($row = $this->db->sql_fetchrow($result))
|
||||
{
|
||||
$this->template->assign_block_vars('permission_setting', array(
|
||||
'SELECTED' => (in_array($row['group_id'], $groups_ary)) ? true : false,
|
||||
@@ -194,7 +194,7 @@ class portal_module
|
||||
// Reset module
|
||||
$reset_module = $this->request->variable('module_reset', 0);
|
||||
|
||||
if($reset_module && !empty($module_data))
|
||||
if ($reset_module && !empty($module_data))
|
||||
{
|
||||
$this->modules_manager->reset_module($id, $mode, $module_id, $module_data);
|
||||
}
|
||||
@@ -243,7 +243,7 @@ class portal_module
|
||||
continue;
|
||||
}
|
||||
|
||||
if(isset($null['type']) && $null['type'] == 'custom')
|
||||
if (isset($null['type']) && $null['type'] == 'custom')
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -266,7 +266,7 @@ class portal_module
|
||||
FROM ' . GROUPS_TABLE . '
|
||||
ORDER BY group_id ASC';
|
||||
$result = $this->db->sql_query($sql);
|
||||
while($row = $this->db->sql_fetchrow($result))
|
||||
while ($row = $this->db->sql_fetchrow($result))
|
||||
{
|
||||
$groups_ary[] = $row['group_id'];
|
||||
}
|
||||
@@ -283,7 +283,7 @@ class portal_module
|
||||
'module_status' => $this->request->variable('module_status', self::B3_MODULE_ENABLED),
|
||||
);
|
||||
|
||||
if(!(isset($this->c_class->hide_name) && $this->c_class->hide_name == true))
|
||||
if (!(isset($this->c_class->hide_name) && $this->c_class->hide_name == true))
|
||||
{
|
||||
$sql_ary['module_name'] = $this->request->variable('module_name', '', true);
|
||||
}
|
||||
@@ -299,7 +299,7 @@ class portal_module
|
||||
$this->cache->destroy('sql', PORTAL_MODULES_TABLE);
|
||||
$this->cache->destroy('sql', CONFIG_TABLE);
|
||||
|
||||
if(isset($module_name))
|
||||
if (isset($module_name))
|
||||
{
|
||||
if (isset($module_data) && $module_data['module_classname'] !== '\board3\portal\modules\custom')
|
||||
{
|
||||
@@ -314,7 +314,7 @@ class portal_module
|
||||
}
|
||||
|
||||
// show custom HTML files on the settings page of the modules instead of the standard board3 portal one, if chosen by module
|
||||
if(!isset($this->c_class->custom_acp_tpl) || empty($this->c_class->custom_acp_tpl))
|
||||
if (!isset($this->c_class->custom_acp_tpl) || empty($this->c_class->custom_acp_tpl))
|
||||
{
|
||||
$this->tpl_name = 'portal/acp_portal_config';
|
||||
}
|
||||
@@ -361,7 +361,7 @@ class portal_module
|
||||
$l_explain = (isset($this->user->lang[$vars['lang'] . '_EXP'])) ? $this->user->lang[$vars['lang'] . '_EXP'] : '';
|
||||
}
|
||||
|
||||
if($vars['type'] != 'custom')
|
||||
if ($vars['type'] != 'custom')
|
||||
{
|
||||
$content = build_cfg_template($type, $config_key, $this->new_config, $config_key, $vars);
|
||||
}
|
||||
@@ -410,7 +410,7 @@ class portal_module
|
||||
$portal_modules = obtain_portal_modules();
|
||||
$installed_modules = $module_column = array();
|
||||
|
||||
foreach($portal_modules as $cur_module)
|
||||
foreach ($portal_modules as $cur_module)
|
||||
{
|
||||
$installed_modules[] = $cur_module['module_classname'];
|
||||
// Create an array with the columns the module is in
|
||||
@@ -427,11 +427,11 @@ class portal_module
|
||||
{
|
||||
$this->modules_manager->move_module_vertical($module_id, \board3\portal\portal\modules\database_handler::MOVE_DIRECTION_DOWN);
|
||||
}
|
||||
else if($action == 'move_right')
|
||||
else if ($action == 'move_right')
|
||||
{
|
||||
$this->modules_manager->move_module_horizontal($module_id, \board3\portal\portal\modules\database_handler::MOVE_DIRECTION_RIGHT);
|
||||
}
|
||||
else if($action == 'move_left')
|
||||
else if ($action == 'move_left')
|
||||
{
|
||||
$this->modules_manager->move_module_horizontal($module_id, \board3\portal\portal\modules\database_handler::MOVE_DIRECTION_LEFT);
|
||||
}
|
||||
@@ -502,7 +502,7 @@ class portal_module
|
||||
if (is_array($error))
|
||||
{
|
||||
$error_output = '';
|
||||
foreach($error as $cur_error)
|
||||
foreach ($error as $cur_error)
|
||||
{
|
||||
$error_output .= $cur_error . '<br />';
|
||||
}
|
||||
@@ -556,7 +556,7 @@ class portal_module
|
||||
}
|
||||
|
||||
// we sort the $fileinfo array by the name of the modules
|
||||
foreach($fileinfo as $key => $cur_file)
|
||||
foreach ($fileinfo as $key => $cur_file)
|
||||
{
|
||||
$name_ary[$key] = $cur_file['name'];
|
||||
}
|
||||
@@ -600,7 +600,7 @@ class portal_module
|
||||
{
|
||||
$portal_modules = obtain_portal_modules();
|
||||
|
||||
foreach($portal_modules as $row)
|
||||
foreach ($portal_modules as $row)
|
||||
{
|
||||
if (!($this->c_class = $this->portal_helper->get_module($row['module_classname'])))
|
||||
{
|
||||
@@ -613,7 +613,7 @@ class portal_module
|
||||
$template_column = $this->portal_columns->number_to_string($row['module_column']);
|
||||
|
||||
// find out of we can move modules to the left or right
|
||||
if(($this->c_class->get_allowed_columns() & $this->portal_columns->string_to_constant($this->portal_columns->number_to_string($row['module_column'] + 1))) || ($this->c_class->get_allowed_columns() & $this->portal_columns->string_to_constant($this->portal_columns->number_to_string($row['module_column'] + 2)) && $row['module_column'] != 2))
|
||||
if (($this->c_class->get_allowed_columns() & $this->portal_columns->string_to_constant($this->portal_columns->number_to_string($row['module_column'] + 1))) || ($this->c_class->get_allowed_columns() & $this->portal_columns->string_to_constant($this->portal_columns->number_to_string($row['module_column'] + 2)) && $row['module_column'] != 2))
|
||||
{
|
||||
/**
|
||||
* check if we can actually move
|
||||
@@ -643,7 +643,7 @@ class portal_module
|
||||
$move_right = false;
|
||||
}
|
||||
|
||||
if(($this->c_class->get_allowed_columns() & $this->portal_columns->string_to_constant($this->portal_columns->number_to_string($row['module_column'] - 1))) || ($this->c_class->get_allowed_columns() & $this->portal_columns->string_to_constant($this->portal_columns->number_to_string($row['module_column'] - 2)) && $row['module_column'] != 2))
|
||||
if (($this->c_class->get_allowed_columns() & $this->portal_columns->string_to_constant($this->portal_columns->number_to_string($row['module_column'] - 1))) || ($this->c_class->get_allowed_columns() & $this->portal_columns->string_to_constant($this->portal_columns->number_to_string($row['module_column'] - 2)) && $row['module_column'] != 2))
|
||||
{
|
||||
/**
|
||||
* check if we can actually move
|
||||
|
||||
@@ -340,7 +340,7 @@ function get_portal_tracking_info($fetch_news)
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// @todo: do not use $current_forum here as this is already used by the outside foreach
|
||||
foreach($forum_ids as $current_forum)
|
||||
foreach ($forum_ids as $current_forum)
|
||||
{
|
||||
$user_lastmark[$current_forum] = (isset($mark_time[$current_forum])) ? $mark_time[$current_forum] : $user->data['user_lastmark'];
|
||||
}
|
||||
@@ -471,7 +471,7 @@ function get_user_groups()
|
||||
WHERE user_id = ' . (int) $user->data['user_id'] . '
|
||||
ORDER BY group_id ASC';
|
||||
$result = $db->sql_query($sql);
|
||||
while($row = $db->sql_fetchrow($result))
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$groups_ary[] = $row['group_id'];
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ class modules_helper
|
||||
$forum_list = make_forum_select(false, false, true, true, true, false, true);
|
||||
|
||||
$selected_options = $select_ary = array();
|
||||
if(isset($this->config[$key]) && strlen($this->config[$key]) > 0)
|
||||
if (isset($this->config[$key]) && strlen($this->config[$key]) > 0)
|
||||
{
|
||||
$selected_options = explode(',', $this->config[$key]);
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ class v210_beta1 extends \phpbb\db\migration\migration
|
||||
$sql = 'SELECT group_id, group_name FROM ' . $this->table_prefix . 'groups
|
||||
WHERE ' . $this->db->sql_in_set('group_name', $in_ary);
|
||||
$result = $this->db->sql_query($sql);
|
||||
while($row = $this->db->sql_fetchrow($result))
|
||||
while ($row = $this->db->sql_fetchrow($result))
|
||||
{
|
||||
$groups_ary[$row['group_name']] = $row['group_id'];
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ class announcements extends module_base
|
||||
);
|
||||
|
||||
$topic_icons = false;
|
||||
if(!empty($fetch_news['topic_icons']))
|
||||
if (!empty($fetch_news['topic_icons']))
|
||||
{
|
||||
$topic_icons = true;
|
||||
}
|
||||
@@ -182,7 +182,7 @@ class announcements extends module_base
|
||||
// Get disallowed forums
|
||||
$disallow_access = $this->modules_helper->get_disallowed_forums($permissions);
|
||||
|
||||
if($this->config['board3_announcements_forum_exclude_' . $module_id] == true)
|
||||
if ($this->config['board3_announcements_forum_exclude_' . $module_id] == true)
|
||||
{
|
||||
$disallow_access = array_merge($disallow_access, $forum_from);
|
||||
$forum_from = array();
|
||||
@@ -190,18 +190,18 @@ class announcements extends module_base
|
||||
|
||||
$global_f = 0;
|
||||
|
||||
if(sizeof($forum_from))
|
||||
if (sizeof($forum_from))
|
||||
{
|
||||
$disallow_access = array_diff($forum_from, $disallow_access);
|
||||
if(!sizeof($disallow_access))
|
||||
if (!sizeof($disallow_access))
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
foreach($disallow_access as $acc_id)
|
||||
foreach ($disallow_access as $acc_id)
|
||||
{
|
||||
$str_where .= 'forum_id = ' . (int) $acc_id . ' OR ';
|
||||
if($global_f < 1 && $acc_id > 0)
|
||||
if ($global_f < 1 && $acc_id > 0)
|
||||
{
|
||||
$global_f = $acc_id;
|
||||
}
|
||||
@@ -209,7 +209,7 @@ class announcements extends module_base
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach($disallow_access as $acc_id)
|
||||
foreach ($disallow_access as $acc_id)
|
||||
{
|
||||
$str_where .= 'forum_id <> ' . (int) $acc_id . ' AND ';
|
||||
}
|
||||
@@ -247,12 +247,12 @@ class announcements extends module_base
|
||||
$this->template->assign_block_vars('announcements', $announcements_row);
|
||||
|
||||
// Show the announcements overview
|
||||
if($announcement < 0)
|
||||
if ($announcement < 0)
|
||||
{
|
||||
$count = $fetch_news['topic_count'];
|
||||
for ($i = 0; $i < $count; $i++)
|
||||
{
|
||||
if(isset($fetch_news[$i]['striped']) && $fetch_news[$i]['striped'] == true)
|
||||
if (isset($fetch_news[$i]['striped']) && $fetch_news[$i]['striped'] == true)
|
||||
{
|
||||
$open_bracket = '[ ';
|
||||
$close_bracket = ' ]';
|
||||
@@ -352,7 +352,7 @@ class announcements extends module_base
|
||||
|
||||
$this->pagination->generate_template_pagination($view_topic_url, 'announcements.center_row.pagination', 'start', $fetch_news[$i]['topic_replies'] + 1, $this->config['posts_per_page'], 1, true, true);
|
||||
|
||||
if(!empty($fetch_news[$i]['attachments']))
|
||||
if (!empty($fetch_news[$i]['attachments']))
|
||||
{
|
||||
foreach ($fetch_news[$i]['attachments'] as $attachment)
|
||||
{
|
||||
@@ -415,7 +415,7 @@ class announcements extends module_base
|
||||
|
||||
$this->pagination->generate_template_pagination($view_topic_url, 'announcements.center_row.pagination', 'start', $fetch_news[$i]['topic_replies'] + 1, $this->config['posts_per_page'], 1, true, true);
|
||||
|
||||
if(!empty($fetch_news[$i]['attachments']))
|
||||
if (!empty($fetch_news[$i]['attachments']))
|
||||
{
|
||||
foreach ($fetch_news[$i]['attachments'] as $attachment)
|
||||
{
|
||||
|
||||
@@ -230,12 +230,12 @@ class attachments extends module_base
|
||||
// Get filetypes and put them into an array
|
||||
$filetypes = $this->get_selected_filetypes($module_id);
|
||||
|
||||
if($this->config['board3_attachments_forum_ids_' . $module_id] !== '')
|
||||
if ($this->config['board3_attachments_forum_ids_' . $module_id] !== '')
|
||||
{
|
||||
$attach_forums_config = (strpos($this->config['board3_attachments_forum_ids_' . $module_id], ',') !== false) ? explode(',', $this->config['board3_attachments_forum_ids_' . $module_id]) : array($this->config['board3_attachments_forum_ids_' . $module_id]);
|
||||
$forum_list = array_unique(array_keys($this->auth->acl_getf('f_read', true)));
|
||||
|
||||
if($this->config['board3_attachments_forum_exclude_' . $module_id])
|
||||
if ($this->config['board3_attachments_forum_exclude_' . $module_id])
|
||||
{
|
||||
$forum_list = array_unique(array_diff($forum_list, $attach_forums_config));
|
||||
}
|
||||
@@ -249,15 +249,15 @@ class attachments extends module_base
|
||||
$forum_list = array_unique(array_keys($this->auth->acl_getf('f_read', true)));
|
||||
}
|
||||
|
||||
if(sizeof($forum_list))
|
||||
if (sizeof($forum_list))
|
||||
{
|
||||
$attach_forums = true;
|
||||
$where = 'AND ' . $this->db->sql_in_set('t.forum_id', $forum_list);
|
||||
}
|
||||
|
||||
if(sizeof($filetypes))
|
||||
if (sizeof($filetypes))
|
||||
{
|
||||
if($this->config['board3_attachments_exclude_' . $module_id])
|
||||
if ($this->config['board3_attachments_exclude_' . $module_id])
|
||||
{
|
||||
$where .= ' AND ' . $this->db->sql_in_set('a.extension', $filetypes, true);
|
||||
}
|
||||
@@ -267,7 +267,7 @@ class attachments extends module_base
|
||||
}
|
||||
}
|
||||
|
||||
if($attach_forums === true)
|
||||
if ($attach_forums === true)
|
||||
{
|
||||
// Just grab all attachment info from database
|
||||
$sql = 'SELECT
|
||||
@@ -328,7 +328,7 @@ class attachments extends module_base
|
||||
protected function get_selected_filetypes($module_id)
|
||||
{
|
||||
$selected = array();
|
||||
if(isset($this->config['board3_attachments_filetype_' . $module_id]) && strlen($this->config['board3_attachments_filetype_' . $module_id]) > 0)
|
||||
if (isset($this->config['board3_attachments_filetype_' . $module_id]) && strlen($this->config['board3_attachments_filetype_' . $module_id]) > 0)
|
||||
{
|
||||
$selected = explode(',', $this->config['board3_attachments_filetype_' . $module_id]);
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ class latest_members extends module_base
|
||||
ORDER BY user_regdate DESC';
|
||||
$result = $this->db->sql_query_limit($sql, $this->config['board3_max_last_member_' . $module_id], 0, 600);
|
||||
|
||||
while(($row = $this->db->sql_fetchrow($result)) && ($row['username']))
|
||||
while (($row = $this->db->sql_fetchrow($result)) && ($row['username']))
|
||||
{
|
||||
$this->template->assign_block_vars('latest_members', array(
|
||||
'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
|
||||
|
||||
@@ -93,7 +93,7 @@ class leaders extends module_base
|
||||
$this->user->add_lang('groups');
|
||||
$order_legend = ($this->config['legend_sort_groupname']) ? 'group_name' : 'group_legend';
|
||||
|
||||
if($this->config['board3_leaders_ext_' . $module_id])
|
||||
if ($this->config['board3_leaders_ext_' . $module_id])
|
||||
{
|
||||
$legends = array();
|
||||
$groups = array();
|
||||
@@ -160,9 +160,9 @@ class leaders extends module_base
|
||||
|
||||
if (sizeof($groups))
|
||||
{
|
||||
foreach($groups as $group_id => $group)
|
||||
foreach ($groups as $group_id => $group)
|
||||
{
|
||||
if(sizeof($group['group_users']))
|
||||
if (sizeof($group['group_users']))
|
||||
{
|
||||
$group_name = ($group['group_type'] == GROUP_SPECIAL) ? $this->user->lang['G_' . $group['group_name']] : $group['group_name'];
|
||||
$u_group = append_sid("{$this->phpbb_root_path}memberlist.{$this->php_ext}", 'mode=group&g=' . $group_id);
|
||||
@@ -173,7 +173,7 @@ class leaders extends module_base
|
||||
'U_GROUP' => $u_group,
|
||||
));
|
||||
|
||||
foreach($group['group_users'] as $group_user)
|
||||
foreach ($group['group_users'] as $group_user)
|
||||
{
|
||||
$this->template->assign_block_vars('group.member', array(
|
||||
'USER_ID' => $group_user['user_id'],
|
||||
|
||||
@@ -366,7 +366,7 @@ class main_menu extends module_base
|
||||
{
|
||||
$message = $this->user->lang['LINK_ADDED'];
|
||||
|
||||
if($link_type != self::LINK_CAT && sizeof($links) < 1)
|
||||
if ($link_type != self::LINK_CAT && sizeof($links) < 1)
|
||||
{
|
||||
trigger_error($this->user->lang['ACP_PORTAL_MENU_CREATE_CAT'] . adm_back_link($u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ class news extends module_base
|
||||
);
|
||||
|
||||
$topic_icons = false;
|
||||
if(!empty($fetch_news['topic_icons']))
|
||||
if (!empty($fetch_news['topic_icons']))
|
||||
{
|
||||
$topic_icons = true;
|
||||
}
|
||||
@@ -179,21 +179,21 @@ class news extends module_base
|
||||
// Get disallowed forums
|
||||
$disallow_access = $this->modules_helper->get_disallowed_forums($permissions);
|
||||
|
||||
if($this->config['board3_news_exclude_' . $module_id] == true)
|
||||
if ($this->config['board3_news_exclude_' . $module_id] == true)
|
||||
{
|
||||
$disallow_access = array_merge($disallow_access, $forum_from);
|
||||
$forum_from = array();
|
||||
}
|
||||
|
||||
if(sizeof($forum_from))
|
||||
if (sizeof($forum_from))
|
||||
{
|
||||
$disallow_access = array_diff($forum_from, $disallow_access);
|
||||
if(!sizeof($disallow_access))
|
||||
if (!sizeof($disallow_access))
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
foreach($disallow_access as $acc_id)
|
||||
foreach ($disallow_access as $acc_id)
|
||||
{
|
||||
$acc_id = (int) $acc_id;
|
||||
$str_where .= "forum_id = $acc_id OR ";
|
||||
@@ -201,7 +201,7 @@ class news extends module_base
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach($disallow_access as $acc_id)
|
||||
foreach ($disallow_access as $acc_id)
|
||||
{
|
||||
$acc_id = (int) $acc_id;
|
||||
$str_where .= "forum_id <> $acc_id AND ";
|
||||
@@ -244,12 +244,12 @@ class news extends module_base
|
||||
$this->template->assign_block_vars('news', $news_row);
|
||||
|
||||
// Show the news overview
|
||||
if($news < 0)
|
||||
if ($news < 0)
|
||||
{
|
||||
$count = $fetch_news['topic_count'];
|
||||
for ($i = 0; $i < $count; $i++)
|
||||
{
|
||||
if(isset($fetch_news[$i]['striped']) && $fetch_news[$i]['striped'] == true)
|
||||
if (isset($fetch_news[$i]['striped']) && $fetch_news[$i]['striped'] == true)
|
||||
{
|
||||
$open_bracket = '[ ';
|
||||
$close_bracket = ' ]';
|
||||
@@ -349,7 +349,7 @@ class news extends module_base
|
||||
// Assign pagination
|
||||
$this->pagination->generate_template_pagination($view_topic_url, 'news.news_row.pagination', 'start', $fetch_news[$i]['topic_replies'] + 1, $this->config['posts_per_page'], 1);
|
||||
|
||||
if(!empty($fetch_news[$i]['attachments']))
|
||||
if (!empty($fetch_news[$i]['attachments']))
|
||||
{
|
||||
foreach ($fetch_news[$i]['attachments'] as $attachment)
|
||||
{
|
||||
@@ -400,7 +400,7 @@ class news extends module_base
|
||||
|
||||
$this->pagination->generate_template_pagination($view_topic_url, 'news.news_row.pagination', 'start', $fetch_news[$i]['topic_replies'] + 1, $this->config['posts_per_page'], 1);
|
||||
|
||||
if(!empty($fetch_news[$i]['attachments']))
|
||||
if (!empty($fetch_news[$i]['attachments']))
|
||||
{
|
||||
foreach ($fetch_news[$i]['attachments'] as $attachment)
|
||||
{
|
||||
@@ -418,7 +418,7 @@ class news extends module_base
|
||||
'GOTO_PAGE_IMG' => $this->user->img('icon_post_target', 'GOTO_PAGE'),
|
||||
));
|
||||
|
||||
if($this->config['board3_news_style_' . $module_id])
|
||||
if ($this->config['board3_news_style_' . $module_id])
|
||||
{
|
||||
return 'news_compact_center.html';
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ class poll extends module_base
|
||||
$this->user->add_lang('viewtopic');
|
||||
|
||||
// check if we need to include the bbcode class
|
||||
if(!class_exists('bbcode'))
|
||||
if (!class_exists('bbcode'))
|
||||
{
|
||||
include($this->phpbb_root_path . 'includes/bbcode.' . $this->php_ext);
|
||||
}
|
||||
@@ -234,7 +234,7 @@ class poll extends module_base
|
||||
$topic_data['topic_status'] != ITEM_LOCKED &&
|
||||
$topic_data['forum_status'] != ITEM_LOCKED) ? true : false;
|
||||
|
||||
if($s_can_up_vote)
|
||||
if ($s_can_up_vote)
|
||||
{
|
||||
$redirect_url = $this->modules_helper->route('board3_portal_controller');
|
||||
|
||||
@@ -327,11 +327,11 @@ class poll extends module_base
|
||||
// Get readable forums
|
||||
$forum_list = array_unique(array_keys($this->auth->acl_getf('f_read', true)));
|
||||
|
||||
if($this->config['board3_poll_topic_id_' . $module_id] !== '')
|
||||
if ($this->config['board3_poll_topic_id_' . $module_id] !== '')
|
||||
{
|
||||
$poll_forums_config = explode(',' ,$this->config['board3_poll_topic_id_' . $module_id]);
|
||||
|
||||
if($this->config['board3_poll_exclude_id_' . $module_id])
|
||||
if ($this->config['board3_poll_exclude_id_' . $module_id])
|
||||
{
|
||||
$forum_list = array_unique(array_diff($forum_list, $poll_forums_config));
|
||||
}
|
||||
@@ -343,7 +343,7 @@ class poll extends module_base
|
||||
|
||||
$where = '';
|
||||
|
||||
if(sizeof($forum_list))
|
||||
if (sizeof($forum_list))
|
||||
{
|
||||
$poll_forums = true;
|
||||
$where = 'AND ' . $this->db->sql_in_set('t.forum_id', $forum_list);
|
||||
@@ -375,7 +375,7 @@ class poll extends module_base
|
||||
|
||||
if ($result)
|
||||
{
|
||||
while($data = $this->db->sql_fetchrow($result))
|
||||
while ($data = $this->db->sql_fetchrow($result))
|
||||
{
|
||||
$has_poll = true;
|
||||
$poll_has_options = false;
|
||||
@@ -384,7 +384,7 @@ class poll extends module_base
|
||||
$forum_id = (int) $data['forum_id'];
|
||||
|
||||
$cur_voted_id = array();
|
||||
if($this->config['board3_poll_allow_vote_' . $module_id])
|
||||
if ($this->config['board3_poll_allow_vote_' . $module_id])
|
||||
{
|
||||
if ($this->user->data['is_registered'])
|
||||
{
|
||||
@@ -436,7 +436,7 @@ class poll extends module_base
|
||||
|
||||
if ($poll_result)
|
||||
{
|
||||
while($polls_data = $this->db->sql_fetchrow($poll_result))
|
||||
while ($polls_data = $this->db->sql_fetchrow($poll_result))
|
||||
{
|
||||
$poll_has_options = true;
|
||||
$poll_data[] = $polls_data;
|
||||
@@ -447,7 +447,7 @@ class poll extends module_base
|
||||
|
||||
$make_poll_view = array();
|
||||
|
||||
if(in_array($topic_id, $poll_view_ar) === false)
|
||||
if (in_array($topic_id, $poll_view_ar) === false)
|
||||
{
|
||||
$make_poll_view[] = $topic_id;
|
||||
$make_poll_view = array_merge($poll_view_ar, $make_poll_view);
|
||||
@@ -497,7 +497,7 @@ class poll extends module_base
|
||||
'U_VIEW_TOPIC' => $viewtopic_url,
|
||||
));
|
||||
|
||||
foreach($poll_data as $pd)
|
||||
foreach ($poll_data as $pd)
|
||||
{
|
||||
$option_pct = ($poll_total_votes > 0) ? $pd['poll_option_total'] / $poll_total_votes : 0;
|
||||
$option_pct_txt = sprintf("%.1d%%", round($option_pct * 100));
|
||||
|
||||
@@ -138,7 +138,7 @@ class recent extends module_base
|
||||
ORDER BY topic_time DESC';
|
||||
$result = $this->db->sql_query_limit($sql, $this->config['board3_max_topics_' . $module_id], 0 , 600);
|
||||
|
||||
while(($row = $this->db->sql_fetchrow($result)) && ($row['topic_title']))
|
||||
while (($row = $this->db->sql_fetchrow($result)) && ($row['topic_title']))
|
||||
{
|
||||
// auto auth
|
||||
if (($this->auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0'))
|
||||
@@ -164,7 +164,7 @@ class recent extends module_base
|
||||
ORDER BY topic_time DESC';
|
||||
$result = $this->db->sql_query_limit($sql, $this->config['board3_max_topics_' . $module_id], 0, 600);
|
||||
|
||||
while(($row = $this->db->sql_fetchrow($result)) && ($row['topic_title']))
|
||||
while (($row = $this->db->sql_fetchrow($result)) && ($row['topic_title']))
|
||||
{
|
||||
// auto auth
|
||||
if (($this->auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0'))
|
||||
@@ -191,7 +191,7 @@ class recent extends module_base
|
||||
ORDER BY topic_time DESC';
|
||||
$result = $this->db->sql_query_limit($sql, $this->config['board3_max_topics_' . $module_id], 0, 600);
|
||||
|
||||
while(($row = $this->db->sql_fetchrow($result)) && ($row['topic_title']))
|
||||
while (($row = $this->db->sql_fetchrow($result)) && ($row['topic_title']))
|
||||
{
|
||||
// auto auth
|
||||
if (($this->auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0'))
|
||||
|
||||
@@ -106,7 +106,7 @@ class stylechanger extends module_base
|
||||
$style_select .= '<option value="' . $url . '"' . ($row['style_id'] == $this->user->style['style_id'] ? ' selected="selected"' : '') . '>' . utf8_htmlspecialchars($row['style_name']) . '</option>';
|
||||
}
|
||||
$this->db->sql_freeresult($result);
|
||||
if(strlen($style_select))
|
||||
if (strlen($style_select))
|
||||
{
|
||||
$this->template->assign_var('STYLE_SELECT', $style_select);
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ class welcome extends module_base
|
||||
generate_text_for_storage($welcome_message, $uid, $bitfield, $flags, true, true, true);
|
||||
|
||||
// first check for obvious errors, we don't want to waste server resources
|
||||
if(empty($welcome_message))
|
||||
if (empty($welcome_message))
|
||||
{
|
||||
trigger_error($this->user->lang['ACP_PORTAL_WELCOME_MESSAGE_SHORT']. adm_back_link($u_action), E_USER_WARNING);
|
||||
}
|
||||
@@ -217,7 +217,7 @@ class welcome extends module_base
|
||||
// Edit or add menu item
|
||||
case 'reset':
|
||||
default:
|
||||
if(!isset($welcome_message))
|
||||
if (!isset($welcome_message))
|
||||
{
|
||||
$welcome_message = generate_text_for_edit($portal_config['board3_welcome_message_' . $module_id], $this->config['board3_welcome_message_uid_' . $module_id], '');
|
||||
}
|
||||
@@ -235,7 +235,7 @@ class welcome extends module_base
|
||||
'MAX_FONT_SIZE' => (int) $this->config['max_post_font_size'],
|
||||
));
|
||||
|
||||
if(!function_exists('display_forums'))
|
||||
if (!function_exists('display_forums'))
|
||||
{
|
||||
include($this->phpbb_root_path . 'includes/functions_display.' . $this->php_ext);
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ class phpbb_acp_move_module_test extends \board3\portal\tests\testframework\data
|
||||
{
|
||||
$this->constraints_handler->module_column = array();
|
||||
$portal_modules = obtain_portal_modules();
|
||||
foreach($portal_modules as $cur_module)
|
||||
foreach ($portal_modules as $cur_module)
|
||||
{
|
||||
$this->constraints_handler->module_column[$cur_module['module_classname']][] = $this->portal_columns->number_to_string($cur_module['module_column']);
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ class board3_portal_modules_manager_test extends \board3\portal\tests\testframew
|
||||
|
||||
$this->modules_manager = new \board3\portal\portal\modules\manager($cache, $db, $this->b3p_controller_helper, $this->portal_columns, $portal_helper, $this->constraints_handler, $this->database_handler, $request, $user);
|
||||
$portal_modules = obtain_portal_modules();
|
||||
foreach($portal_modules as $cur_module)
|
||||
foreach ($portal_modules as $cur_module)
|
||||
{
|
||||
$this->constraints_handler->module_column[$cur_module['module_classname']][] = $this->portal_columns->number_to_string($cur_module['module_column']);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user