Sponsorenverwaltung - Team StarCraft e.V.
 All Data Structures Files Functions Variables
sponsors_search.php File Reference

This script handles fulltext-search. More...

Go to the source code of this file.

Functions

 generateWhereClause ($columns, $searchterm, $findSimilar=SEARCH_NORMAL)
 
 searchDatabase ($searchColumns, $searchTerm, $findSimilar=SEARCH_NORMAL, $logicMode=LOGIC_NONE)
 

Variables

const SEARCH_EXTENDED 1
 Marker for extended search on the database. More...
 
const SEARCH_NORMAL 2
 Marker for normal search on the database. More...
 
const SEARCH_STRICT 3
 Marker for normal search on the database. More...
 
const LOGIC_AND (-1)
 Marker for linking results with AND. More...
 
const LOGIC_OR 1
 Marker for linking results with OR. More...
 
const LOGIC_NONE 0
 Marker for nor splitting the result in linkable partzs. More...
 
const HIGHLIGHT_ON 1
 Marker to indicate that the user wants to use highlighting. More...
 
const HIGHLIGHT_OFF 0
 Marker to indicate that the user doesn't want to use highlighting. More...
 

Detailed Description

This script handles fulltext-search.

This script handles fulltext search. It's capable of searching the database for one or more searchterms, storing the results in and perform additional tasks as sorting or preparation for export on these stored results. Currently it's not capable to perform highlighting tasks on its results.

This file depends on inc/common.php and inc/templates/sponsors_search.tpl

Version
1.0.0
Author
Alexander Vorndran
Daniel Seichter
Date
02.07.2013

Definition in file sponsors_search.php.

Function Documentation

generateWhereClause (   $columns,
  $searchterm,
  $findSimilar = SEARCH_NORMAL 
)

Generates a where clause according to the given information

Parameters
array$columnsthe names of the columns
string$searchtermthe actual search term
integer$findSimilar
  • SEARCH_EXTENDED uses SOUNDS LIKE in addition, adds trailing and leading %
  • SEARCH_NORMAL just adds trailing and leading %
  • SEARCH_STRICT doesn't add trailing and leading %
Returns
string the where clause based on the given information
Author
Alexander Vorndran

Definition at line 247 of file sponsors_search.php.

References $mysqli, SEARCH_EXTENDED, and SEARCH_STRICT.

Referenced by searchDatabase().

+ Here is the caller graph for this function:

searchDatabase (   $searchColumns,
  $searchTerm,
  $findSimilar = SEARCH_NORMAL,
  $logicMode = LOGIC_NONE 
)

Search the sponsoring database

Parameters
array$searchColumnsthe names of the colums that should be used for the search
string$searchTermthe keywords to search for
integer$findSimilar[optional]
  • SEARCH_EXTENDED uses SOUNDS LIKE in addition, adds trailing and leading %
  • SEARCH_STRICT doesn't add trailing and leading %
  • Default: SEARCH_NORMAL just adds trailing and leading %
integer$logicMode[optional]
  • LOGIC_OR split and link with OR
  • LOGIC_AND split and link with AND
  • Default: LOGIC_NONE don't split the searchterm
Returns
mixed
  • a list of the matching sponsors on success
  • FALSE on failure
Author
Alexander Vorndran

Definition at line 289 of file sponsors_search.php.

References $db, $mysqli, fetchSponsorLatestEditData(), generateWhereClause(), LOGIC_AND, and LOGIC_OR.

+ Here is the call graph for this function:

Variable Documentation

const HIGHLIGHT_OFF 0

Marker to indicate that the user doesn't want to use highlighting.

Definition at line 39 of file sponsors_search.php.

const HIGHLIGHT_ON 1

Marker to indicate that the user wants to use highlighting.

Definition at line 37 of file sponsors_search.php.

const LOGIC_AND (-1)

Marker for linking results with AND.

Definition at line 30 of file sponsors_search.php.

Referenced by searchDatabase().

const LOGIC_NONE 0

Marker for nor splitting the result in linkable partzs.

Definition at line 34 of file sponsors_search.php.

const LOGIC_OR 1

Marker for linking results with OR.

Definition at line 32 of file sponsors_search.php.

Referenced by searchDatabase().

const SEARCH_EXTENDED 1

Marker for extended search on the database.

Definition at line 23 of file sponsors_search.php.

Referenced by generateWhereClause().

const SEARCH_NORMAL 2

Marker for normal search on the database.

Definition at line 25 of file sponsors_search.php.

const SEARCH_STRICT 3

Marker for normal search on the database.

Definition at line 27 of file sponsors_search.php.

Referenced by generateWhereClause().