File/program/modules/newsletter/newsletter_search.php

Description

/program/modules/newsletter/newsletter_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:

    bool newsletter_search(&$hits,&$results,$qwords, $limit, $offset)

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.

Functions
newsletter_search (line 59)

search this module's content in selected nodes for keywords in $qwords

This interface is documented in htmlpage_search() in htmlpage_search.php.

We have to search the following fields in two tables:

a. newsletters: 1 record/newsletter: title/subtitle/header/introduction/footer

b. newsletter_issues: 0,1,...N records/newsletter: html_title/html_body

Newsletters and -issues qualify only when the channel/status is 2 (website) or 3 (both) Hits in newsletters link to the main page (node=$node_id) Hits in the newsletter_issues link to node=$node_id,volume=$volume,number=$number

  • return: FALSE on failure, TRUE on success and $hits, $results updated (maybe)
bool|array newsletter_search (array &$hits, int &$results, array $qwords, int $limit, [int $offset = 0])
  • array &$hits: receives search results (at most $limit)
  • int &$results: receives number of hits (negative value on entry means (re-)calculate total)
  • array $qwords: holds 1 or more keywords to search for (original, utf8lower, quoted)
  • int $limit: maximum number of hits to return (could be 0)
  • int $offset: starting point within this module for returning results
newsletter_search_results (line 165)

count the number of hits in $table

  • return: FALSE on error, # of hits otherwise (could be 0)
bool|int newsletter_search_results (string $table, string $where)
  • string $table: name of table to search
  • string $where: where clause to select hits in $table

Documentation generated on Tue, 28 Jun 2016 19:11:01 +0200 by phpDocumentor 1.4.0