Unofficial SMF API Documentation

./Sources/Search.php

PlushSearch1

function PlushSearch1(): void

Ask the user what they want to search for.

What it does:

Integration hooks
integrate_search

PlushSearch2

function PlushSearch2(): void

Gather the results and show them.

What it does:

Integration hooks
integrate_search_weights
integrate_search_sort_columns
integrate_search_params
integrate_search_blacklisted_words
integrate_search_errors
integrate_subject_only_search_query
integrate_subject_search_query
integrate_main_search_query
integrate_search_message_list

prepareSearchContext

function prepareSearchContext(bool $reset = false): array

Callback to return messages - saves memory.

What it does:

Type Parameter Description
bool $reset Whether to reset the counter
Integration hooks
integrate_quick_mod_actions_search
integrate_search_message_context

findSearchAPI

function findSearchAPI(): \search_api_interface

Creates a search API and returns the object.

searchSort

function searchSort(string $a, string $b): int

This function compares the length of two strings plus a little.

What it does:

Type Parameter Description
string $a  
string $b  

highlight

function highlight(string $text, array $words): string

Highlighting matching string

Type Parameter Description
string $text Text to search through
array $words List of keywords to search

Suggest an edit to this page on GitHub