Search Workaround and extention

This is a workoraund for the hilight bug in search function in CMSimple XH version 1.7.2.ONLY

Instead of inserting extra tags to highlight search results, keywords are highlighted with javascript.

Now, when I started working with the search function, I also expanded the class Search in file Serch.php in core CMSimple with sorted results list.

Sorted result list has the following order:
1 exact match
2 All keywords are found on the page
3 only some keywords are found on the page

And finally, if search has only one result, the extended version redirects to the actual page with keywords instead of displaying a result page with link to the page. This work fine with javascript highlights as javascript scroll the page to the first hit.

Changes to the core code will of course be overwritten by the next update of CMSimple XH. By that time, I hope that both the bug is corrected and that the development team implements the extension to the search function itself. The development team is of course welcome to use my code.


Followed files are changed:

Installation and configuration

Exctract downloaded file and copy the content to your plugin foder. Open plugin admin and push the button "Modify files cmsimple/tlpfuncs.php and cmsimple/classses/Search.php". You're done. You can change highlights css in plugin stylesheet.css.




This page is powered by
CMSimple plugin: Tooltip and Modalbox © simpleSolutions