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 :
le="color: #000000"><?php $results =& $module->search($queries, $andor, 5, 0);
I changed it to :
le="color: #000000"><?php // 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 "<h4>".$module->getVar('name')."</h4>"; // => here is what I wanted to remove. $count = count($results); if (!is_array($results) || $count == 0) { echo "<p>"._SR_NOMATCH."</p>"; // => That too } else { for ($i = 0; $i < $count; $i++) { // => And every echo below too if (isset($results[$i]['image']) && $results[$i]['image'] != "") { echo "<img src='modules/".$module->getVar('dirname')."/".$results[$i]['image']."' alt='".$module->getVar('name')."' /> "; } else { echo "<img src='images/icons/posticon2.gif' alt='".$module->getVar('name')."' width='26' height='26' /> "; } echo "<b><a href='modules/".$module->getVar('dirname')."/".$results[$i]['link']."'>".$myts->makeTboxData4Show($results[$i]['title'])."</a></b><br />n"; echo "<small>"; $results[$i]['uid'] = intval($results[$i]['uid']); if ( !empty($results[$i]['uid']) ) { $uname = XoopsUser::getUnameFromId($results[$i]['uid']); echo " <a href='".XOOPS_URL."/userinfo.php?uid=".$results[$i]['uid']."'>".$uname."</a>n"; } echo $results[$i]['time'] ? " (". formatTimestamp(intval($results[$i]['time'])).")" : ""; echo "</small><br />n"; } if ( $count == 5 ) { $search_url = XOOPS_URL.'/search.php?query='.urlencode(stripslashes(implode(' ', $queries))); $search_url .= "&mid=$mid&action=showall&andor=$andor"; echo '<br /><a href="'.$search_url.'">'._SR_SHOWALLR.'</a></p>'; } } 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 :
le="color: #000000"><?php $results =& $module->search($queries, $andor, 5, 0); if ( $module->getVar('name') != _MI_ISEARCH_NAME ) { echo "<h4>".$module->getVar('name')."</h4>"; // => here is what I wanted to remove. $count = count($results); if (!is_array($results) || $count == 0) { echo "<p>"._SR_NOMATCH."</p>"; // => That too } else { for ($i = 0; $i < $count; $i++) { // => And every echo below too if (isset($results[$i]['image']) && $results[$i]['image'] != "") { echo "<img src='modules/".$module->getVar('dirname')."/".$results[$i]['image']."' alt='".$module->getVar('name')."' /> "; } else { echo "<img src='images/icons/posticon2.gif' alt='".$module->getVar('name')."' width='26' height='26' /> "; } echo "<b><a href='modules/".$module->getVar('dirname')."/".$results[$i]['link']."'>".$myts->makeTboxData4Show($results[$i]['title'])."</a></b><br />n"; echo "<small>"; $results[$i]['uid'] = intval($results[$i]['uid']); if ( !empty($results[$i]['uid']) ) { $uname = XoopsUser::getUnameFromId($results[$i]['uid']); echo " <a href='".XOOPS_URL."/userinfo.php?uid=".$results[$i]['uid']."'>".$uname."</a>n"; } echo $results[$i]['time'] ? " (". formatTimestamp(intval($results[$i]['time'])).")" : ""; echo "</small><br />n"; } if ( $count == 5 ) { $search_url = XOOPS_URL.'/search.php?query='.urlencode(stripslashes(implode(' ', $queries))); $search_url .= "&mid=$mid&action=showall&andor=$andor"; echo '<br /><a href="'.$search_url.'">'._SR_SHOWALLR.'</a></p>'; } } 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 :
le="color: #000000"><?php foreach ( $this->getOptions() as $value => $name ) { if ( $name != _MI_ISEARCH_NAME ) { $ret .= "<input type='checkbox' name='".$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.