PDA

View Full Version : [fixed] FAQ search engine highlighting


Chen
Sat 30th Nov '02, 4:14pm
http://www.vbulletin.com/forum/faq.php?s=&do=search&q=username&match=all&titleson ly=0 (http://www.vbulletin.com/forum/faq.php?s=&do=search&q=username&match=all&titleson ly=0)
It doesn't highlight "username" in "...under my username?" because of the question mark.

In faq.php, this:
$find[] = "/ ($word) /i";
$replacetitle[] = " <u>\\\\1</u> ";
$replacetext[] = " <span class=\\\"highlight\\\">\\\\1</span> ";
Needs to be:
$find[] = "/(\\\W)($word)(\\\W)/i";
$replacetitle[] = '$1<u>$2</u>$3';
$replacetext[] = '$1<span class="highlight">$2</span>$3';

Kier
Mon 6th Jan '03, 8:52pm
Originally posted by Chen
http://www.vbulletin.com/forum/faq.php?s=&amp;do=search&amp;q=username&amp;match=all&amp;titleson ly=0 (http://www.vbulletin.com/forum/faq.php?s=&amp;do=search&amp;q=username&amp;match=all&amp;titleson ly=0)
It doesn't highlight "username" in "...under my username?" because of the question mark.

In faq.php, this:
$find[] = "/ ($word) /i";
$replacetitle[] = " <u>\\\\1</u> ";
$replacetext[] = " <span class=\\\"highlight\\\">\\\\1</span> ";
Needs to be:
$find[] = "/(\\\W)($word)(\\\W)/i";
$replacetitle[] = '$1<u>$2</u>$3';
$replacetext[] = '$1<span class="highlight">$2</span>$3'; fixed