Commit baf44c4e by Scott

Reduce calls to qa_get_one_user_html

parent c1e7ddfd
...@@ -116,11 +116,15 @@ ...@@ -116,11 +116,15 @@
$favoritemap = qa_get_favorite_non_qs_map(); $favoritemap = qa_get_favorite_non_qs_map();
foreach ($useridhandles as $useridhandle) { foreach ($useridhandles as $useridhandle) {
if (isset($useridhandle['userid']) && $useridhandle['handle']) { // only add each user to the array once
$usershtml[$useridhandle['userid']] = qa_get_one_user_html($useridhandle['handle'], $microdata, @$favoritemap['user'][$useridhandle['userid']]); $uid = isset($useridhandle['userid']) ? $useridhandle['userid'] : null;
if ($uid && $useridhandle['handle'] && !isset($usershtml[$uid])) {
$usershtml[$uid] = qa_get_one_user_html($useridhandle['handle'], $microdata, @$favoritemap['user'][$uid]);
} }
if (isset($useridhandle['lastuserid']) && $useridhandle['lasthandle']) {
$usershtml[$useridhandle['lastuserid']] = qa_get_one_user_html($useridhandle['lasthandle'], $microdata, @$favoritemap['user'][$useridhandle['lastuserid']]); $luid = isset($useridhandle['lastuserid']) ? $useridhandle['lastuserid'] : null;
if ($luid && $useridhandle['lasthandle'] && !isset($usershtml[$luid])) {
$usershtml[$luid] = qa_get_one_user_html($useridhandle['lasthandle'], $microdata, @$favoritemap['user'][$luid]);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment