?
Path : /home/admin/public_html/old/happyezystyle/board/Sources/ |
Current File : /home/admin/public_html/old/happyezystyle/board/Sources/DbSearch-mysql.php |
<?php /********************************************************************************** * DbSearch-mysql.php * *********************************************************************************** * SMF: Simple Machines Forum * * Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com) * * =============================================================================== * * Software Version: SMF 2.0 RC1 * * Software by: Simple Machines (http://www.simplemachines.org) * * Copyright 2006-2009 by: Simple Machines LLC (http://www.simplemachines.org) * * 2001-2006 by: Lewis Media (http://www.lewismedia.com) * * Support, News, Updates at: http://www.simplemachines.org * *********************************************************************************** * This program is free software; you may redistribute it and/or modify it under * * the terms of the provided license as published by Simple Machines LLC. * * * * This program is distributed in the hope that it is and will be useful, but * * WITHOUT ANY WARRANTIES; without even any implied warranty of MERCHANTABILITY * * or FITNESS FOR A PARTICULAR PURPOSE. * * * * See the "license.txt" file for details of the Simple Machines license. * * The latest version can always be found at http://www.simplemachines.org. * **********************************************************************************/ if (!defined('SMF')) die('Hacking attempt...'); /* This file contains database functions specific to search related activity. // !!! */ // Add the file functions to the $smcFunc array. function db_search_init() { global $smcFunc; if (!isset($smcFunc['db_search_query']) || $smcFunc['db_search_query'] != 'smf_db_query') $smcFunc += array( 'db_search_query' => 'smf_db_query', 'db_search_support' => 'smf_db_search_support', 'db_create_word_search' => 'smf_db_create_word_search', 'db_support_ignore' => true, ); } // Does this database type support this search type? function smf_db_search_support($search_type) { $supported_types = array('fulltext'); return in_array($search_type, $supported_types); } // Highly specific - create the custom word index table! function smf_db_create_word_search($size) { global $smcFunc; if ($size == 'small') $size = 'smallint(5)'; elseif ($size == 'medium') $size = 'mediumint(8)'; else $size = 'int(10)'; $smcFunc['db_query']('', ' CREATE TABLE {db_prefix}log_search_words ( id_word {raw:size} unsigned NOT NULL default {string:string_zero}, id_msg int(10) unsigned NOT NULL default {string:string_zero}, PRIMARY KEY (id_word, id_msg) ) TYPE=InnoDB', array( 'string_zero' => '0', 'size' => $size, ) ); } ?>