- Posts: 8
- Thank you received: 0
Kunena 6.0.8 Released (17 Jan 2023)
The Kunena team has announce the arrival of Kunena 6.0.8 [K 6.0.8] which is now available for download as a native Joomla extension for J! 4.2.x. This version addresses most of the issues that were discovered in K 6.0 and issues discovered during the development stages of K 6.0.
Solved Search: fix highlight search results #3090
7 years 6 months ago - 7 years 6 months ago #1
by Cristiand
Search: fix highlight search results #3090 was created by Cristiand
Hello,
github.com/Kunena/Kunena-Forum/issues/3090
Highlight search results.
I assume this highlights the words you were looking for on the search result list. Is this correct?
Seems disabled in version 403, what is broken about it? Any information on when it will be fixed or what is the state of it?
github.com/Kunena/Kunena-Forum/issues/3090
Highlight search results.
I assume this highlights the words you were looking for on the search result list. Is this correct?
Seems disabled in version 403, what is broken about it? Any information on when it will be fixed or what is the state of it?
Last edit: 7 years 6 months ago by Cristiand.
Please Log in or Create an account to join the conversation.
7 years 6 months ago #2
by 810
Replied by 810 on topic Search: fix highlight search results #3090
its disabled since K1.6 but is still broken. Its on todo list
see: github.com/Kunena/Kunena-Forum/pull/3120
see: github.com/Kunena/Kunena-Forum/pull/3120
The following user(s) said Thank You: Cristiand
Please Log in or Create an account to join the conversation.
7 years 6 months ago #3
by Cristiand
Replied by Cristiand on topic Search: fix highlight search results #3090
in /components/com_kunena/views/search/view.html.php lines ~160
Went with:
Seems to do the job fine and doesn't interfere with urls.
Went with:
Code:
$ressubject = preg_replace( "/(". $searchword .")(?=[^>]*(<|$))" . "/iu", '<span class="searchword" >' . $searchword . '</span>', $ressubject);
$resmessage = preg_replace ( "/(". $searchword .")(?=[^>]*(<|$))" . "/iu", '<span class="searchword" >' . $searchword . '</span>', $resmessage );
Seems to do the job fine and doesn't interfere with urls.
Please Log in or Create an account to join the conversation.
7 years 6 months ago #4
by 810
Replied by 810 on topic Search: fix highlight search results #3090
it will break when find a searchword in an image name, then the html will break
Please Log in or Create an account to join the conversation.
7 years 6 months ago #5
by Cristiand
Replied by Cristiand on topic Search: fix highlight search results #3090
Understandable, but the solution works for us, something that looks like this:
<img src="joomla/joomla.jpg" alt="joomla">
has this markup:
<div class="kmsgtext resultmsg">
<img src="<span class="searchword">joomla</span>/<span class="searchword">joomla</span>.jpg" alt="<span class="searchword">joomla</span>"> </div>
<img src="joomla/joomla.jpg" alt="joomla">
has this markup:
<div class="kmsgtext resultmsg">
<img src="<span class="searchword">joomla</span>/<span class="searchword">joomla</span>.jpg" alt="<span class="searchword">joomla</span>"> </div>
Please Log in or Create an account to join the conversation.
7 years 6 months ago #6
by 810
Replied by 810 on topic Search: fix highlight search results #3090
yes, then you see the html not the image itself
Please Log in or Create an account to join the conversation.
Time to create page: 0.251 seconds