/program/modules/htmlpage/htmlpage_search.php - interface to the search-part of this module
This file defines the interface with this module for searching content. The interface consists of a (temporary) table and this function:
The function is called whenever module content is to be searched. At that point the helper table, which is called 'search_nodes', exists and is populated.
search all htmlpages linked to selected nodes for keywords in $qwords
TASKS
This function needs to perform these tasks.
KEYWORDS TO SEARCH FOR
On entry the array $qwords contains the sanitised user-supplied keywords, as follows:
HELPER TABLE
On entry the table 'search_nodes' [*] exists and is populated with node_id's that are qualified to be searched. The structure of this table is as follows:
[*] Note that as with every other table the name of the table is prefixed with the prefix found in $DB->prefix or $CFG->prefix.
The search results of this module can be limited to the qualifying nodes by using an inner join, e.g.
RETURNING SEARCH RESULTS
If there are hits, these are collected in $hits as follows:
Eventually this yields HTML-code like this:
Tip: function search_context() can be used to extract context snippets from hits.
If search is not relevant to the module, the NOP can be this:
See also search_nodes().
Documentation generated on Tue, 28 Jun 2016 19:09:51 +0200 by phpDocumentor 1.4.0