View Single Post
  #3  
Old 05-29-2004, 04:59 PM
 
longhorn180 longhorn180 is offline
 

Senior Member
  
Join Date: Apr 2004
Location: Richmond, Virginia
Posts: 187
 

Default

Here's the code from the template for the search boxes.


Code:
<TABLE align=center border=0 cellPadding=0 cellSpacing=0 width="100%"> {$lng.lbl_books} <tr> <tr> </tr> <td colspan=2></td> </tr> <form method="get" action="../customer/search.php" name=productsearchform> <tr> <td valign="middle" width=250> <input type="text" name="substring" size="16" value="{$smarty.get.substring|escape}"> </td> </tr> <tr> <td>{$lng.lbl_author}</td> </tr> </form> </TABLE> <TABLE align=center border=0 cellPadding=0 cellSpacing=0 width="100%"> <tr> <tr> </tr> <td colspan=2></td> </tr> <form method="get" action="../customer/search.php" name=productsearchform> <tr> <td valign="middle" width=250> <input type="text" name="substring" size="16" value="{$smarty.get.substring|escape}"> </td> </tr> <tr> <td>{$lng.lbl_title}</td> </tr> </form> </TABLE> <TABLE align=center border=0 cellPadding=0 cellSpacing=0 width="100%"> <tr> <tr> </tr> <td colspan=2></td> </tr> <form method="get" action="../customer/search.php" name=productsearchform> <tr> <td valign="middle" width=250> <input type="text" name="substring" size="16" value="{$smarty.get.substring|escape}"> </td> </tr> <tr> <td>{$lng.lbl_isbn}</td> </tr> </form> </TABLE> <TABLE align=center border=0 cellPadding=0 cellSpacing=0 width="100%"> <tr> <tr> </tr> <td colspan=2></td> </tr> <form method="get" action="../customer/search.php" name=productsearchform> <tr> <td valign="middle" width=250> <input type="text" name="substring" size="16" value="{$smarty.get.substring|escape}"> {include file="buttons/search_head.tpl"}</td> </tr> <tr> <td>{$lng.lbl_subject} {$lng.lbl_advanced_search} </td> </tr> </form> </TABLE>


And here's the code from the search.php file (that I got from another thread) for the different search fields:


Code:
// LOOK HERE // new bit to split search string into separate words $con = ""; $substr = ""; $and="AND"; if(!empty($substring)){ $ss = split(" ",$substring); foreach($ss as $s) // nfc - we add support for other fields to search $con[] = "(".$sql_tbl[products].".param08 like '%".$s."%'"." OR ". $sql_tbl[products].".param04 like '%".$s."%'"." OR ". $sql_tbl[products].".product like '%".$s."%'"." OR ". $sql_tbl[products].".param06 like '%".$s."%'"." OR ". $sql_tbl[products].".param00 like '%".$s."%'".")"; //$substr .= "&substring=".urlencode($substring); } if(empty($and))$and = "OR"; $substring_query = (!empty($con)) ? " AND (".join(" ".$and." ",$con).") " :" "; //deleted 1 // end of new bit
Reply With Quote