$limit = "limit 0," . MAX_USER_PP; } ## hmm, this needs more work, as it'll run out of memory, because it's building the entire ## listing before pushing it out. ## would be best to not have a limit, but putting one to avoid that if ($download) { $limit = ' limit 100000'; } if ($id) { $url_keep = '&id=' . $id; } else { $url_keep = ''; } if ($total) { $paging = simplePaging("mviews{$url_keep}", $start, $total, MAX_USER_PP, $GLOBALS['I18N']->get("Entries")); $ls->usePanel($paging); } $req = Sql_Query(sprintf('select userid,email,um.entered as sent,min(um.viewed) as firstview, max(um.viewed) as lastview, count(um.viewed) as viewcount, abs(unix_timestamp(um.entered) - unix_timestamp(um.viewed)) as responsetime from %s um, %s user, %s msg where um.messageid = %d and um.messageid = msg.id and um.userid = user.id and um.status = "sent" and um.viewed is not null %s group by userid %s', $GLOBALS['tables']['usermessage'], $GLOBALS['tables']['user'], $GLOBALS['tables']['message'], $id, $subselect, $limit)); $summary = array(); while ($row = Sql_Fetch_Array($req)) { if ($download) { ## with download, the 50 per page limit is not there. set_time_limit(60); $element = $row['email']; } else { $element = shortenTextDisplay($row['email'], 15); }