Quote:
Originally posted by BigJohnson
...Also i am still not getting any error screen. What is wrong witht that?...
|
The error screen only comes, if this sort result (not the search result!!) doesn't give any posts back.
Quote:
Originally posted by BigJohnson
...And also one of my templates is red so that is a problem. Is there any way we can use a replacement variable for this hack? So i can then change the replace ment variable for the HIGHLIGHTED word colors? That owuld be great because every style on my boar dhas its on replacement variable....
|
This is a little more complicated. I have a fast solution here. This also more simply works certainly...
- Make your replacements:
</myhighlight> is replaced by </font></i></b>
<myhighlight is replaced by <b><i><font color="red"
- Search in showthread.php for:
if (isset($highlight) and $highlight!="search") {$src[string]="$highlight";}
- and replace with:
if (isset($highlight)) {$src[string]="$highlight"; $myhighlight=1;}
- Search in admin/functions.php for:
PHP Code:
//highlight words for search engine
if (isset($highlight) && $highlight != '') {
if ((isset($postid) and $postid==$post[postid]) or !isset($postid)) {
reset($replacewords);
while (list($key,$val)=each($replacewords)) {
$post['message']=preg_replace("#(^| |\n|\r|\t|\]|>|\")(".$val.")(([\.,]+[ $\n\r\t])|$|\"|<|\[| |\n|\r|\t)#si", "\\1<highlight>\\2</highlight>\\3", $post['message']);
}
}
}
and replace with:
Code:
global $myhighlight;
//highlight words for search engine
if (isset($highlight) && $highlight != '') {
if ((isset($postid) and $postid==$post[postid]) or !isset($postid)) {
reset($replacewords);
while (list($key,$val)=each($replacewords)) {
if ($myhighlight) {$highl1="<myhighlight>";$highl2="</myhighlight>";} else {$highl1="<highlight>";$highl2="</highlight>";}
$post['message']=preg_replace("/(^| |\n|\r|\t|\]|>|\")(".$val.")(([\.,]+[ $\n\r\t])|$|\"|<|\[| |\n|\r|\t)/si", "\\1$highl1\\2$highl2\\3", $post['message']);
}
}
}
That's all ??!