Hi,
The shoutbox have problems with many users, I have +60.000 users in my site and when the shoutbox is enable my site have a page execution time of 65045.57 ms, when is disable, the page execution time is 4015.96 ms.
I found the problem in the file shoutbox.module, function theme_shoutbox_post, in this instruction.
if ($shout->uid > 0) {
$user = user_load(array("uid" => $shout->uid));
$shout->username = $user->name;
}
else {
$shout->username = 'an anonymous user';
}
My shoutbox is configured to show 20 post, but in the execution, the module call this function 2 times by post, then the execution is 40 times.
In each call, the function user_load is executed scaning all my users to get a username, this proccess is very slow.
The varibale $shout->username is used to show the real username in the post, but for me is not critical, for that reason I change the username to the nick stored in the shoutbox table.
I make this to fix it.
1. Delete the sentence
2. Change the instruction in the line 354.
$title = 'Posted '. format_date($shout->created, 'custom', 'm/d/y') .' at '. format_date($shout->created, 'custom', 'h:ia') .' by '. $shout->username;
to
$title = 'Posted '. format_date($shout->created, 'custom', 'm/d/y') .' at '. format_date($shout->created, 'custom', 'h:ia') .' by '. $shout->nick;
PD: Excuse my English.
Comments
Comment #1
duaelfrThis version of Shoutbox is not supported anymore. The issue is closed for this reason.
Please upgrade to a supported version and feel free to reopen the issue on the new version if applicable.
This issue has been automagically closed by a script.