1
solidsnake
How to highlight search keywords in pages?
  • 2004/5/28 5:17

  • solidsnake

  • Just popping in

  • Posts: 33

  • Since: 2004/5/16


Hi, does anyone know how to highlight keywords used in search box? For example, I searched for "language", i want all resulting pages to highlight "language"-currently my search doesn't do that.

thanks everyone!

2
bitkisel
Re: How to highlight search keywords in pages?
  • 2006/7/15 14:34

  • bitkisel

  • Just popping in

  • Posts: 13

  • Since: 2006/7/4 1


can't anyone change this in search.php ???

3
bitkisel
Re: How to highlight search keywords in pages?
  • 2006/7/15 21:12

  • bitkisel

  • Just popping in

  • Posts: 13

  • Since: 2006/7/4 1


can't anybody make that?

Where is the module developers[size=xx-large]????[/size]

4
christian
Re: How to highlight search keywords in pages?
  • 2006/7/15 21:15

  • christian

  • Just can't stay away

  • Posts: 401

  • Since: 2002/2/24


The news and smartsection modules have this function.
Look in general setting for this modules.

5
bitkisel
Re: How to highlight search keywords in pages?
  • 2006/7/16 11:37

  • bitkisel

  • Just popping in

  • Posts: 13

  • Since: 2006/7/4 1


I need to see that function on search.


I looked smartsection module. on which page have this function? I can't found. :(

6
bitkisel
Re: How to highlight search keywords in pages?
  • 2006/7/18 20:56

  • bitkisel

  • Just popping in

  • Posts: 13

  • Since: 2006/7/4 1


function mylinks_search($queryarray$andor$limit$offset$userid){
    global 
$xoopsDB;
    
$sql "SELECT l.lid,l.cid,l.title,l.submitter,l.date,t.description FROM ".$xoopsDB->prefix("mylinks_links")." l LEFT JOIN ".$xoopsDB->prefix("mylinks_text")." t ON t.lid=l.lid WHERE status>0";
    if ( 
$userid != ) {
        
$sql .= " AND l.submitter=".$userid." ";
    }
    
// because count() returns 1 even if a supplied variable
    // is not an array, we must check if $querryarray is really an array
    
if ( is_array($queryarray) && $count count($queryarray) ) {
        
$sql .= " AND ((l.title LIKE '%$queryarray[0]%' OR description LIKE '%$queryarray[0]%' OR submitter LIKE '%$queryarray[0]%')";
        for(
$i=1;$i<$count;$i++){
            
$sql .= $andor ";
            
$sql .= "(title LIKE '%$queryarray[$i]%' OR description LIKE '%$queryarray[$i]%' OR submitter LIKE '%$queryarray[$i]%')";
        }
        
$sql .= ") ";
    }
    
$sql .= "ORDER BY l.date DESC";
ob_start();
    
$result $xoopsDB->query($sql,$limit,$offset);
    
$ret = array();
    
$i 0;
     while(
$myrow $xoopsDB->fetchArray($result)){
        
$ret[$i]['image'] = "images/home.gif";
        
$ret[$i]['link'] = "singlelink.php?cid=".$myrow['cid']."&lid=".$myrow['lid']."";
        
$ret[$i]['title'] = $myrow['title'];
        
$ret[$i]['lid'] = $myrow['lid'];
        
$ret[$i]['time'] = $myrow['date'];
        
$ret[$i]['uid'] = $myrow['submitter'];
        
$i++;

    }
    
            
$out1 ob_get_contents();
ob_end_clean();


$renkdegistir "red">".$i."";

echo 
str_replace ($i,$renkdegistir,$out1); 

    return 
$ret;
}





i made these changes in modules/mylinks/include/search.inc.php

but query has't worked on as red.

where is my mistake??

7
bitkisel
Re: How to highlight search keywords in pages?
  • 2006/7/24 16:58

  • bitkisel

  • Just popping in

  • Posts: 13

  • Since: 2006/7/4 1


help please :(

Login

Who's Online

311 user(s) are online (285 user(s) are browsing Support Forums)


Members: 1


Guests: 310


Harald0123,

more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits