I had the same situation as nmshah, and at first I thought I could set the hasSearch parameter to 0.
But after I did that the iSearch module stopped reccording the searches keywords.
I set hasSearch to 1 or 0 few times and updated the module each time to be sure.
So I supposed iSearch records keywords when called from search.php here :
$results =& $module->search($queries, $andor, 5, 0);
I changed it to :
// Here is the only line I added beside the close bracket of course :
if ( $module->getVar('name') != _MI_ISEARCH_NAME ) {
$results =& $module->search($queries, $andor, 5, 0);
echo ""
.$module->getVar('name').""; // => here is what I wanted to remove.
$count = count($results);
if (!is_array($results) || $count == 0) {
echo ""
._SR_NOMATCH.""; // => That too
} else {
for ($i = 0; $i < $count; $i++) {
// => And every echo below too
if (isset($results[$i]['image']) && $results[$i]['image'] != "") {
echo ".$module->getVar('dirname')."/".$results[$i]['image']."' alt='".$module->getVar('name')."' /> ";
} else {
echo ".$module->getVar('name')."' width='26' height='26' /> ";
}
echo ".$module->getVar('dirname')."/".$results[$i]['link']."'>".$myts->makeTboxData4Show($results[$i]['title'])."
n";
echo "";
$results[$i]['uid'] = intval($results[$i]['uid']);
if ( !empty($results[$i]['uid']) ) {
$uname = XoopsUser::getUnameFromId($results[$i]['uid']);
echo " .XOOPS_URL."/userinfo.php?uid=".$results[$i]['uid']."'>".$uname."n";
}
echo $results[$i]['time'] ? " (". formatTimestamp(intval($results[$i]['time'])).")" : "";
echo "
n";
}
if ( $count == 5 ) {
$search_url = XOOPS_URL.'/search.php?query='.urlencode(stripslashes(implode(' ', $queries)));
$search_url .= "&mid=$mid&action=showall&andor=$andor";
echo '
.$search_url.'">'._SR_SHOWALLR.'';
}
}
unset($results);
unset($module);
//here is the close bracket :
}
Then I set hasSearch parameters to 1 and updated the module.
Well, iSearch still records the searches keywords. So I was wrong, iSearch doesn't record keywords when called here.
But now an iSearch part in the search results page is no longer displayed, which was what I wanted.
I don't know what
$results =& $module->search($queries, $andor, 5, 0); does, so I placed the test just after it :
$results =& $module->search($queries, $andor, 5, 0);
if ( $module->getVar('name') != _MI_ISEARCH_NAME ) {
echo ""
.$module->getVar('name').""; // => here is what I wanted to remove.
$count = count($results);
if (!is_array($results) || $count == 0) {
echo ""
._SR_NOMATCH.""; // => That too
} else {
for ($i = 0; $i < $count; $i++) {
// => And every echo below too
if (isset($results[$i]['image']) && $results[$i]['image'] != "") {
echo ".$module->getVar('dirname')."/".$results[$i]['image']."' alt='".$module->getVar('name')."' /> ";
} else {
echo ".$module->getVar('name')."' width='26' height='26' /> ";
}
echo ".$module->getVar('dirname')."/".$results[$i]['link']."'>".$myts->makeTboxData4Show($results[$i]['title'])."
n";
echo "";
$results[$i]['uid'] = intval($results[$i]['uid']);
if ( !empty($results[$i]['uid']) ) {
$uname = XoopsUser::getUnameFromId($results[$i]['uid']);
echo " .XOOPS_URL."/userinfo.php?uid=".$results[$i]['uid']."'>".$uname."n";
}
echo $results[$i]['time'] ? " (". formatTimestamp(intval($results[$i]['time'])).")" : "";
echo "
n";
}
if ( $count == 5 ) {
$search_url = XOOPS_URL.'/search.php?query='.urlencode(stripslashes(implode(' ', $queries)));
$search_url .= "&mid=$mid&action=showall&andor=$andor";
echo '
.$search_url.'">'._SR_SHOWALLR.'';
}
}
unset($results);
unset($module);
}
I don't like the way I changed search.php code, if anyone sees a better method I would appreciate :)
I did worse then : I wanted to remove the iSearch checkbox in advanced search form ("Search in" list).
Couldn't find something else, so in the class/xoopsform/formcheckbox.php :
foreach ( $this->getOptions() as $value => $name ) {
if ( $name != _MI_ISEARCH_NAME ) {
$ret .= ".$this->getName()."' value='".$value."'";
if (count($this->getValue()) > 0 && in_array($value, $this->getValue())) {
$ret .= " checked='checked'";
}
$ret .= $this->getExtra()." />".$name."n";
}
}
return $ret;
I am still looking to find where iSearch is called, where the code which records the keywords searched is.