Overview

Packages

  • admin
  • classes
    • media
  • CodeIgniter
    • Libraries
  • core
  • functions
  • JSMin
  • None
  • OpenID
  • PHP
  • PHPMailer
  • plugins
    • admin
    • development
    • feed
    • mail
    • media
    • misc
    • seo
    • spam
    • uploader
    • users
    • zenpage
    • zenphoto
      • news
  • Services
    • JSON

Classes

  • Album
  • AlbumBase
  • Comment
  • dynamicAlbum
  • feed
  • Gallery
  • Image
  • MediaObject
  • PersistentObject
  • SearchEngine
  • ThemeObject
  • Transientimage
  • Zenphoto_Administrator
  • Zenphoto_Authority

Functions

  • isAlbumClass
  • isImageClass
  • newAlbum
  • newImage
  • search_quote
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated

Class SearchEngine

Package: classes
Located at class-search.php
Methods summary
public SearchEngine
# __construct( boolean $dynamic_album = false )

Constuctor

Constuctor

Parameters

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

Returns

SearchEngine
public number
# getID( )

mimic an album object

mimic an album object

Returns

number
public array
# getSearchFieldList( )

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

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

Returns

array
public array
# allowedSearchFields( )

Returns an array of the enabled search fields

Returns an array of the enabled search fields

Returns

array
protected array
# numericFields( bit $fields )

converts old style bitmask field spec into field list array

converts old style bitmask field spec into field list array

Parameters

$fields

Returns

array
public string
# getSearchParams( boolean $long = true )

creates a search query from the search words

creates a search query from the search words

Parameters

$long
set to false to omit albumname and page parts

Returns

string
public array
# getSearchExtra( )

Retrieves search extra parameters

Returns

array
public
# setSearchExtra( array $extra )

Stores extra search params for plugin use

Parameters

$extra
public
# setSortDirection( boolean $val, string $what = 'images' )

sets sort directions

sets sort directions

Parameters

$val
the direction
$what

'images' if you want the image direction, 'albums' if you want it for the album

public
# setSortType( string $sorttype, string $what = 'images' )

Stores the sort type

Stores the sort type

Parameters

$sorttype
the sort type
$what
'images' or 'albums'
public string
# getSearchFieldsText( array $fields, string $param = '&searchfields=' )

Returns the "searchstring" element of a query parameter set

Returns the "searchstring" element of a query parameter set

Parameters

$fields
the fields required
$param
the query parameter (possibly with the intro character

Returns

string
public
# setSearchParams( string $paramstr )

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

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

Parameters

$paramstr
the string containing the search words
public
# setSearchUnpublished( )
public string
# getSearchWords( )

Returns the search words variable

Returns the search words variable

Returns

string
public string
# getSearchDate( )

Returns the search dates variable

Returns the search dates variable

Returns

string
public mixed
# getSearchFields( boolean $array = false )

Returns the search fields variable

Returns the search fields variable

Parameters

$array

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

Returns

mixed
public array
# getSearchString( )

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

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

Returns

array
public string
# codifySearchString( string $quote,… )

recodes the search words replacing the boolean operators with text versions

recodes the search words replacing the boolean operators with text versions

Parameters

$quote,…
how to represent quoted strings

Returns

string
public integer
# getNumAlbums( )

Returns the number of albums found in a search

Returns the number of albums found in a search

Returns

integer
public integer
# parseQueryFields( )

Returns the set of fields from the url query/post

Returns the set of fields from the url query/post

Returns

integer

Since

1.1.3
protected
# subsetNewsCategories( )

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

protected static
# compressedIDList( array $idlist )

Takes a list of IDs and makes a where clause

Takes a list of IDs and makes a where clause

Parameters

$idlist
list of IDs for a where clause
protected array
# sortKey( type $sorttype, type $sortdirection, type $defaulttype, type $table )

get connical sort key and direction parameters.

get connical sort key and direction parameters.

Parameters

$sorttype
sort field desired
$sortdirection
DESC or ASC
$defaulttype
if no sort type otherwise selected use this one
$table
the database table being searched

Returns

array
public string
# searchDate( string $searchstring, string $searchdate, string $tbl, string $sorttype, string $sortdirection, $whichdate = 'date' )

returns the results of a date search

returns the results of a date search

Parameters

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

Returns

string

Since

1.1.3
protected array
# searchFieldsAndTags( array $searchstring, string $tbl, string $sorttype, string $sortdirection )

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

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

Parameters

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

Returns

array
public array
# getAlbums( integer $page = 0, string $sorttype = NULL, string $sortdirection = NULL, boolean $care = true, boolean $mine = NULL )

Returns an array of album names found in the search. If $page is not zero, it returns the current page's albums

Returns an array of album names found in the search. If $page is not zero, it returns the current page's albums

Parameters

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

Returns

array
public integer
# getAlbumIndex( string $curalbum )

Returns the index of the album within the search albums

Returns the index of the album within the search albums

Parameters

$curalbum
The album sought

Returns

integer
public object
# getNextAlbum( string $curalbum )

Returns the album following the current one

Returns the album following the current one

Parameters

$curalbum
the name of the current album

Returns

object
public object
# getPrevAlbum( string $curalbum )

Returns the album preceding the current one

Returns the album preceding the current one

Parameters

$curalbum
the name of the current album

Returns

object
public integer
# getNumImages( )

Returns the number of images found in the search

Returns the number of images found in the search

Returns

integer
public array
# getImages( integer $page = 0, integer $firstPageCount = 0, string $sorttype = NULL, string $sortdirection = NULL, boolean $care = true, boolean $mine = NULL )

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

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

Parameters

$page
the page number desired
$firstPageCount
count of images that go on the album/image transition page
$sorttype
what to sort on
$sortdirection
what direction
$care
placeholder to make the getImages methods all the same.
$mine
set true/false to overried ownership

Returns

array
public integer
# getImageIndex( string $album, string $filename )

Returns the index of this image in the search images

Returns the index of this image in the search images

Parameters

$album
The folder name of the image
$filename
the filename of the image

Returns

integer
public object
# getImage( integer $index )

Returns a specific image

Returns a specific image

Parameters

$index
the index of the image desired

Returns

object
public
# getDynamicAlbum( )
public
# getAlbumList( )

return the list of albums found

public
# getCategoryList( )

return the list of categories found

public array
# getPages( boolean $published = NULL, boolean $toplevel = false, integer $number = NULL, string $sorttype = NULL, strng $sortdirection = NULL )

Returns pages from a search

Parameters

$published
ignored, left for parameter compatibility
$toplevel
ignored, left for parameter compatibility
$number
ignored, left for parameter compatibility
$sorttype
the sort key
$sortdirection
the sort order

Returns

array
public array
# getArticles( integer $articles_per_page = 0, boolean $published = NULL, boolean $ignorepagination = false, string $sorttype = NULL, string $sortdirection = NULL )

Returns a list of News Titlelinks found in the search

Returns a list of News Titlelinks found in the search

Parameters

$articles_per_page
The number of articles to get
$published
placeholder for consistent parameter list
$ignorepagination
ignore pagination
$sorttype
field to sort on
$sortdirection
sort order

Returns

array
public
# clearSearchWords( )
protected
# getCacheTag( string $table, string $search, string $sort )

creates a unique id for a search

Parameters

$table
Database table
$search
Search string
$sort
Sort criteria
public static
# clearSearchCache( )

Clears the entire search cache table

Clears the entire search cache table

Properties summary
public $fieldList
# NULL
public integer $page
# 1
public $images
# NULL
public $albums
# NULL
public $articles
# NULL
public $pages
# NULL
public $pattern
#
public $tagPattern
#
protected $dynalbumname
# NULL
protected $album
# NULL
protected $words
#
protected $dates
#
protected string $whichdates
# 'date'
protected boolean $search_no_albums
# false
protected boolean $search_no_images
# false
protected boolean $search_no_pages
# false
protected boolean $search_no_news
# false
protected boolean $search_unpublished
# false
protected $search_structure
#
protected integer $iteration
# 0
protected $processed_search
# NULL
protected $album_list
# NULL
protected $category_list
# NULL
protected $searches
# NULL
protected array $extraparams
# array()
public boolean $loaded
# false
public string $table
# 'albums'
public boolean $transient
# true
Zenphoto doc API documentation generated by ApiGen