PhpDig.net

PhpDig.net (http://www.phpdig.net/forum/index.php)
-   How-to Forum (http://www.phpdig.net/forum/forumdisplay.php?f=33)
-   -   Bold Search Terms (http://www.phpdig.net/forum/showthread.php?t=1537)

phirschybar 11-19-2004 09:26 AM

Bold Search Terms
 
Great search script!!!

How can I get the search terms that the user entered to appear as bold words in the search results? Right now, all of the text comes up normal so it is hard to determine how their search terms relate to the context of the results.

Thanks

Ben

vinyl-junkie 11-19-2004 04:48 PM

In config.php, find the following code:
Code:

define('HIGHLIGHT_BACKGROUND','#FFBB00');        //Highlighting background color
                                                //Only for classic mode
define('HIGHLIGHT_COLOR','#000000');            //Highlighting text color
                                                //Only for classic mode

Play around with that to see what suits your fancy.

phirschybar 11-20-2004 08:06 AM

hmmm... doesn't seem to be working.. or maybe I'm not using classic mode... what is classic mode?

Thanks

Ben

vinyl-junkie 11-20-2004 08:47 AM

First of all, read section 10 of the phpdig documentation. (You should read all of the documentation anyway. RTFM* applies here ;)). Classic mode is all the premade templates that you can view in the phpdig demo.



* Someone is bound to ask. RTFM = read the manual. There are variations on the "F" - some of which are vulgar. No need to elaborate on that.

phirschybar 11-20-2004 11:35 AM

RTFM.. I like that. Sorry I didn't read it thoroughly... thanks for your reply though!!

So, for my situation, I can't use the Classic mode, I need to be able to modify the display. Got any hacks up your sleeve to get the text highlighting capabilities to work with a template?

Thanks in advance.

Ben

vinyl-junkie 11-20-2004 12:28 PM

That is governed by the stylesheet for your search page. For example, here is how it's defined in the template bluegrey.html:
Code:

.phpdigHighlight {
color: white; background-color: #220044; font-weight: bold;
}

Just add that to your own stylesheet, and change its properties to however you want it to look for your own highlighting.

Hope this helps. :)

phirschybar 11-21-2004 08:09 AM

beautiful.. I see the phpdigHighlight span class in the results. Thanks!!!


All times are GMT -8. The time now is 05:35 AM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.