mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 13:54:02 -07:00
Change for with count.
This commit is contained in:
parent
32ca1d66fc
commit
56540c893a
16 changed files with 73 additions and 73 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue