Changeset 24543


Ignore:
Timestamp:
Sep 20, 2013, 12:39:42 AM (7 years ago)
Author:
plg
Message:

much much faster algorithm to extract the list of recently displayed photos (avoid array_merge thousands times)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/whois_online/online.php

    r9147 r24543  
    279279        {
    280280                if ($user['id']==$monit['user_id']) $excl = $monit['elm_ids'];
    281                 else $elm = array_merge($elm, $monit['elm_ids']);
     281                // else $elm = array_merge($elm, $monit['elm_ids']);
     282    else
     283    {
     284      foreach ($monit['elm_ids'] as $id)
     285      {
     286        $elm[$id] = 1;
     287      }
     288    }
    282289                if ($monit['delay'] <= (24*3600)) $h24++;
    283290                if ($monit['delay'] <= 3600) $h1++;
     
    288295                }
    289296        }
     297  $elm = array_keys($elm);
    290298        // The first (and current) access are not recorded in $online
    291299        // As visitor you are not expecting your access to be already counted: Ok that the case
Note: See TracChangeset for help on using the changeset viewer.