I have some heavy users at my site, some of them with more than 1.000 stories.
When seaching using only the userid code (UID), the search class whas giving me error:
Fatal error: Maximum execution time of 30 seconds exceeded
Analysing the file search.class.php, I realized that when the UID is sent, this is not considered in the SQL, overbuffering the system. Then I changed:
line 222/223
ORIGINAL
if ($this->_type == 'all' OR $this->_type == 'stories') {
$sql = "SELECT sid,title,introtext,bodytext,hits,uid,group_id,owner_id,perm_owner,perm_group,perm_members,perm_anon,UNIX_TIMESTAMP(date) as day,'story' as type FROM {$_TABLES['stories']} WHERE (draft_flag = 0) AND (date _checkTopicPermissions ();
REPLACED
if ($this->_type == 'all' OR $this->_type == 'stories') {
// $sql = "SELECT sid,title,introtext,bodytext,hits,uid,group_id,owner_id,perm_owner,perm_group,perm_members,perm_anon,UNIX_TIMESTAMP(date) as day,'story' as type FROM {$_TABLES['stories']} WHERE (draft_flag = 0) AND (date _checkTopicPermissions ();
if (!empty ($_USER['uid'])) {
$sql = "SELECT sid,title,introtext,bodytext,hits,uid,group_id,owner_id,perm_owner,perm_group,perm_members,perm_anon,UNIX_TIMESTAMP(date) as day,'story' as type FROM {$_TABLES['stories']} WHERE (draft_flag = 0) AND (date _author') " . $this->_checkTopicPermissions ();
}
else {
$sql = "SELECT sid,title,introtext,bodytext,hits,uid,group_id,owner_id,perm_owner,perm_group,perm_members,perm_anon,UNIX_TIMESTAMP(date) as day,'story' as type FROM {$_TABLES['stories']} WHERE (draft_flag = 0) AND (date _checkTopicPermissions ();
It passed! But, again, the program started to give me another fatal error. This time, in another class file:
Fatal error: Maximum execution time of 30 seconds exceeded in /home/soaresf/public_html/_geeklog/system/classes/template.class.php on line 499
I searched here in the forum, there is a suggestion for replacing this line. Instead of working, this hacking bring me more than 1000 lines of errors (BUT THERE WAS NOT FATAL ERRORS). I think that we are near the solution... May be this is related with strings with foreign characters... I have other users with more than 1000 stories wichh name HAS NO SPECIAL CHARACTERS and the system works (slowly but with NO FATAL ERRORS).
ORIGINAL
$varvals_quoted[$k] = preg_replace(array('/\\/', '/$/'), array('\\\\', '\\$'), $v);
SUGGESTION THAT IS NOT WORKING WELL
// $varvals_quoted[$k] = preg_replace(array('//', '/$/'), array('\', '$'), $v);
I search google and found 6 pages of links from GEEKLOG sites just giving the same information:
Fatal error: Maximum execution time of 30 seconds exceeded in .../system/classes/template.class.php on line 499
I tried another approach: to limit the number of search result in config.php:
// 0: use users max stories per page
// 1: Show all
// any other number is the # of results per page
$_CONF['max_search_results'] = 25; // era 0, deixei 25
// maximum length for the summary text for search results should be
$_CONF['summary_length'] = 50; // original era 100
No way. The system ever show all histories in a single page. It is very very heavy for users with low band internet and even for the server...
I think that this is an important issue. I reached my incompetence level, I tried a solution... May be somebody could help me.
Thanks a LOT
Notivaga