Menu

#404 Sould use MODULE_NAME/search.php file instead of XOOPSCORE/search.php

XOOPS_2.6
open
nobody
7
2012-10-20
2012-10-20
irmtfan
No

XOOPSCORE/search.php use very simple method for search. it just accept queries and "ANDOR"
It always use module functions for search so it should use module file for search too (if it exist)

We should add some codes to make it work.
in XOOPSCORE/search.php around line 193 add these:
[code]
if ($count >= 5) {
// START irmtfan hack to use MODULE_NAME/search.php file instead of XOOPSCORE/search.php
$module_search_file_relpath = "modules/" . $module->getVar('dirname') . "/search.php";
if ( is_file( XOOPS_ROOT_PATH . "/" . $module_search_file_relpath ) ) {
$queryString = urlencode(stripslashes(implode(' ', $queries)));
$search_url = XOOPS_URL . "/" . $module_search_file_relpath . "?term=" . $queryString . "&query=" . $queryString . "&andor={$andor}";
} else {
$search_url = XOOPS_URL . '/search.php?query=' . urlencode(stripslashes(implode(' ', $queries)));
$search_url .= "&mid={$mid}&action=showall&andor={$andor}";
}
// END irmtfan hack to use MODULE_NAME/search.php file instead of XOOPSCORE/search.php
echo '

' . _SR_SHOWALLR . '

';
}
[/code]

Then it will use MODULE_NAME/search.php file instead of XOOPSCORE/search.php

Also it get 2 queries to find if there is a "NEXT" page.
It can do it with just One query.

for more information please see this in xoops.org forum:
http://xoops.org/modules/newbb/viewtopic.php?post_id=349697#forumpost349697

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.