how to highlight the search keyword
for example if i search the word "Prince" then it shouls highlight with color
Update:
i tried this mod:
http://custom.simplemachines.org/mods/index.php?mod=1259
but it change the background of that word.
i want to change the color of search keyword and makes it bold
please reply me
its second day without any reply
Hello there.
You didnt specify what version of smf are you using?
I belive that you can manage what you need with mod that you tried with a bit of changes in Sources/Search.php, but the best would be to ask in mods support topic about that:
http://www.simplemachines.org/community/index.php?topic=244847.0
Regards.
Hey, yogesh. Not sure what you're asking. Do you want to highlight the keyword in the Search input field?
I am using 1.1.13 version.
I want to change the color of search keyword and make it bold.
In index.template.php -
Find this:
<input type="text" name="search" value="" style="width: 190px;" />
Change it to this:
<input type="text" name="search" value="" style="width: 190px; color:red; font-weight:bold;" />
nothing happened
update:
hey its change the color of the word which we want to search
I want to change the color of search keyword in the post.
I am poor in english.
update:
Just like this website. search "search" on this topic.
you will get what i wanted to say
OK, I understand what you want. It appears to be a standard feature of 2.0, but not 1.1.13. Not a simple edit. I may be able to modify the code of the mod you tried in your first post. I'll have a look soon as I get some time.
Didn't try this (don't like to install mods), but looks simple enough.
Reinstall the Highlight Search Keywords mod.
In /Sources/Subs.php -
Find this:
// Do the Highlight
$message = preg_replace('/((<[^>]*)|' . preg_quote(strtr($word, array('\'' => ''')), '/') . ')/ie' . ($context['utf8'] ? 'u' : ''), "'\$2' == '\$1' ? stripslashes('\$1') : '<span style=\"background-color:".$color.";font-weight:bold;\">\$1</span>'", $message);
Change it to this:
// Do the Highlight
$message = preg_replace('/((<[^>]*)|' . preg_quote(strtr($word, array('\'' => ''')), '/') . ')/ie' . ($context['utf8'] ? 'u' : ''), "'\$2' == '\$1' ? stripslashes('\$1') : '<span style=\"color:".$color.";font-weight:bold;\">\$1</span>'", $message);
It should change the font color instead of the background, and make it bold, and create an admin option to set the color.
Let me know if it works.
ok. i didn't find the text which is to be replaced
please help me
You have to reinstall the mod first - the // Do the Highlight code is added to Subs.php by the mod, it's not in the original file.
In actual i tried the mod on my another website (just for testing)
On my website when i apply the mod:
http://custom.simplemachines.org/mods/index.php?mod=1259HighlightSearchKeywords_v1.23.tar.gzi am getting this error (look 4th point)
nstalling this package will perform the following actions:
Type Action Description
1. Execute Modification ./Sources/Display.php Test successful
2. Execute Modification ./Sources/Subs.php Test successful
3. Execute Modification ./Sources/Search.php Test successful
4. Execute Modification ./Themes/default/Search.template.php [color=red]Test failed[/color]
5. Execute Modification ./Sources/ManageSearch.php Test successful
6. Execute Modification ./Themes/default/languages/Modifications.english.php Test successful
7. Execute Modification ./Themes/default/languages/Modifications.english-utf8.php Test successfuland when i tried
HightlightSearchKeywords_1.24.tar.gzi am getting this error
LainaaThe package you tried to upload either is not a valid package or has become corrupted.
please reply me
Thought you had installed that mod successfully. Make sure it's uninstalled, and we'll try Plan B.
In style.css -
Find this:
/* Highlighted text - such as search results. */
.highlight
{
background-color: yellow;
font-weight: bold;
color: black;
}
Change it to this:
/* Highlighted text - such as search results. */
.highlight
{
font-weight: bold;
color: red;
}
when i search a keyword.
its not showing effect.
in fact it just open the topic page simply.
without any search.
please register on my website and see.
website: www.downloadyourworld.com
Just took a quick look at your site - no idea what it's doing. The style.css edit works fine on my 1.1.13 install. Did you uninstall the Highlight mod? Any other mods installed? What changes have you made to Search?
ok. take a look at this topic.
http://www.simplemachines.org/community/index.php?topic=433929.msg3043408#msg3043408
I changes the search by this.
IIRC, you wanted Search to just display the topic, and that's what it's doing. Can you attach your Search.template.php?
1.1.13 Search does not highlight anything in the topic subject line, only in the post description and post text, which you've eliminated with the earlier mod. If you do some searches on your forum, you'll see that the search term is not always in the subject line, but rather in the post, which you're not showing, so there's nothing to highlight. Can't have it both ways.
Here, look at this -
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.thekrashsite.com%2Fpics%2Fsearchss1.jpg&hash=0ddd1cd4896ab5167a0c712d10ab3e6f9d625612)
The previous mod eliminated the two lines with highlighted text, which are the post title and the post itself. The topic subject line (circled in red) is not highlighted, and in many searches will not contain the keywords, so there's nothing to highlight. Try searching 'Games' on your forum - you'll get a lot of topics that don't contain 'Games' in the subject, because Search found it in the posts, which are not displayed.
I want to remove the screenshots from search page.
But when member open search result topic the search keyword should be red and bold.
just like vbulletin.
Haven't been on a vB board for a while, and don't remember how their search works. One of the coding boards I sometimes visit highlights all the matching keywords in the entire thread - it's hugely annoying.
This may do what you want -
http://www.simplemachines.org/community/index.php?topic=215214.0;all
Looks like you should reinstall the original 1.1.13 Search.template.php before you try installing the mod.
please see the attachment and thats i want
You've lost me on this one. Where is that screenshot from?
I need another SMF member to solve the problem. please somebody solve my problem
please reply me. i want the same search cusomisation
is there no solution?