phpBB

Code Changes

File: includes/acp/acp_ban.php

  Unmodified   Added   Modified   Removed
Line 156Line 156
					FROM ' . BANLIST_TABLE . '
WHERE (ban_end >= ' . time() . "
OR ban_end = 0)

					FROM ' . BANLIST_TABLE . '
WHERE (ban_end >= ' . time() . "
OR ban_end = 0)

						AND ban_ip <> ''";


						AND ban_ip <> ''
ORDER BY ban_ip";

			break;

case 'email':

			break;

case 'email':

Line 168Line 169
					FROM ' . BANLIST_TABLE . '
WHERE (ban_end >= ' . time() . "
OR ban_end = 0)

					FROM ' . BANLIST_TABLE . '
WHERE (ban_end >= ' . time() . "
OR ban_end = 0)

						AND ban_email <> ''";


						AND ban_email <> ''
ORDER BY ban_email";

			break;
}
$result = $db->sql_query($sql);


			break;
}
$result = $db->sql_query($sql);


		$banned_options = '';

		$banned_options = $excluded_options = array();

		$ban_length = $ban_reasons = $ban_give_reasons = array();

while ($row = $db->sql_fetchrow($result))
{

		$ban_length = $ban_reasons = $ban_give_reasons = array();

while ($row = $db->sql_fetchrow($result))
{

			$banned_options .= '<option' . (($row['ban_exclude']) ? ' class="sep"' : '') . ' value="' . $row['ban_id'] . '">' . $row[$field] . '</option>';










			$option = '<option value="' . $row['ban_id'] . '">' . $row[$field] . '</option>';

if ($row['ban_exclude'])
{
$excluded_options[] = $option;
}
else
{
$banned_options[] = $option;
}


$time_length = ($row['ban_end']) ? ($row['ban_end'] - $row['ban_start']) / 60 : 0;


$time_length = ($row['ban_end']) ? ($row['ban_end'] - $row['ban_start']) / 60 : 0;

			$ban_length[$row['ban_id']] = (isset($ban_end_text[$time_length])) ? $ban_end_text[$time_length] : $user->lang['UNTIL'] . ' -> ' . $user->format_date($row['ban_end']);

















if ($time_length == 0)
{
// Banned permanently
$ban_length[$row['ban_id']] = $user->lang['PERMANENT'];
}
else if (isset($ban_end_text[$time_length]))
{
// Banned for a given duration
$ban_length[$row['ban_id']] = sprintf($user->lang['BANNED_UNTIL_DURATION'], $ban_end_text[$time_length], $user->format_date($row['ban_end'], false, true));
}
else
{
// Banned until given date
$ban_length[$row['ban_id']] = sprintf($user->lang['BANNED_UNTIL_DATE'], $user->format_date($row['ban_end'], false, true));
}


$ban_reasons[$row['ban_id']] = $row['ban_reason'];
$ban_give_reasons[$row['ban_id']] = $row['ban_give_reason'];


$ban_reasons[$row['ban_id']] = $row['ban_reason'];
$ban_give_reasons[$row['ban_id']] = $row['ban_give_reason'];

Line 207Line 233
				$template->assign_block_vars('ban_reason', array(
'BAN_ID' => $ban_id,
'REASON' => $reason,

				$template->assign_block_vars('ban_reason', array(
'BAN_ID' => $ban_id,
'REASON' => $reason,

					'A_REASON'	=> addslashes(htmlspecialchars_decode($reason)),

					'A_REASON'	=> addslashes($reason),

				));
}
}

				));
}
}

Line 219Line 245
				$template->assign_block_vars('ban_give_reason', array(
'BAN_ID' => $ban_id,
'REASON' => $reason,

				$template->assign_block_vars('ban_give_reason', array(
'BAN_ID' => $ban_id,
'REASON' => $reason,

					'A_REASON'	=> addslashes(htmlspecialchars_decode($reason)),

					'A_REASON'	=> addslashes($reason),

				));
}

				));
}

 
		}

$options = '';
if ($excluded_options)
{
$options .= '<optgroup label="' . $user->lang['OPTIONS_EXCLUDED'] . '">';
$options .= implode('', $excluded_options);
$options .= '</optgroup>';
}

if ($banned_options)
{
$options .= '<optgroup label="' . $user->lang['OPTIONS_BANNED'] . '">';
$options .= implode('', $banned_options);
$options .= '</optgroup>';

		}

$template->assign_vars(array(
'S_BAN_END_OPTIONS' => $ban_end_options,

		}

$template->assign_vars(array(
'S_BAN_END_OPTIONS' => $ban_end_options,

			'S_BANNED_OPTIONS'	=> ($banned_options) ? true : false,
'BANNED_OPTIONS' => $banned_options)
);

			'S_BANNED_OPTIONS'	=> ($banned_options || $excluded_options) ? true : false,
'BANNED_OPTIONS' => $options,
));

	}
}


	}
}