[ class tree: classes ] [ index: classes ] [ all elements ]

Class: SearchEngine

Source Location: /class-search.php

Class SearchEngine

Property Summary
mixed   $albums  
mixed   $album_list  
mixed   $category_list  
mixed   $dates  
mixed   $dynalbumname  
mixed   $fieldList  
mixed   $gallery  
mixed   $images  
mixed   $iteration  
mixed   $page  
mixed   $processed_search  
mixed   $searches  
mixed   $search_no_albums  
mixed   $search_no_images  
mixed   $search_no_news  
mixed   $search_no_pages  
mixed   $search_structure  
mixed   $whichdates  
mixed   $words  

[ Top ]
Method Summary
SearchEngine   __construct()   Constuctor
array   allowedSearchFields()   Returns an array of the enabled search fields
void   clearSearchWords()  
string   codifySearchString()   recodes the search words replacing the boolean operators with text versions
void   compressedIDList()   Takes a list of IDs and makes a where clause
int   getAlbumIndex()   Returns the index of the album within the search albums
void   getAlbumList()   return the list of albums found
array   getAlbums()   Returns an array of album names found in the search.
void   getCacheTag()   creates a unique id for a search
void   getCategoryList()   return the list of categories found
object   getImage()   Returns a specific image
int   getImageIndex()   Returns the index of this image in the search images
array   getImages()   Returns an array of images found in the search It will return a "page's worth" if $page is non zero
object   getNextAlbum()   Returns the album following the current one
int   getNumAlbums()   Returns the number of albums found in a search
int   getNumImages()   Returns the number of images found in the search
object   getPrevAlbum()   Returns the album preceding the current one
array   getSearchAlbums()   Returns an array of albums found in the search
string   getSearchDate()   Returns the search dates variable
array   getSearchFieldList()   Returns a list of search fields display names indexed by the search mask
mixed   getSearchFields()   Returns the search fields variable
string   getSearchFieldsText()   Returns the "searchstring" element of a query parameter set
array   getSearchImages()   Returns an array of image names found in the search
array   getSearchNews()   Returns a list of News Titlelinks found in the search
array   getSearchPages()   Returns a list of Pages Titlelinks found in the search
string   getSearchParams()   creates a search query from the search words
array   getSearchString()   Parses a search string Items within quotations are treated as atomic AND, OR and NOT are converted to &, |, and !
string   getSearchWords()   Returns the search words variable
array   numericFields()   converts old style bitmask field spec into field list array
int   parseQueryFields()   Returns the set of fields from the url query/post
string   searchDate()   returns the results of a date search
array   searchFieldsAndTags()   Searches the table for tags Returns an array of database records.
void   setSearchParams()   Parses and stores a search string NOTE!! this function assumes that the 'words' part of the list has been urlencoded!!!
void   subsetNewsCategories()   Returns an array of News article IDs belonging to the search categories

[ Top ]
Properties
mixed   $albums = NULL [line 26]

[ Top ]
mixed   $album_list = NULL [line 36]
API Tags:
Access:  protected


[ Top ]
mixed   $category_list [line 37]
API Tags:
Access:  protected


[ Top ]
mixed   $dates [line 21]

[ Top ]
mixed   $dynalbumname [line 27]

[ Top ]
mixed   $fieldList [line 23]

[ Top ]
mixed   $gallery [line 28]

[ Top ]
mixed   $images = NULL [line 25]

[ Top ]
mixed   $iteration = 0 [line 34]
API Tags:
Access:  protected


[ Top ]
mixed   $page [line 24]

[ Top ]
mixed   $processed_search = NULL [line 35]
API Tags:
Access:  protected


[ Top ]
mixed   $searches = NULL [line 38]
API Tags:
Access:  protected


[ Top ]
mixed   $search_no_albums [line 29]
API Tags:
Access:  protected


[ Top ]
mixed   $search_no_images [line 30]
API Tags:
Access:  protected


[ Top ]
mixed   $search_no_news [line 32]
API Tags:
Access:  protected


[ Top ]
mixed   $search_no_pages [line 31]
API Tags:
Access:  protected


[ Top ]
mixed   $search_structure [line 33]
API Tags:
Access:  protected


[ Top ]
mixed   $whichdates = 'date' [line 22]
API Tags:
Access:  protected


[ Top ]
mixed   $words [line 20]

[ Top ]
Methods
Constructor __construct  [line 46]

  SearchEngine __construct( [bool $dynamic_album = false]  )

Constuctor

Parameters:
bool   $dynamic_album:  set true for dynamic albums (limits the search fields)


[ Top ]
allowedSearchFields  [line 174]

  array allowedSearchFields( )

Returns an array of the enabled search fields



[ Top ]
clearSearchWords  [line 1500]

  void clearSearchWords( )



[ Top ]
codifySearchString  [line 588]

  string codifySearchString( string $quote  )

recodes the search words replacing the boolean operators with text versions

Parameters:
string   $quote:  how to represent quoted strings


[ Top ]
compressedIDList  [line 692]

  void compressedIDList( array $idlist  )

Takes a list of IDs and makes a where clause

Parameters:
array   $idlist:  list of IDs for a where clause

API Tags:
Access:  protected


[ Top ]
getAlbumIndex  [line 1210]

  int getAlbumIndex( string $curalbum  )

Returns the index of the album within the search albums

Parameters:
string   $curalbum:  The album sought


[ Top ]
getAlbumList  [line 1418]

  void getAlbumList( )

return the list of albums found



[ Top ]
getAlbums  [line 1191]

  array getAlbums( [int $page = 0], [string $sorttype = NULL], [string $sortdirection = NULL], [bool $care = true], [bool $mine = NULL]  )

Returns an array of album names found in the search.

If $page is not zero, it returns the current page's albums

Parameters:
int   $page:  the page number we are on
string   $sorttype:  what to sort on
string   $sortdirection:  what direction
bool   $care:  set to false if the order of the albums does not matter
bool   $mine:  set true/false to override ownership


[ Top ]
getCacheTag  [line 1512]

  void getCacheTag( string $table, string $search, string $sort  )

creates a unique id for a search

Parameters:
string   $table:  Database table
string   $search:  Search string
string   $sort:  Sort criteria

API Tags:
Access:  protected


[ Top ]
getCategoryList  [line 1426]

  void getCategoryList( )

return the list of categories found



[ Top ]
getImage  [line 1402]

  object getImage( int $index  )

Returns a specific image

Parameters:
int   $index:  the index of the image desired


[ Top ]
getImageIndex  [line 1384]

  int getImageIndex( string $album, string $filename  )

Returns the index of this image in the search images

Parameters:
string   $album:  The folder name of the image
string   $filename:  the filename of the image


[ Top ]
getImages  [line 1354]

  array getImages( [int $page = 0], [int $firstPageCount = 0], [string $sorttype = NULL], [string $sortdirection = NULL], [bool $mine = NULL]  )

Returns an array of images found in the search It will return a "page's worth" if $page is non zero

Parameters:
int   $page:  the page number desired
int   $firstPageCount:  count of images that go on the album/image transition page
string   $sorttype:  what to sort on
string   $sortdirection:  what direction
bool   $mine:  set true/false to overried ownership


[ Top ]
getNextAlbum  [line 1221]

  object getNextAlbum( string $curalbum  )

Returns the album following the current one

Parameters:
string   $curalbum:  the name of the current album


[ Top ]
getNumAlbums  [line 625]

  int getNumAlbums( )

Returns the number of albums found in a search



[ Top ]
getNumImages  [line 1252]

  int getNumImages( )

Returns the number of images found in the search



[ Top ]
getPrevAlbum  [line 1237]

  object getPrevAlbum( string $curalbum  )

Returns the album preceding the current one

Parameters:
string   $curalbum:  the name of the current album


[ Top ]
getSearchAlbums  [line 1126]

  array getSearchAlbums( string $sorttype, string $sortdirection, [bool $mine = NULL]  )

Returns an array of albums found in the search

Parameters:
string   $sorttype:  what to sort on
string   $sortdirection:  what direction
bool   $mine:  set true/false to override ownership


[ Top ]
getSearchDate  [line 369]

  string getSearchDate( )

Returns the search dates variable



[ Top ]
getSearchFieldList  [line 161]

  array getSearchFieldList( )

Returns a list of search fields display names indexed by the search mask



[ Top ]
getSearchFields  [line 381]

  mixed getSearchFields( [bool $array = false]  )

Returns the search fields variable

Parameters:
bool   $array:  set to true to return the fields as array elements. Otherwise a comma delimited string is returned


[ Top ]
getSearchFieldsText  [line 264]

  string getSearchFieldsText( array $fields, [string $param = '&searchfields=']  )

Returns the "searchstring" element of a query parameter set

Parameters:
array   $fields:  the fields required
string   $param:  the query parameter (possibly with the intro character


[ Top ]
getSearchImages  [line 1267]

  array getSearchImages( string $sorttype, string $sortdirection, [bool $mine = NULL]  )

Returns an array of image names found in the search

Parameters:
string   $sorttype:  what to sort on
string   $sortdirection:  what direction
bool   $mine:  set true/false to overried ownership


[ Top ]
getSearchNews  [line 1473]

  array getSearchNews( [string $sortorder = "date"], [string $sortdirection = "desc"]  )

Returns a list of News Titlelinks found in the search

Parameters:
string   $sortorder:  "date" for sorting by date (default) "title" for sorting by title
string   $sortdirection:  "desc" (default) for descending sort order "asc" for ascending sort order


[ Top ]
getSearchPages  [line 1435]

  array getSearchPages( )

Returns a list of Pages Titlelinks found in the search



[ Top ]
getSearchParams  [line 212]

  string getSearchParams( [bool $long = true]  )

creates a search query from the search words

Parameters:
bool   $long:  set to false to omit albumname and page parts


[ Top ]
getSearchString  [line 395]

  array getSearchString( )

Parses a search string Items within quotations are treated as atomic AND, OR and NOT are converted to &, |, and !

Returns an array of search elements



[ Top ]
getSearchWords  [line 360]

  string getSearchWords( )

Returns the search words variable



[ Top ]
numericFields  [line 196]

  array numericFields( bit $fields  )

converts old style bitmask field spec into field list array

Parameters:
bit   $fields: 

API Tags:
Access:  protected


[ Top ]
parseQueryFields  [line 637]

  int parseQueryFields( )

Returns the set of fields from the url query/post


Information Tags:
Since:  1.1.3

[ Top ]
searchDate  [line 707]

  string searchDate( string $searchstring, string $searchdate, string $tbl, string $sorttype, string $sortdirection, [ $whichdate = 'date']  )

returns the results of a date search

Parameters:
string   $searchstring:  the search target
string   $searchdate:  the date target
string   $tbl:  the database table to search
string   $sorttype:  what to sort on
string   $sortdirection:  what direction
   $whichdate: 

Information Tags:
Since:  1.1.3

[ Top ]
searchFieldsAndTags  [line 828]

  array searchFieldsAndTags( array $searchstring, string $tbl, string $sorttype, string $sortdirection  )

Searches the table for tags Returns an array of database records.

Parameters:
array   $searchstring: 
string   $tbl:  set DB table name to be searched
string   $sorttype:  what to sort on
string   $sortdirection:  what direction

API Tags:
Access:  protected


[ Top ]
setSearchParams  [line 282]

  void setSearchParams( string $paramstr  )

Parses and stores a search string NOTE!! this function assumes that the 'words' part of the list has been urlencoded!!!

Parameters:
string   $paramstr:  the string containing the search words


[ Top ]
subsetNewsCategories  [line 660]

  void subsetNewsCategories( )

Returns an array of News article IDs belonging to the search categories


API Tags:
Access:  protected


[ Top ]

Documentation generated on Tue, 20 Dec 2011 16:06:49 +0100 by phpDocumentor 1.4.3