1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77:
<?php
if (!defined('SMF'))
die('No direct access...');
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,
);
}
function smf_db_search_support($search_type)
{
$supported_types = array('fulltext');
return in_array($search_type, $supported_types);
}
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)
) ENGINE=InnoDB',
array(
'string_zero' => '0',
'size' => $size,
)
);
}
?>