Whitespace

This commit is contained in:
dmzx
2015-12-19 23:39:59 +01:00
parent 3bd47087ad
commit 13d7c59c11
2 changed files with 18 additions and 19 deletions

View File

@@ -71,7 +71,7 @@ class functions_mchat
{ {
// Grab the config entries in the ACP...and cache em :P // Grab the config entries in the ACP...and cache em :P
$config_mchat = $this->cache->get('_mchat_config'); $config_mchat = $this->cache->get('_mchat_config');
if ($config_mchat === false) if ($config_mchat === false)
{ {
$sql = 'SELECT * $sql = 'SELECT *
@@ -79,7 +79,7 @@ class functions_mchat
$result = $this->db->sql_query($sql); $result = $this->db->sql_query($sql);
$rows = $this->db->sql_fetchrowset($result); $rows = $this->db->sql_fetchrowset($result);
$this->db->sql_freeresult($result); $this->db->sql_freeresult($result);
$config_mchat = array(); $config_mchat = array();
foreach ($rows as $row) foreach ($rows as $row)
{ {
@@ -108,7 +108,7 @@ class functions_mchat
$chat_timeout = $chat_timeout - ($hours * 3600); $chat_timeout = $chat_timeout - ($hours * 3600);
$chat_session .= $hours > 1 ? ($hours . ' ' . $this->user->lang['MCHAT_HOURS']) : ($hours . ' ' . $this->user->lang['MCHAT_HOUR']); $chat_session .= $hours > 1 ? ($hours . ' ' . $this->user->lang['MCHAT_HOURS']) : ($hours . ' ' . $this->user->lang['MCHAT_HOUR']);
} }
$minutes = floor($chat_timeout / 60); $minutes = floor($chat_timeout / 60);
if ($minutes) if ($minutes)
{ {
@@ -116,14 +116,14 @@ class functions_mchat
$chat_timeout = $chat_timeout - ($minutes * 60); $chat_timeout = $chat_timeout - ($minutes * 60);
$chat_session .= $minutes; $chat_session .= $minutes;
} }
$seconds = ceil($chat_timeout); $seconds = ceil($chat_timeout);
if ($seconds) if ($seconds)
{ {
$seconds = $seconds > 1 ? ($seconds . ' ' . $this->user->lang['MCHAT_SECONDS']) : ($seconds . ' ' . $this->user->lang['MCHAT_SECOND']); $seconds = $seconds > 1 ? ($seconds . ' ' . $this->user->lang['MCHAT_SECONDS']) : ($seconds . ' ' . $this->user->lang['MCHAT_SECOND']);
$chat_session .= $seconds; $chat_session .= $seconds;
} }
return sprintf($this->user->lang['MCHAT_ONLINE_EXPLAIN'], $chat_session); return sprintf($this->user->lang['MCHAT_ONLINE_EXPLAIN'], $chat_session);
} }
@@ -155,7 +155,7 @@ class functions_mchat
$result = $this->db->sql_query($sql); $result = $this->db->sql_query($sql);
$rows = $this->db->sql_fetchrowset($result); $rows = $this->db->sql_fetchrowset($result);
$this->db->sql_freeresult($result); $this->db->sql_freeresult($result);
$can_view_hidden = $this->auth->acl_get('u_viewonline'); $can_view_hidden = $this->auth->acl_get('u_viewonline');
foreach ($rows as $row) foreach ($rows as $row)
{ {
@@ -170,14 +170,14 @@ class functions_mchat
$row['username'] = '<em>' . $row['username'] . '</em>'; $row['username'] = '<em>' . $row['username'] . '</em>';
} }
} }
$mchat_user_count++; $mchat_user_count++;
$mchat_user_online_link = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $this->user->lang['GUEST']); $mchat_user_online_link = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $this->user->lang['GUEST']);
$mchat_user_list .= ($mchat_user_list != '') ? $this->user->lang['COMMA_SEPARATOR'] . $mchat_user_online_link : $mchat_user_online_link; $mchat_user_list .= ($mchat_user_list != '') ? $this->user->lang['COMMA_SEPARATOR'] . $mchat_user_online_link : $mchat_user_online_link;
} }
$refresh_message = $this->mchat_session_time($session_time); $refresh_message = $this->mchat_session_time($session_time);
if (!$mchat_user_count) if (!$mchat_user_count)
{ {
return array( return array(
@@ -217,7 +217,7 @@ class functions_mchat
$this->db->sql_freeresult($result); $this->db->sql_freeresult($result);
$sql_ary = array('user_lastupdate' => time()); $sql_ary = array('user_lastupdate' => time());
if ($row) if ($row)
{ {
$sql = 'UPDATE ' . $this->mchat_sessions_table . ' $sql = 'UPDATE ' . $this->mchat_sessions_table . '
@@ -229,7 +229,7 @@ class functions_mchat
$sql_ary['user_id'] = $this->user->data['user_id']; $sql_ary['user_id'] = $this->user->data['user_id'];
$sql = 'INSERT INTO ' . $this->mchat_sessions_table . ' ' . $this->db->sql_build_array('INSERT', $sql_ary); $sql = 'INSERT INTO ' . $this->mchat_sessions_table . ' ' . $this->db->sql_build_array('INSERT', $sql_ary);
} }
$this->db->sql_query($sql); $this->db->sql_query($sql);
} }
} }
@@ -262,7 +262,7 @@ class functions_mchat
$result = $this->db->sql_query($sql); $result = $this->db->sql_query($sql);
$mchat_total_messages = (int) $this->db->sql_fetchfield('messages'); $mchat_total_messages = (int) $this->db->sql_fetchfield('messages');
$this->db->sql_freeresult($result); $this->db->sql_freeresult($result);
if ($mchat_total_messages <= $mchat_prune_amount) if ($mchat_total_messages <= $mchat_prune_amount)
{ {
return; return;
@@ -291,7 +291,7 @@ class functions_mchat
{ {
$default_bbcodes = array('B', 'I', 'U', 'QUOTE', 'CODE', 'LIST', 'IMG', 'URL', 'SIZE', 'COLOR', 'EMAIL', 'FLASH'); $default_bbcodes = array('B', 'I', 'U', 'QUOTE', 'CODE', 'LIST', 'IMG', 'URL', 'SIZE', 'COLOR', 'EMAIL', 'FLASH');
$disallowed_bbcode_array = $this->get_disallowed_bbcodes(); $disallowed_bbcode_array = $this->get_disallowed_bbcodes();
// Let's remove the default bbcodes // Let's remove the default bbcodes
if (!empty($disallowed_bbcode_array)) if (!empty($disallowed_bbcode_array))
{ {
@@ -310,7 +310,7 @@ class functions_mchat
// From /includes/functions_display.php // From /includes/functions_display.php
display_custom_bbcodes(); display_custom_bbcodes();
} }
public function get_disallowed_bbcodes() public function get_disallowed_bbcodes()
{ {
$config_mchat = $this->mchat_cache(); $config_mchat = $this->mchat_cache();
@@ -318,7 +318,7 @@ class functions_mchat
$disallowed_bbcode_array = explode('|', $disallowed_bbcode); $disallowed_bbcode_array = explode('|', $disallowed_bbcode);
return $disallowed_bbcode_array; return $disallowed_bbcode_array;
} }
function mchat_avatar($row) function mchat_avatar($row)
{ {
return phpbb_get_user_avatar(array( return phpbb_get_user_avatar(array(

View File

@@ -49,7 +49,7 @@ class render_helper
/** @var string */ /** @var string */
protected $mchat_table; protected $mchat_table;
public $initialized = false; public $initialized = false;
/** /**
@@ -144,7 +144,7 @@ class render_helper
$result = $this->db->sql_query($sql); $result = $this->db->sql_query($sql);
$rows = $this->db->sql_fetchrowset($result); $rows = $this->db->sql_fetchrowset($result);
$this->db->sql_freeresult($result); $this->db->sql_freeresult($result);
$foes_array = array(); $foes_array = array();
foreach ($rows as $row) foreach ($rows as $row)
{ {
@@ -222,7 +222,7 @@ class render_helper
// Show not authorized // Show not authorized
trigger_error('NO_AUTH_OPERATION', E_USER_NOTICE); trigger_error('NO_AUTH_OPERATION', E_USER_NOTICE);
} }
$mchat_redirect = $this->request->variable('redirect', ''); $mchat_redirect = $this->request->variable('redirect', '');
$mchat_redirect = ($mchat_redirect == 'index') ? append_sid("{$this->phpbb_root_path}index.{$this->phpEx}") : $this->helper->route('dmzx_mchat_controller', array('#mChat')); $mchat_redirect = ($mchat_redirect == 'index') ? append_sid("{$this->phpbb_root_path}index.{$this->phpEx}") : $this->helper->route('dmzx_mchat_controller', array('#mChat'));
@@ -246,7 +246,6 @@ class render_helper
break; break;
case 'archive': case 'archive':
if (!$mchat_read_archive || !$mchat_view) if (!$mchat_read_archive || !$mchat_view)
{ {
@@ -1084,7 +1083,7 @@ class render_helper
'lang_title' => $this->user->lang['MCHAT_TITLE'], 'lang_title' => $this->user->lang['MCHAT_TITLE'],
); );
} }
public function get_disallowed_bbcodes() public function get_disallowed_bbcodes()
{ {
return $this->functions_mchat->get_disallowed_bbcodes(); return $this->functions_mchat->get_disallowed_bbcodes();