PATH:
home
/
sudairsocs
/
www
/
forum
/
Sources
<?php /** * Simple Machines Forum (SMF) * * @package SMF * @author Simple Machines https://www.simplemachines.org * @copyright 2022 Simple Machines and individual contributors * @license https://www.simplemachines.org/about/smf/license.php BSD * * @version 2.1.0 */ /** * Interface search_api_interface */ interface search_api_interface { /** * Check whether the specific search operation can be performed by this API. * The operations are the functions listed in the interface, if not supported * they need not be declared * * @access public * @param string $methodName The method * @param array $query_params Any parameters for the query * @return boolean Whether or not the specified method is supported */ public function supportsMethod($methodName, $query_params = array()); /** * Whether this method is valid for implementation or not * * @access public * @return bool Whether or not this method is valid */ public function isValid(); /** * Callback function for usort used to sort the fulltext results. * the order of sorting is: large words, small words, large words that * are excluded from the search, small words that are excluded. * * @access public * @param string $a Word A * @param string $b Word B * @return int An integer indicating how the words should be sorted */ public function searchSort($a, $b); /** * Callback while preparing indexes for searching * * @access public * @param string $word A word to index * @param array $wordsSearch Search words * @param array $wordsExclude Words to exclude * @param bool $isExcluded Whether the specfied word should be excluded */ public function prepareIndexes($word, array &$wordsSearch, array &$wordsExclude, $isExcluded); /** * Search for indexed words. * * @access public * @param array $words An array of words * @param array $search_data An array of search data * @return mixed */ public function indexedWordQuery(array $words, array $search_data); /** * Callback when a post is created * * @see createPost() * * @access public * @param array $msgOptions An array of post data * @param array $topicOptions An array of topic data * @param array $posterOptions An array of info about the person who made this post * @return void */ public function postCreated(array &$msgOptions, array &$topicOptions, array &$posterOptions); /** * Callback when a post is modified * * @see modifyPost() * * @access public * @param array $msgOptions An array of post data * @param array $topicOptions An array of topic data * @param array $posterOptions An array of info about the person who made this post * @return void */ public function postModified(array &$msgOptions, array &$topicOptions, array &$posterOptions); /** * Callback when a post is removed * * @access public * @param int $id_msg The ID of the post that was removed * @return void */ public function postRemoved($id_msg); /** * Callback when a topic is removed * * @access public * @param array $topics The ID(s) of the removed topic(s) * @return void */ public function topicsRemoved(array $topics); /** * Callback when a topic is moved * * @access public * @param array $topics The ID(s) of the moved topic(s) * @param int $board_to The board that the topics were moved to * @return void */ public function topicsMoved(array $topics, $board_to); /** * Callback for actually performing the search query * * @access public * @param array $query_params An array of parameters for the query * @param array $searchWords The words that were searched for * @param array $excludedIndexWords Indexed words that should be excluded * @param array $participants * @param array $searchArray * @return mixed */ public function searchQuery(array $query_params, array $searchWords, array $excludedIndexWords, array &$participants, array &$searchArray); } /** * Class search_api */ abstract class search_api implements search_api_interface { /** * @var string The maximum SMF version that this will work with. */ public $version_compatible = '2.1.999'; /** * @var string The minimum SMF version that this will work with. */ public $min_smf_version = '2.1 RC1'; /** * @var bool Whether or not it's supported */ public $is_supported = true; /** * {@inheritDoc} */ public function supportsMethod($methodName, $query_params = null) { switch ($methodName) { case 'postRemoved': return true; break; // All other methods, too bad dunno you. default: return false; break; } } /** * {@inheritDoc} */ public function isValid() { } /** * {@inheritDoc} */ public function searchSort($a, $b) { } /** * {@inheritDoc} */ public function prepareIndexes($word, array &$wordsSearch, array &$wordsExclude, $isExcluded) { } /** * {@inheritDoc} */ public function indexedWordQuery(array $words, array $search_data) { } /** * {@inheritDoc} */ public function postCreated(array &$msgOptions, array &$topicOptions, array &$posterOptions) { } /** * {@inheritDoc} */ public function postModified(array &$msgOptions, array &$topicOptions, array &$posterOptions) { } /** * {@inheritDoc} */ public function postRemoved($id_msg) { global $smcFunc; $result = $smcFunc['db_query']('', ' SELECT DISTINCT id_search FROM {db_prefix}log_search_results WHERE id_msg = {int:id_msg}', array( 'id_msg' => $id_msg, ) ); $id_searchs = array(); while ($row = $smcFunc['db_fetch_assoc']($result)) $id_searchs[] = $row['id_search']; if (count($id_searchs) < 1) return; $smcFunc['db_query']('', ' DELETE FROM {db_prefix}log_search_results WHERE id_search in ({array_int:id_searchs})', array( 'id_searchs' => $id_searchs, ) ); $smcFunc['db_query']('', ' DELETE FROM {db_prefix}log_search_topics WHERE id_search in ({array_int:id_searchs})', array( 'id_searchs' => $id_searchs, ) ); $smcFunc['db_query']('', ' DELETE FROM {db_prefix}log_search_messages WHERE id_search in ({array_int:id_searchs})', array( 'id_searchs' => $id_searchs, ) ); } /** * {@inheritDoc} */ public function topicsRemoved(array $topics) { } /** * {@inheritDoc} */ public function topicsMoved(array $topics, $board_to) { } /** * {@inheritDoc} */ public function searchQuery(array $query_params, array $searchWords, array $excludedIndexWords, array &$participants, array &$searchArray) { } } ?>
[+]
..
[-] Errors.php~
[edit]
[-] ReportedContent.php
[edit]
[-] Profile.php~
[edit]
[-] Notify.php
[edit]
[-] Security.php~
[edit]
[-] ScheduledTasks.php
[edit]
[-] ModerationCenter.php
[edit]
[-] Mentions.php
[edit]
[-] DbExtra-mysql.php~
[edit]
[-] Subs-MessageIndex.php
[edit]
[-] Display.php~
[edit]
[-] DbPackages-sqlite.php
[edit]
[-] ManageSettings.php~
[edit]
[-] Subs-Compat.php
[edit]
[-] ManageScheduledTasks.php
[edit]
[-] Security.php
[edit]
[-] Profile-View.php~
[edit]
[-] BoardIndex.php
[edit]
[-] Class-Punycode.php
[edit]
[-] Subs-Db-postgresql.php~
[edit]
[-] MessageIndex.php
[edit]
[-] ManageMail.php~
[edit]
[-] Modlog.php
[edit]
[-] Calendar.php
[edit]
[-] Subs-Members.php~
[edit]
[-] Profile-Modify.php~
[edit]
[-] .reference
[edit]
[-] RemoveTopic.php~
[edit]
[-] ManageSmileys.php
[edit]
[-] MoveTopic.php
[edit]
[-] RemoveTopic.php
[edit]
[-] Subs-Post.php~
[edit]
[-] Profile.php
[edit]
[+]
Unicode
[-] Groups.php
[edit]
[-] Subs-Sound.php~
[edit]
[-] Groups.php~
[edit]
[-] Recent.php~
[edit]
[-] Who.php~
[edit]
[-] Class-TOTP.php
[edit]
[-] ManageRegistration.php~
[edit]
[-] Agreement.php
[edit]
[-] ReportToMod.php
[edit]
[-] Profile-Actions.php
[edit]
[-] Subs-Db-sqlite.php~
[edit]
[-] Display.php
[edit]
[-] ManageCalendar.php~
[edit]
[-] PersonalMessage.php
[edit]
[-] ManageAttachments.php~
[edit]
[-] Subs-Attachments.php
[edit]
[-] Help.php
[edit]
[-] Subs-Notify.php
[edit]
[-] index.php
[edit]
[-] Subs-Admin.php~
[edit]
[-] Subs-Db-mysql.php~
[edit]
[-] Subs-Package.php
[edit]
[-] Printpage.php
[edit]
[-] Subs-Post.php
[edit]
[-] Class-SearchAPI.php
[edit]
[-] Subs-Admin.php
[edit]
[-] DbExtra-postgresql.php
[edit]
[-] ManageSmileys.php~
[edit]
[-] Class-Graphics.php~
[edit]
[-] Subs-Categories.php
[edit]
[-] ManageSearch.php~
[edit]
[-] Subs-Editor.php~
[edit]
[-] Likes.php
[edit]
[-] Subs.php~
[edit]
[-] SendTopic.php
[edit]
[-] DbPackages-postgresql.php
[edit]
[-] DbSearch-mysql.php
[edit]
[-] Xml.php
[edit]
[-] Reports.php
[edit]
[-] Subs-Membergroups.php
[edit]
[-] ManagePosts.php
[edit]
[-] ManageAttachments.php
[edit]
[-] ManagePaid.php~
[edit]
[-] SearchAPI-Standard.php
[edit]
[-] DbExtra-mysql.php
[edit]
[-] ManageLanguages.php
[edit]
[+]
Cache
[-] Session.php
[edit]
[-] Load.php~
[edit]
[-] Packages.php~
[edit]
[-] ManageScheduledTasks.php~
[edit]
[-] Karma.php
[edit]
[-] Poll.php~
[edit]
[-] ManageMembers.php~
[edit]
[-] News.php
[edit]
[-] Subs-Compat.php~
[edit]
[-] DbSearch-sqlite.php
[edit]
[-] Subs-Charset.php
[edit]
[-] Subs.php
[edit]
[-] Reminder.php
[edit]
[-] Modlog.php~
[edit]
[-] ManagePaid.php
[edit]
[-] LogInOut.php
[edit]
[-] DbSearch-postgresql.php
[edit]
[-] hcaptcha.php
[edit]
[-] Subs-BoardIndex.php
[edit]
[-] ManageMembergroups.php~
[edit]
[+]
minify
[-] Class-Graphics.php
[edit]
[-] Subs-Graphics.php~
[edit]
[-] Subs-Menu.php
[edit]
[-] Admin.php~
[edit]
[-] ManageMail.php
[edit]
[-] SearchAPI-Custom.php
[edit]
[-] ScheduledTasks.php~
[edit]
[-] Logging.php
[edit]
[-] DbPackages-mysql.php
[edit]
[-] Subs-Recent.php
[edit]
[-] Class-CurlFetchWeb.php~
[edit]
[-] ModerationCenter.php~
[edit]
[+]
random_compat
[-] Admin.php
[edit]
[-] Class-Package.php
[edit]
[-] ManageMaintenance.php
[edit]
[-] Packages.php
[edit]
[-] Subs-BoardIndex.php~
[edit]
[-] ManageBans.php~
[edit]
[-] ManageMembers.php
[edit]
[-] ManageServer.php
[edit]
[-] Subs-Db-mysql.php
[edit]
[-] ManageErrors.php
[edit]
[-] Subs-Calendar.php
[edit]
[-] Subs-Editor.php
[edit]
[-] Load.php
[edit]
[-] Subs-Graphics.php
[edit]
[-] Subs-Boards.php
[edit]
[-] News.php~
[edit]
[-] Stats.php
[edit]
[-] ManageNews.php
[edit]
[-] Subs-Db-sqlite.php
[edit]
[-] Attachments.php
[edit]
[-] Subs-ReportedContent.php
[edit]
[-] Register.php~
[edit]
[-] Subs-Sound.php
[edit]
[-] Who.php
[edit]
[-] Subs-Members.php
[edit]
[-] Search.php~
[edit]
[-] ManageRegistration.php
[edit]
[-] Help.php~
[edit]
[-] PostModeration.php
[edit]
[-] ShowAttachments.php
[edit]
[-] Subs-Db-postgresql.php
[edit]
[-] Recent.php
[edit]
[-] Memberlist.php
[edit]
[-] ManageBoards.php
[edit]
[-] Themes.php~
[edit]
[-] Errors.php
[edit]
[-] ManagePermissions.php
[edit]
[-] SplitTopics.php
[edit]
[-] Profile-Modify.php
[edit]
[-] Themes.php
[edit]
[-] Register.php
[edit]
[-] Profile-Export.php
[edit]
[-] ManageServer.php~
[edit]
[-] Subs-Auth.php
[edit]
[-] PersonalMessage.php~
[edit]
[-] ManageSearchEngines.php
[edit]
[-] Drafts.php
[edit]
[-] Subs-Package.php~
[edit]
[-] Subs-MembersOnline.php
[edit]
[-] ManageCalendar.php
[edit]
[-] Memberlist.php~
[edit]
[-] QueryString.php
[edit]
[-] Poll.php
[edit]
[-] ManageMembergroups.php
[edit]
[+]
tasks
[-] ManageSearch.php
[edit]
[-] Subs-Auth.php~
[edit]
[-] Agreement.php~
[edit]
[-] Topic.php
[edit]
[-] QueryString.php~
[edit]
[-] ViewQuery.php
[edit]
[-] ManageMaintenance.php~
[edit]
[-] PackageGet.php
[edit]
[-] Post.php
[edit]
[-] Subs-Timezones.php
[edit]
[-] ManageErrors.php~
[edit]
[-] Post.php~
[edit]
[-] SearchAPI-Fulltext.php~
[edit]
[-] Profile-View.php
[edit]
[-] Subs-OpenID.php
[edit]
[-] ManageBans.php
[edit]
[-] Class-CurlFetchWeb.php
[edit]
[-] DbExtra-sqlite.php
[edit]
[-] ManageNews.php~
[edit]
[-] Subscriptions-PayPal.php
[edit]
[-] ManageSearchEngines.php~
[edit]
[-] RepairBoards.php
[edit]
[-] Class-BrowserDetect.php
[edit]
[+]
ReCaptcha
[-] Subs-List.php
[edit]
[-] Notify.php~
[edit]
[-] ManageSettings.php
[edit]
[-] RepairBoards.php~
[edit]
[-] Subs-Themes.php
[edit]
[-] Search.php
[edit]
[-] SearchAPI-Fulltext.php
[edit]