Recherche personnalisé wflinks | Titre du sujet : Recherche personnalisé wflinks par defim sur 07/01/2010 18:42:20
Bonjour,
Je suis entrain de suivre la documentation : https://www.frxoops.org/modules/smarts ... ds=include/search.inc.php
Mais celà ne me donne pas le résultat souhaiter , je dois faire une erreur quelques part , mais je ne vois pas ou pour l'instant ...
Je souhaite faire une recherche dans la table wflinks_cat et non dans wflinks_links
Voici mon code modifié
function wflinks_search( $queryarray, $andor, $limit, $offset, $userid ) {
global $xoopsDB, $xoopsUser;
$sql = "SELECT cid, pid, title, description FROM " . $xoopsDB -> prefix( 'wflinks_cat' );
// 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 ((title LIKE LOWER('%$queryarray[0]%') OR LOWER(description) LIKE LOWER('%$queryarray[0]%'))";
for( $i = 1;$i < $count;$i++ ) {
$sql .= " $andor ";
$sql .= "(title LIKE LOWER('%$queryarray[$i]%') OR LOWER(description) LIKE LOWER('%$queryarray[$i]%'))";
}
$sql .= ") ";
}
$sql .= "ORDER BY title ASC";
$result = $xoopsDB -> query( $sql, $limit, $offset );
$ret = array();
$i = 0;
while ( $myrow = $xoopsDB -> fetchArray( $result ) ) {
// if ( false == checkSearchgroups( $myrow['cid'] ) ) {
// continue;
// }
$ret[$i]['image'] = "images/size2.gif";
$ret[$i]['link'] = "viewcat?cid=" . $myrow['cid'] . "&pid=" . $myrow['pid'];
$ret[$i]['title'] = $myrow['title'];
$i++;
}
unset( $_search_check_array );
return $ret;
}
|
|