Ok, I found something potentially very wasteful...
In page_header.php (which, incedentally is called on EVERY page), there is some code to work out who has visited in the last 24 hours. There is also an option to display who has NOT visited in that time. However, even with that option disabled, a query is still executed on every non-visiting user - I.e., 1 sql query for every user in the database! On Mary's site, that is about 850 members.
I have made a slight alteration so that the non-visitors are not processed if this option is disabled. That reduced the query count by about 700 (will vary on a day to day basis depending on the amount of visitors).
The forum page now loads like a bullet - However, the portal page is still somewhat slow, although I can't seem to reproduce the 60+ secs load times.
So, the fix to reduce that count... (I have already done this on your live site Mary)
includes/page_header.php
Find:
// ############ Edit below ############
// #
$display_not_day_userlist = 0; // change to 1 here if you also want the list of the users who didn't visit to be displayed
$users_list_delay = 24; // change here to the number of hours wanted for the list
// #
// ############ Edit above ############
$sql = "SELECT user_id, username, user_allow_viewonline, user_level, user_session_time
FROM ".USERS_TABLE."
WHERE user_id > 0
ORDER BY IF(user_level=1,3,user_level) DESC, username ASC";
Replace with:
// ############ Edit below ############
$display_not_day_userlist = 0; // change to 1 here if you also want the list of the users who didn't visit to be displayed
$users_list_delay = 24; // change here to the number of hours wanted for the list
$time_min = time() - ($users_list_delay * 3600);
// ############ Edit above ############
$sql = "SELECT user_id, username, user_allow_viewonline, user_level, user_session_time
FROM ".USERS_TABLE."
WHERE user_id > 0 "
. ($display_not_day_userlist ? '' : ("AND user_session_time >= " . $time_min)) .
" ORDER BY IF(user_level=1,3,user_level) DESC, username ASC";
So now I'm off to try to find what is still causing slow-motion on the portal page.
Hopefully be back soon with some good results <img>
Stu