Search results blank...sometimes?? [message #163240] |
Tue, 12 October 2010 14:44 |
tw_nick
Messages: 57 Registered: October 2010 Location: Dallas, TX
Karma: 0
|
Member |
|
|
Ok, so just installed FUD and love it. However, after setting up all of my categories and forums, getting an initial few users created, and generating the first few posts, there's a problem.
On SOME searches, the result is a blank page -- no errors on screen or in the activity or error logs. They seem to be tied to one of two select messages in the forums though.
For example:
I search (all forums or just an individual one) for "back office" or just "office" -- a term only contained in a single message in a single forum. Also, I've tried to search entire message or just titles, and both yield same result: an empty browser. And I mean empty! Here's the source code from the results page:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8"></HEAD>
<BODY></BODY></HTML>
Yet, if I search on a term NOT found in one of these troublesome posts, such as "IPv6", I get a proper forum result output.
What gives?? Thanks in advance.
--Nick
|
|
|
|
|
|
|
|
Re: Search results blank...sometimes?? [message #163267 is a reply to message #163266] |
Wed, 13 October 2010 14:39 |
Ernesto
Messages: 413 Registered: August 2005
Karma: 0
|
Senior Member |
|
|
That sounds like it could be your problem hehe
That is strange though, mb_substr is a builtin PHP function (http://php.net/manual/en/function.mb-substr.php)
Could you perhaps grab some of the code from your compiled search.php - should be located in WWW_ROOT/theme/THEMENAME/search.php - Search for mb_substr - It should look something like this:
/* Remove stuff in quotes */
while (preg_match('!<cite>(.*?)</cite><blockquote>(.*?)</blockquote>!is', $body)) {
$body = preg_replace('!<cite>(.*?)</cite><blockquote>(.*?)</blockquote>!is', '', $body);
}
$body = strip_tags($body);
if (strlen($body) > $GLOBALS['MNAV_MAX_LEN']) {
$body = mb_substr($body, 0, $GLOBALS['MNAV_MAX_LEN']) . '...';
}
return $body;
}
The piece of code its complaining about is located in search_forum_sel.inc.t
Ginnunga Gaming
[Updated on: Wed, 13 October 2010 14:39] Report message to a moderator
|
|
|
|
Re: Search results blank...sometimes?? [message #163269 is a reply to message #163268] |
Wed, 13 October 2010 15:06 |
tw_nick
Messages: 57 Registered: October 2010 Location: Dallas, TX
Karma: 0
|
Member |
|
|
Here's what's in the file:
function trim_body($body)
{
/* remove stuff in old bad quote tags - remove in future release */
while (($p = strpos($body, '<table border="0" align="center" width="90%" cellpadding="3" cellspacing="1"><tr><td class="SmallText"><b>')) !== false) {
if (($pos = strpos($body, '<br></td></tr></table>', $p)) === false) {
$pos = strpos($body, '<br /></td></tr></table>', $p);
if ($pos === false) {
break;
}
$e = $pos + strlen('<br /></td></tr></table>');
} else {
$e = $pos + strlen('<br></td></tr></table>');
}
$body = substr($body, 0, $p) . substr($body, $e);
}
/* Remove stuff in quotes */
while (preg_match('!<cite>(.*?)</cite><blockquote>(.*?)</blockquote>!is', $body)) {
$body = preg_replace('!<cite>(.*?)</cite><blockquote>(.*?)</blockquote>!is', '', $body);
}
$body = strip_tags($body);
if (strlen($body) > $GLOBALS['MNAV_MAX_LEN']) {
$body = mb_substr($body, 0, $GLOBALS['MNAV_MAX_LEN']) . '...';
}
return $body;
}
|
|
|
|
|
|
|
|
Re: Search results blank...sometimes?? [message #163276 is a reply to message #163273] |
Wed, 13 October 2010 17:59 |
tw_nick
Messages: 57 Registered: October 2010 Location: Dallas, TX
Karma: 0
|
Member |
|
|
FIXED! Thanks for the quick help, folks. I've applied the patch, and it appears to have addressed the issue. However, I will be loading the mb_substr package during my next server maintenance window. I really appreciate the coaching from both of you.
naudefj, I owe you a dinner at Spur!
(ernesto, sorry -- I haven't been to Sweden, so I can't reference any local restuarant chains...)
[Updated on: Wed, 13 October 2010 18:01] Report message to a moderator
|
|
|