mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -07:00
Change for with count.
This commit is contained in:
parent
32ca1d66fc
commit
56540c893a
16 changed files with 73 additions and 73 deletions
|
@ -288,7 +288,7 @@ if ($mode == 'cats') {
|
|||
$row = DB()->sql_fetchrowset($result);
|
||||
DB()->sql_freeresult($result);
|
||||
|
||||
for ($i = 0; $i < count($row); $i++) {
|
||||
for ($i = 0, $iMax = count($row); $i < $iMax; $i++) {
|
||||
if ($row[$i]['cat_id'] == IMAGE_CAT) {
|
||||
$s_assigned_group_images[] = $row[$i]['group_name'];
|
||||
}
|
||||
|
@ -399,7 +399,7 @@ if ($submit && $mode == 'quota') {
|
|||
|
||||
$allowed_list = array();
|
||||
|
||||
for ($i = 0; $i < count($quota_change_list); $i++) {
|
||||
for ($i = 0, $iMax = count($quota_change_list); $i < $iMax; $i++) {
|
||||
$filesize_list[$i] = ($size_select_list[$i] == 'kb') ? round($filesize_list[$i] * 1024) : (($size_select_list[$i] == 'mb') ? round($filesize_list[$i] * 1048576) : $filesize_list[$i]);
|
||||
|
||||
$sql = 'UPDATE ' . BB_QUOTA_LIMITS . "
|
||||
|
@ -504,7 +504,7 @@ if ($mode == 'quota') {
|
|||
$rows = DB()->sql_fetchrowset($result);
|
||||
DB()->sql_freeresult($result);
|
||||
|
||||
for ($i = 0; $i < count($rows); $i++) {
|
||||
for ($i = 0, $iMax = count($rows); $i < $iMax; $i++) {
|
||||
$size_format = ($rows[$i]['quota_limit'] >= 1048576) ? 'mb' : (($rows[$i]['quota_limit'] >= 1024) ? 'kb' : 'b');
|
||||
|
||||
if ($rows[$i]['quota_limit'] >= 1048576) {
|
||||
|
|
|
@ -87,7 +87,7 @@ $disallow_select = '<select name="disallowed_id">';
|
|||
if (count($disallowed) <= 0) {
|
||||
$disallow_select .= '<option value="">' . $lang['NO_DISALLOWED'] . '</option>';
|
||||
} else {
|
||||
for ($i = 0; $i < count($disallowed); $i++) {
|
||||
for ($i = 0, $iMax = count($disallowed); $i < $iMax; $i++) {
|
||||
$disallow_select .= '<option value="' . $disallowed[$i]['disallow_id'] . '">' . $disallowed[$i]['disallow_username'] . '</option>';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ if ($submit && $mode == 'extensions') {
|
|||
// Generate correct Change List
|
||||
$extensions = array();
|
||||
|
||||
for ($i = 0; $i < count($extension_change_list); $i++) {
|
||||
for ($i = 0, $iMax = count($extension_change_list); $i < $iMax; $i++) {
|
||||
$extensions['_' . $extension_change_list[$i]]['comment'] = $extension_explain_list[$i];
|
||||
$extensions['_' . $extension_change_list[$i]]['group_id'] = (int)$group_select_list[$i];
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ if ($submit && $mode == 'extensions') {
|
|||
DB()->sql_freeresult($result);
|
||||
|
||||
if ($num_rows > 0) {
|
||||
for ($i = 0; $i < count($extension_row); $i++) {
|
||||
for ($i = 0, $iMax = count($extension_row); $i < $iMax; $i++) {
|
||||
if ($extension_row[$i]['comment'] != $extensions['_' . $extension_row[$i]['ext_id']]['comment'] || (int)$extension_row[$i]['group_id'] != (int)$extensions['_' . $extension_row[$i]['ext_id']]['group_id']) {
|
||||
$sql_ary = array(
|
||||
'comment' => (string)$extensions['_' . $extension_row[$i]['ext_id']]['comment'],
|
||||
|
@ -251,15 +251,15 @@ if ($submit && $mode == 'groups') {
|
|||
|
||||
$allowed_list = array();
|
||||
|
||||
for ($i = 0; $i < count($group_allowed_list); $i++) {
|
||||
for ($j = 0; $j < count($group_change_list); $j++) {
|
||||
for ($i = 0, $iMax = count($group_allowed_list); $i < $iMax; $i++) {
|
||||
for ($j = 0, $jMax = count($group_change_list); $j < $iMax; $j++) {
|
||||
if ($group_allowed_list[$i] == $group_change_list[$j]) {
|
||||
$allowed_list[$j] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for ($i = 0; $i < count($group_change_list); $i++) {
|
||||
for ($i = 0, $iMax = count($group_change_list); $i < $iMax; $i++) {
|
||||
$allowed = (isset($allowed_list[$i])) ? 1 : 0;
|
||||
|
||||
$filesize_list[$i] = ($size_select_list[$i] == 'kb') ? round($filesize_list[$i] * 1024) : (($size_select_list[$i] == 'mb') ? round($filesize_list[$i] * 1048576) : $filesize_list[$i]);
|
||||
|
@ -472,7 +472,7 @@ if (@$add_forum && $e_mode == 'perm' && $group) {
|
|||
$add_forums_list = get_var('entries', array(0));
|
||||
$add_all_forums = false;
|
||||
|
||||
for ($i = 0; $i < count($add_forums_list); $i++) {
|
||||
for ($i = 0, $iMax = count($add_forums_list); $i < $iMax; $i++) {
|
||||
if ($add_forums_list[$i] == 0) {
|
||||
$add_all_forums = true;
|
||||
}
|
||||
|
@ -507,7 +507,7 @@ if (@$add_forum && $e_mode == 'perm' && $group) {
|
|||
}
|
||||
|
||||
// Generate array for Auth_Pack, do not add doubled forums
|
||||
for ($i = 0; $i < count($add_forums_list); $i++) {
|
||||
for ($i = 0, $iMax = count($add_forums_list); $i < $iMax; $i++) {
|
||||
if (!in_array($add_forums_list[$i], $auth_p)) {
|
||||
$auth_p[] = $add_forums_list[$i];
|
||||
}
|
||||
|
@ -544,7 +544,7 @@ if (@$delete_forum && $e_mode == 'perm' && $group) {
|
|||
$auth_p = array();
|
||||
|
||||
// Generate array for Auth_Pack, delete the chosen ones
|
||||
for ($i = 0; $i < count($auth_p2); $i++) {
|
||||
for ($i = 0, $iMax = count($auth_p2); $i < $iMax; $i++) {
|
||||
if (!in_array($auth_p2[$i], $delete_forums_list)) {
|
||||
$auth_p[] = $auth_p2[$i];
|
||||
}
|
||||
|
@ -597,7 +597,7 @@ if ($e_mode == 'perm' && $group) {
|
|||
}
|
||||
}
|
||||
|
||||
for ($i = 0; $i < count($forum_perm); $i++) {
|
||||
for ($i = 0, $iMax = count($forum_perm); $i < $iMax; $i++) {
|
||||
$template->assign_block_vars('allow_option_values', array(
|
||||
'VALUE' => $forum_perm[$i]['forum_id'],
|
||||
'OPTION' => htmlCHR($forum_perm[$i]['forum_name']))
|
||||
|
|
|
@ -105,7 +105,7 @@ if (isset($_POST['submit'])) {
|
|||
if (isset($_POST['simpleauth'])) {
|
||||
$simple_ary = $simple_auth_ary[(int)$_POST['simpleauth']];
|
||||
|
||||
for ($i = 0; $i < count($simple_ary); $i++) {
|
||||
for ($i = 0, $iMax = count($simple_ary); $i < $iMax; $i++) {
|
||||
$sql .= (($sql != '') ? ', ' : '') . $forum_auth_fields[$i] . ' = ' . $simple_ary[$i];
|
||||
}
|
||||
|
||||
|
@ -113,7 +113,7 @@ if (isset($_POST['submit'])) {
|
|||
$sql = "UPDATE " . BB_FORUMS . " SET $sql WHERE forum_id = $forum_id";
|
||||
}
|
||||
} else {
|
||||
for ($i = 0; $i < count($forum_auth_fields); $i++) {
|
||||
for ($i = 0, $iMax = count($forum_auth_fields); $i < $iMax; $i++) {
|
||||
$value = (int)$_POST[$forum_auth_fields[$i]];
|
||||
|
||||
if ($forum_auth_fields[$i] == 'auth_vote') {
|
||||
|
@ -163,7 +163,7 @@ if (empty($forum_id)) {
|
|||
@reset($simple_auth_ary);
|
||||
while (list($key, $auth_levels) = each($simple_auth_ary)) {
|
||||
$matched = 1;
|
||||
for ($k = 0; $k < count($auth_levels); $k++) {
|
||||
for ($k = 0, $kMax = count($auth_levels); $k < $iMax; $k++) {
|
||||
$matched_type = $key;
|
||||
|
||||
if ($forum_rows[0][$forum_auth_fields[$k]] != $auth_levels[$k]) {
|
||||
|
@ -189,7 +189,7 @@ if (empty($forum_id)) {
|
|||
if (empty($adv)) {
|
||||
$simple_auth = '<select name="simpleauth">';
|
||||
|
||||
for ($j = 0; $j < count($simple_auth_types); $j++) {
|
||||
for ($j = 0, $jMax = count($simple_auth_types); $j < $iMax; $j++) {
|
||||
$selected = ($matched_type == $j) ? ' selected="selected"' : '';
|
||||
$simple_auth .= '<option value="' . $j . '"' . $selected . '>' . $simple_auth_types[$j] . '</option>';
|
||||
}
|
||||
|
@ -207,10 +207,10 @@ if (empty($forum_id)) {
|
|||
// Output values of individual
|
||||
// fields
|
||||
//
|
||||
for ($j = 0; $j < count($forum_auth_fields); $j++) {
|
||||
for ($j = 0, $jMax = count($forum_auth_fields); $j < $iMax; $j++) {
|
||||
$custom_auth[$j] = ' <select name="' . $forum_auth_fields[$j] . '">';
|
||||
|
||||
for ($k = 0; $k < count($forum_auth_levels); $k++) {
|
||||
for ($k = 0, $kMax = count($forum_auth_levels); $k < $iMax; $k++) {
|
||||
$selected = ($forum_rows[0][$forum_auth_fields[$j]] == $forum_auth_const[$k]) ? ' selected="selected"' : '';
|
||||
$custom_auth[$j] .= '<option value="' . $forum_auth_const[$k] . '"' . $selected . '>' . $lang['FORUM_' . strtoupper($forum_auth_levels[$k])] . '</OPTION>';
|
||||
}
|
||||
|
|
|
@ -113,7 +113,7 @@ if (isset($_POST['submit'])) {
|
|||
if (isset($_POST['simpleauth'])) {
|
||||
$simple_ary = $simple_auth_ary[(int)$_POST['simpleauth']];
|
||||
|
||||
for ($i = 0; $i < count($simple_ary); $i++) {
|
||||
for ($i = 0, $iMax = count($simple_ary); $i < $iMax; $i++) {
|
||||
$sql .= (($sql != '') ? ', ' : '') . $forum_auth_fields[$i] . ' = ' . $simple_ary[$i];
|
||||
}
|
||||
|
||||
|
@ -121,7 +121,7 @@ if (isset($_POST['submit'])) {
|
|||
$sql = "UPDATE " . BB_FORUMS . " SET $sql WHERE forum_id = $forum_id";
|
||||
}
|
||||
} else {
|
||||
for ($i = 0; $i < count($forum_auth_fields); $i++) {
|
||||
for ($i = 0, $iMax = count($forum_auth_fields); $i < $iMax; $i++) {
|
||||
$value = (int)$_POST[$forum_auth_fields[$i]];
|
||||
|
||||
if ($forum_auth_fields[$i] == 'auth_vote') {
|
||||
|
@ -145,7 +145,7 @@ if (isset($_POST['submit'])) {
|
|||
$forum_sql = '';
|
||||
$adv = 0;
|
||||
} elseif (!empty($cat_id)) {
|
||||
for ($i = 0; $i < count($forum_auth_fields); $i++) {
|
||||
for ($i = 0, $iMax = count($forum_auth_fields); $i < $iMax; $i++) {
|
||||
$value = (int)$_POST[$forum_auth_fields[$i]];
|
||||
|
||||
if ($forum_auth_fields[$i] == 'auth_vote') {
|
||||
|
@ -199,7 +199,7 @@ if (empty($forum_id) && empty($cat_id)) {
|
|||
'S_COLUMN_SPAN' => count($forum_auth_fields) + 1,
|
||||
));
|
||||
|
||||
for ($i = 0; $i < count($forum_auth_fields); $i++) {
|
||||
for ($i = 0, $iMax = count($forum_auth_fields); $i < $iMax; $i++) {
|
||||
$template->assign_block_vars('forum_auth_titles', array(
|
||||
'CELL_TITLE' => $field_names[$forum_auth_fields[$i]],
|
||||
));
|
||||
|
@ -224,7 +224,7 @@ if (empty($forum_id) && empty($cat_id)) {
|
|||
'CAT_URL' => 'admin_forumauth_list.php' . '?' . POST_CAT_URL . '=' . $category_rows[$i]['cat_id'])
|
||||
);
|
||||
|
||||
for ($j = 0; $j < count($forum_rows); $j++) {
|
||||
for ($j = 0, $jMax = count($forum_rows); $j < $iMax; $j++) {
|
||||
if ($cat_id == $forum_rows[$j]['cat_id']) {
|
||||
$template->assign_block_vars('cat_row.forum_row', array(
|
||||
'ROW_CLASS' => !($j % 2) ? 'row4' : 'row5',
|
||||
|
@ -232,9 +232,9 @@ if (empty($forum_id) && empty($cat_id)) {
|
|||
'IS_SUBFORUM' => $forum_rows[$j]['forum_parent'],
|
||||
));
|
||||
|
||||
for ($k = 0; $k < count($forum_auth_fields); $k++) {
|
||||
for ($k = 0, $kMax = count($forum_auth_fields); $k < $iMax; $k++) {
|
||||
$item_auth_value = $forum_rows[$j][$forum_auth_fields[$k]];
|
||||
for ($l = 0; $l < count($forum_auth_const); $l++) {
|
||||
for ($l = 0, $lMax = count($forum_auth_const); $l < $iMax; $l++) {
|
||||
if ($item_auth_value == $forum_auth_const[$l]) {
|
||||
$item_auth_level = $forum_auth_levels[$l];
|
||||
break;
|
||||
|
@ -258,7 +258,7 @@ if (empty($forum_id) && empty($cat_id)) {
|
|||
// first display the current details for all forums
|
||||
// in the category
|
||||
//
|
||||
for ($i = 0; $i < count($forum_auth_fields); $i++) {
|
||||
for ($i = 0, $iMax = count($forum_auth_fields); $i < $iMax; $i++) {
|
||||
$template->assign_block_vars('forum_auth_titles', array(
|
||||
'CELL_TITLE' => $field_names[$forum_auth_fields[$i]],
|
||||
));
|
||||
|
@ -283,7 +283,7 @@ if (empty($forum_id) && empty($cat_id)) {
|
|||
'CAT_URL' => 'admin_forumauth_list.php?' . POST_CAT_URL . '=' . $cat_id)
|
||||
);
|
||||
|
||||
for ($j = 0; $j < count($forum_rows); $j++) {
|
||||
for ($j = 0, $jMax = count($forum_rows); $j < $iMax; $j++) {
|
||||
if ($cat_id == $forum_rows[$j]['cat_id']) {
|
||||
$template->assign_block_vars('cat_row.forum_row', array(
|
||||
'ROW_CLASS' => !($j % 2) ? 'row4' : 'row5',
|
||||
|
@ -291,9 +291,9 @@ if (empty($forum_id) && empty($cat_id)) {
|
|||
'IS_SUBFORUM' => $forum_rows[$j]['forum_parent'],
|
||||
));
|
||||
|
||||
for ($k = 0; $k < count($forum_auth_fields); $k++) {
|
||||
for ($k = 0, $kMax = count($forum_auth_fields); $k < $iMax; $k++) {
|
||||
$item_auth_value = $forum_rows[$j][$forum_auth_fields[$k]];
|
||||
for ($l = 0; $l < count($forum_auth_const); $l++) {
|
||||
for ($l = 0, $lMax = count($forum_auth_const); $l < $iMax; $l++) {
|
||||
if ($item_auth_value == $forum_auth_const[$l]) {
|
||||
$item_auth_level = $forum_auth_levels[$l];
|
||||
break;
|
||||
|
@ -311,10 +311,10 @@ if (empty($forum_id) && empty($cat_id)) {
|
|||
// next generate the information to allow the permissions to be changed
|
||||
// note: we always read from the first forum in the category
|
||||
//
|
||||
for ($j = 0; $j < count($forum_auth_fields); $j++) {
|
||||
for ($j = 0, $jMax = count($forum_auth_fields); $j < $iMax; $j++) {
|
||||
$custom_auth[$j] = '<select name="' . $forum_auth_fields[$j] . '">';
|
||||
|
||||
for ($k = 0; $k < count($forum_auth_levels); $k++) {
|
||||
for ($k = 0, $kMax = count($forum_auth_levels); $k < $iMax; $k++) {
|
||||
$selected = (!empty($forum_rows) && $forum_rows[0][$forum_auth_fields[$j]] == $forum_auth_const[$k]) ? ' selected="selected"' : '';
|
||||
$custom_auth[$j] .= '<option value="' . $forum_auth_const[$k] . '"' . $selected . '>' . $lang['FORUM_' . $forum_auth_levels[$k]] . '</option>';
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) {
|
|||
|
||||
$cur_smilies = DB()->sql_fetchrowset($result);
|
||||
|
||||
for ($i = 0; $i < count($cur_smilies); $i++) {
|
||||
for ($i = 0, $iMax = count($cur_smilies); $i < $iMax; $i++) {
|
||||
$k = $cur_smilies[$i]['code'];
|
||||
$smiles[$k] = 1;
|
||||
}
|
||||
|
@ -91,10 +91,10 @@ if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) {
|
|||
bb_die('Could not read smiley pak file');
|
||||
}
|
||||
|
||||
for ($i = 0; $i < count($fcontents); $i++) {
|
||||
for ($i = 0, $iMax = count($fcontents); $i < $iMax; $i++) {
|
||||
$smile_data = explode($delimeter, trim(addslashes($fcontents[$i])));
|
||||
|
||||
for ($j = 2; $j < count($smile_data); $j++) {
|
||||
for ($j = 2, $jMax = count($smile_data); $j < $iMax; $j++) {
|
||||
// Replace > and < with the proper html_entities for matching
|
||||
$smile_data[$j] = str_replace('<', '<', $smile_data[$j]);
|
||||
$smile_data[$j] = str_replace('>', '>', $smile_data[$j]);
|
||||
|
@ -156,7 +156,7 @@ if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) {
|
|||
$resultset = DB()->sql_fetchrowset($result);
|
||||
|
||||
$smile_pak = '';
|
||||
for ($i = 0; $i < count($resultset); $i++) {
|
||||
for ($i = 0, $iMax = count($resultset); $i < $iMax; $i++) {
|
||||
$smile_pak .= $resultset[$i]['smile_url'] . $delimeter;
|
||||
$smile_pak .= $resultset[$i]['emoticon'] . $delimeter;
|
||||
$smile_pak .= $resultset[$i]['code'] . "\n";
|
||||
|
@ -173,7 +173,7 @@ if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) {
|
|||
bb_die(sprintf($lang['EXPORT_SMILES'], '<a href="admin_smilies.php?export_pack=send">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_SMILEADMIN'], '<a href="admin_smilies.php">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>'));
|
||||
} elseif (isset($_POST['add']) || isset($_GET['add'])) {
|
||||
$filename_list = '';
|
||||
for ($i = 0; $i < count($smiley_images); $i++) {
|
||||
for ($i = 0, $iMax = count($smiley_images); $i < $iMax; $i++) {
|
||||
$filename_list .= '<option value="' . $smiley_images[$i] . '">' . $smiley_images[$i] . '</option>';
|
||||
}
|
||||
|
||||
|
@ -215,7 +215,7 @@ if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) {
|
|||
$smile_data = DB()->sql_fetchrow($result);
|
||||
|
||||
$filename_list = '';
|
||||
for ($i = 0; $i < count($smiley_images); $i++) {
|
||||
for ($i = 0, $iMax = count($smiley_images); $i < $iMax; $i++) {
|
||||
if ($smiley_images[$i] == $smile_data['smile_url']) {
|
||||
$smiley_selected = 'selected="selected"';
|
||||
$smiley_edit_img = $smiley_images[$i];
|
||||
|
@ -314,7 +314,7 @@ if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) {
|
|||
));
|
||||
|
||||
// Loop throuh the rows of smilies setting block vars for the template
|
||||
for ($i = 0; $i < count($smilies); $i++) {
|
||||
for ($i = 0, $iMax = count($smilies); $i < $iMax; $i++) {
|
||||
// Replace htmlentites for < and > with actual character
|
||||
$smilies[$i]['code'] = str_replace('<', '<', $smilies[$i]['code']);
|
||||
$smilies[$i]['code'] = str_replace('>', '>', $smilies[$i]['code']);
|
||||
|
|
|
@ -49,7 +49,7 @@ if (isset($_POST['submit'])) {
|
|||
if (isset($_POST['ban_ip'])) {
|
||||
$ip_list_temp = explode(',', $_POST['ban_ip']);
|
||||
|
||||
for ($i = 0; $i < count($ip_list_temp); $i++) {
|
||||
for ($i = 0, $iMax = count($ip_list_temp); $i < $iMax; $i++) {
|
||||
if (preg_match('/^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})[ ]*\-[ ]*([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/', trim($ip_list_temp[$i]), $ip_range_explode)) {
|
||||
$ip_1_counter = $ip_range_explode[1];
|
||||
$ip_1_end = $ip_range_explode[5];
|
||||
|
@ -100,7 +100,7 @@ if (isset($_POST['submit'])) {
|
|||
} elseif (preg_match('/^([\w\-_]\.?){2,}$/is', trim($ip_list_temp[$i]))) {
|
||||
$ip = gethostbynamel(trim($ip_list_temp[$i]));
|
||||
|
||||
for ($j = 0; $j < count($ip); $j++) {
|
||||
for ($j = 0, $jMax = count($ip); $j < $iMax; $j++) {
|
||||
if (!empty($ip[$j])) {
|
||||
$ip_list[] = encode_ip($ip[$j]);
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ if (isset($_POST['submit'])) {
|
|||
if (isset($_POST['ban_email'])) {
|
||||
$email_list_temp = explode(',', $_POST['ban_email']);
|
||||
|
||||
for ($i = 0; $i < count($email_list_temp); $i++) {
|
||||
for ($i = 0, $iMax = count($email_list_temp); $i < $iMax; $i++) {
|
||||
if (preg_match('/^(([a-z0-9&\'\.\-_\+])|(\*))+@(([a-z0-9\-])|(\*))+\.([a-z0-9\-]+\.)*?[a-z]+$/is', trim($email_list_temp[$i]))) {
|
||||
$email_list[] = trim($email_list_temp[$i]);
|
||||
}
|
||||
|
@ -131,9 +131,9 @@ if (isset($_POST['submit'])) {
|
|||
DB()->sql_freeresult($result);
|
||||
|
||||
$kill_session_sql = '';
|
||||
for ($i = 0; $i < count($user_list); $i++) {
|
||||
for ($i = 0, $iMax = count($user_list); $i < $iMax; $i++) {
|
||||
$in_banlist = false;
|
||||
for ($j = 0; $j < count($current_banlist); $j++) {
|
||||
for ($j = 0, $jMax = count($current_banlist); $j < $iMax; $j++) {
|
||||
if ($user_list[$i] == $current_banlist[$j]['ban_userid']) {
|
||||
$in_banlist = true;
|
||||
}
|
||||
|
@ -149,9 +149,9 @@ if (isset($_POST['submit'])) {
|
|||
}
|
||||
}
|
||||
|
||||
for ($i = 0; $i < count($ip_list); $i++) {
|
||||
for ($i = 0, $iMax = count($ip_list); $i < $iMax; $i++) {
|
||||
$in_banlist = false;
|
||||
for ($j = 0; $j < count($current_banlist); $j++) {
|
||||
for ($j = 0, $jMax = count($current_banlist); $j < $iMax; $j++) {
|
||||
if ($ip_list[$i] == $current_banlist[$j]['ban_ip']) {
|
||||
$in_banlist = true;
|
||||
}
|
||||
|
@ -181,9 +181,9 @@ if (isset($_POST['submit'])) {
|
|||
}
|
||||
}
|
||||
|
||||
for ($i = 0; $i < count($email_list); $i++) {
|
||||
for ($i = 0, $iMax = count($email_list); $i < $iMax; $i++) {
|
||||
$in_banlist = false;
|
||||
for ($j = 0; $j < count($current_banlist); $j++) {
|
||||
for ($j = 0, $jMax = count($current_banlist); $j < $iMax; $j++) {
|
||||
if ($email_list[$i] == $current_banlist[$j]['ban_email']) {
|
||||
$in_banlist = true;
|
||||
}
|
||||
|
@ -202,7 +202,7 @@ if (isset($_POST['submit'])) {
|
|||
if (isset($_POST['unban_user'])) {
|
||||
$user_list = $_POST['unban_user'];
|
||||
|
||||
for ($i = 0; $i < count($user_list); $i++) {
|
||||
for ($i = 0, $iMax = count($user_list); $i < $iMax; $i++) {
|
||||
if ($user_list[$i] != -1) {
|
||||
$where_sql .= (($where_sql != '') ? ', ' : '') . (int)$user_list[$i];
|
||||
}
|
||||
|
@ -212,7 +212,7 @@ if (isset($_POST['submit'])) {
|
|||
if (isset($_POST['unban_ip'])) {
|
||||
$ip_list = $_POST['unban_ip'];
|
||||
|
||||
for ($i = 0; $i < count($ip_list); $i++) {
|
||||
for ($i = 0, $iMax = count($ip_list); $i < $iMax; $i++) {
|
||||
if ($ip_list[$i] != -1) {
|
||||
$where_sql .= (($where_sql != '') ? ', ' : '') . DB()->escape($ip_list[$i]);
|
||||
}
|
||||
|
@ -222,7 +222,7 @@ if (isset($_POST['submit'])) {
|
|||
if (isset($_POST['unban_email'])) {
|
||||
$email_list = $_POST['unban_email'];
|
||||
|
||||
for ($i = 0; $i < count($email_list); $i++) {
|
||||
for ($i = 0, $iMax = count($email_list); $i < $iMax; $i++) {
|
||||
if ($email_list[$i] != -1) {
|
||||
$where_sql .= (($where_sql != '') ? ', ' : '') . DB()->escape($email_list[$i]);
|
||||
}
|
||||
|
@ -260,7 +260,7 @@ if (isset($_POST['submit'])) {
|
|||
DB()->sql_freeresult($result);
|
||||
|
||||
$select_userlist = '';
|
||||
for ($i = 0; $i < count($user_list); $i++) {
|
||||
for ($i = 0, $iMax = count($user_list); $i < $iMax; $i++) {
|
||||
$select_userlist .= '<option value="' . $user_list[$i]['ban_id'] . '">' . $user_list[$i]['username'] . '</option>';
|
||||
$userban_count++;
|
||||
}
|
||||
|
@ -282,7 +282,7 @@ if (isset($_POST['submit'])) {
|
|||
$select_iplist = '';
|
||||
$select_emaillist = '';
|
||||
|
||||
for ($i = 0; $i < count($banlist); $i++) {
|
||||
for ($i = 0, $iMax = count($banlist); $i < $iMax; $i++) {
|
||||
$ban_id = $banlist[$i]['ban_id'];
|
||||
|
||||
if (!empty($banlist[$i]['ban_ip'])) {
|
||||
|
|
|
@ -970,7 +970,7 @@ if (!isset($_REQUEST['dosearch'])) {
|
|||
$banned[$row['user_id']] = true;
|
||||
}
|
||||
|
||||
for ($i = 0; $i < count($rowset); $i++) {
|
||||
for ($i = 0, $iMax = count($rowset); $i < $iMax; $i++) {
|
||||
$row_class = !($i % 2) ? 'row1' : 'row2';
|
||||
|
||||
$template->assign_block_vars('userrow', array(
|
||||
|
|
|
@ -130,7 +130,7 @@ if (isset($_GET['pane']) && $_GET['pane'] == 'left') {
|
|||
$tabledata_ary = DB()->sql_fetchrowset($result);
|
||||
|
||||
$dbsize = 0;
|
||||
for ($i = 0; $i < count($tabledata_ary); $i++) {
|
||||
for ($i = 0, $iMax = count($tabledata_ary); $i < $iMax; $i++) {
|
||||
if (@$tabledata_ary[$i]['Type'] != 'MRG_MYISAM') {
|
||||
$dbsize += $tabledata_ary[$i]['Data_length'] + $tabledata_ary[$i]['Index_length'];
|
||||
}
|
||||
|
@ -192,7 +192,7 @@ if (isset($_GET['pane']) && $_GET['pane'] == 'left') {
|
|||
if (count($onlinerow_reg)) {
|
||||
$registered_users = $hidden_users = 0;
|
||||
|
||||
for ($i = 0, $cnt = count($onlinerow_reg); $i < $cnt; $i++) {
|
||||
for ($i = 0, $iMax = count($onlinerow_reg); $i < $iMax; $i++) {
|
||||
if (!in_array($onlinerow_reg[$i]['user_id'], $reg_userid_ary)) {
|
||||
$reg_userid_ary[] = $onlinerow_reg[$i]['user_id'];
|
||||
|
||||
|
@ -226,7 +226,7 @@ if (isset($_GET['pane']) && $_GET['pane'] == 'left') {
|
|||
if (count($onlinerow_guest)) {
|
||||
$guest_users = 0;
|
||||
|
||||
for ($i = 0; $i < count($onlinerow_guest); $i++) {
|
||||
for ($i = 0, $iMax = count($onlinerow_guest); $i < $iMax; $i++) {
|
||||
$guest_userip_ary[] = $onlinerow_guest[$i]['session_ip'];
|
||||
$guest_users++;
|
||||
|
||||
|
@ -263,7 +263,7 @@ print_page('index.tpl', 'admin');
|
|||
// Functions
|
||||
function inarray($needle, $haystack)
|
||||
{
|
||||
for ($i = 0; $i < count($haystack); $i++) {
|
||||
for ($i = 0, $iMax = count($haystack); $i < $iMax; $i++) {
|
||||
if ($haystack[$i] == $needle) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -103,7 +103,7 @@ function auth_pack($auth_array)
|
|||
$one_char = $two_char = false;
|
||||
$auth_cache = '';
|
||||
|
||||
for ($i = 0; $i < count($auth_array); $i++) {
|
||||
for ($i = 0, $iMax = count($auth_array); $i < $iMax; $i++) {
|
||||
$val = base64_pack((int)$auth_array[$i]);
|
||||
if (strlen($val) == 1 && !$one_char) {
|
||||
$auth_cache .= $one_char_encoding;
|
||||
|
|
|
@ -187,7 +187,7 @@ function delete_attachment($post_id_array = 0, $attach_id_array = 0, $page = 0,
|
|||
}
|
||||
//bt end
|
||||
|
||||
for ($i = 0; $i < count($attach_id_array); $i++) {
|
||||
for ($i = 0, $iMax = count($attach_id_array); $i < $iMax; $i++) {
|
||||
$sql = 'SELECT attach_id
|
||||
FROM ' . BB_ATTACHMENTS . '
|
||||
WHERE attach_id = ' . (int)$attach_id_array[$i];
|
||||
|
|
|
@ -50,7 +50,7 @@ function group_select($select_name, $default_group = 0)
|
|||
$group_name[$num_rows]['group_id'] = 0;
|
||||
$group_name[$num_rows]['group_name'] = $lang['NOT_ASSIGNED'];
|
||||
|
||||
for ($i = 0; $i < count($group_name); $i++) {
|
||||
for ($i = 0, $iMax = count($group_name); $i < $iMax; $i++) {
|
||||
if (!$default_group) {
|
||||
$selected = ($i == 0) ? ' selected="selected"' : '';
|
||||
} else {
|
||||
|
@ -93,7 +93,7 @@ function download_select($select_name, $group_id = 0)
|
|||
|
||||
$group_select = '<select name="' . $select_name . '">';
|
||||
|
||||
for ($i = 0; $i < count($types_download); $i++) {
|
||||
for ($i = 0, $iMax = count($types_download); $i < $iMax; $i++) {
|
||||
if (!$group_id) {
|
||||
$selected = ($types_download[$i] == INLINE_LINK) ? ' selected="selected"' : '';
|
||||
} else {
|
||||
|
@ -138,14 +138,14 @@ function category_select($select_name, $group_id = 0)
|
|||
$types = array(NONE_CAT);
|
||||
$modes = array('none');
|
||||
|
||||
for ($i = 0; $i < count($types_category); $i++) {
|
||||
for ($i = 0, $iMax = count($types_category); $i < $iMax; $i++) {
|
||||
$types[] = $types_category[$i];
|
||||
$modes[] = $modes_category[$i];
|
||||
}
|
||||
|
||||
$group_select = '<select name="' . $select_name . '" style="width:100px">';
|
||||
|
||||
for ($i = 0; $i < count($types); $i++) {
|
||||
for ($i = 0, $iMax = count($types); $i < $iMax; $i++) {
|
||||
if (!$group_id) {
|
||||
$selected = ($types[$i] == NONE_CAT) ? ' selected="selected"' : '';
|
||||
} else {
|
||||
|
@ -172,7 +172,7 @@ function size_select($select_name, $size_compare)
|
|||
|
||||
$select_field = '<select name="' . $select_name . '">';
|
||||
|
||||
for ($i = 0; $i < count($size_types_text); $i++) {
|
||||
for ($i = 0, $iMax = count($size_types_text); $i < $iMax; $i++) {
|
||||
$selected = ($size_compare == $size_types[$i]) ? ' selected="selected"' : '';
|
||||
$select_field .= '<option value="' . $size_types[$i] . '"' . $selected . '>' . $size_types_text[$i] . '</option>';
|
||||
}
|
||||
|
@ -204,7 +204,7 @@ function quota_limit_select($select_name, $default_quota = 0)
|
|||
}
|
||||
DB()->sql_freeresult($result);
|
||||
|
||||
for ($i = 0; $i < count($quota_name); $i++) {
|
||||
for ($i = 0, $iMax = count($quota_name); $i < $iMax; $i++) {
|
||||
$selected = ($quota_name[$i]['quota_limit_id'] == $default_quota) ? ' selected="selected"' : '';
|
||||
$quota_select .= '<option value="' . $quota_name[$i]['quota_limit_id'] . '"' . $selected . '>' . $quota_name[$i]['quota_desc'] . '</option>';
|
||||
}
|
||||
|
@ -235,7 +235,7 @@ function default_quota_limit_select($select_name, $default_quota = 0)
|
|||
}
|
||||
DB()->sql_freeresult($result);
|
||||
|
||||
for ($i = 0; $i < count($quota_name); $i++) {
|
||||
for ($i = 0, $iMax = count($quota_name); $i < $iMax; $i++) {
|
||||
$selected = ($quota_name[$i]['quota_limit_id'] == $default_quota) ? ' selected="selected"' : '';
|
||||
$quota_select .= '<option value="' . $quota_name[$i]['quota_limit_id'] . '"' . $selected . '>' . $quota_name[$i]['quota_desc'] . '</option>';
|
||||
}
|
||||
|
|
|
@ -1790,7 +1790,7 @@ function get_forum_display_sort_option($selected_row = 0, $action = 'list', $lis
|
|||
|
||||
// build list
|
||||
if ($action == 'list') {
|
||||
for ($i = 0; $i < count($listrow['lang_key']); $i++) {
|
||||
for ($i = 0, $iMax = count($listrow['lang_key']); $i < $iMax; $i++) {
|
||||
$selected = ($i == $selected_row) ? ' selected="selected"' : '';
|
||||
$l_value = (isset($lang[$listrow['lang_key'][$i]])) ? $lang[$listrow['lang_key'][$i]] : $listrow['lang_key'][$i];
|
||||
$res .= '<option value="' . $i . '"' . $selected . '>' . $l_value . '</option>';
|
||||
|
|
|
@ -74,7 +74,7 @@ if ($watch_count > 0) {
|
|||
$watch = DB()->sql_fetchrowset($result);
|
||||
|
||||
if ($watch) {
|
||||
for ($i = 0; $i < count($watch); $i++) {
|
||||
for ($i = 0, $iMax = count($watch); $i < $iMax; $i++) {
|
||||
$is_unread = is_unread($watch[$i]['topic_last_post_time'], $watch[$i]['topic_id'], $watch[$i]['forum_id']);
|
||||
|
||||
$template->assign_block_vars('watch', array(
|
||||
|
|
|
@ -64,7 +64,7 @@ $mode_types = array(
|
|||
// <select> mode
|
||||
$select_sort_mode = '<select name="mode">';
|
||||
|
||||
for ($i = 0, $cnt = count($mode_types_text); $i < $cnt; $i++) {
|
||||
for ($i = 0, $iMax = count($mode_types_text); $i < $iMax; $i++) {
|
||||
$selected = ($mode == $mode_types[$i]) ? ' selected="selected"' : '';
|
||||
$select_sort_mode .= '<option value="' . $mode_types[$i] . '"' . $selected . '>' . $mode_types_text[$i] . '</option>';
|
||||
}
|
||||
|
|
|
@ -462,7 +462,7 @@ if ($mode == 'read') {
|
|||
$delete_sql_id = '';
|
||||
|
||||
if (!$delete_all) {
|
||||
for ($i = 0; $i < count($mark_list); $i++) {
|
||||
for ($i = 0, $iMax = count($mark_list); $i < $iMax; $i++) {
|
||||
$delete_sql_id .= (($delete_sql_id != '') ? ', ' : '') . (int)$mark_list[$i];
|
||||
}
|
||||
$delete_sql_id = "AND privmsgs_id IN ($delete_sql_id)";
|
||||
|
@ -504,7 +504,7 @@ if ($mode == 'read') {
|
|||
|
||||
if (count($mark_list)) {
|
||||
$delete_sql_id = '';
|
||||
for ($i = 0; $i < count($mark_list); $i++) {
|
||||
for ($i = 0, $iMax = count($mark_list); $i < $iMax; $i++) {
|
||||
$delete_sql_id .= (($delete_sql_id != '') ? ', ' : '') . (int)$mark_list[$i];
|
||||
}
|
||||
|
||||
|
@ -663,7 +663,7 @@ if ($mode == 'read') {
|
|||
}
|
||||
|
||||
$saved_sql_id = '';
|
||||
for ($i = 0; $i < count($mark_list); $i++) {
|
||||
for ($i = 0, $iMax = count($mark_list); $i < $iMax; $i++) {
|
||||
$saved_sql_id .= (($saved_sql_id != '') ? ', ' : '') . (int)$mark_list[$i];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue