70
Quote:
I haven't had a chance to see if I can make the hall of fame use less memory as it is a core function I am using, but will not forget you
Is this the core function you talk about?
$result = $xoopsDB->query("SELECT ratinguser, count(*) as reviews FROM ".$xoopsDB->prefix("myReviews_votedata")." GROUP BY ratinguser ORDER BY reviews DESC",$limit,0);
[...]
$foundusers =& $member_handler->getUsers($result, true);
If so, then I don't think you have fully understood its use.
$member_handler->getUsers takes a Criteria element and a boolean. An SQL resultset is not a Criteria element and the parameter will be ignored if not of the Criteria Class (or subclass)
As far as I can see, this means that you are effectively running an SQL query, which is not used and load in ALL users with the $member_handler->getUsers() call, hence giving memory problems when the number of users gets too high.
You should use the resultset from your query to put the user ID's in a comma-separated string starting and ending with brackets (so it's like this: "($id1, $id2, $id3)" )
Then send them as a Criteria to get the relevant users.
Like this:
$criteria = new Criteria('uid', $user_array, 'IN');
$foundusers =& $member_handler->getUsers($criteria, true);
Try it out and see if it helps.