Please correct me if I am wrong but, in the installcode:
Code:
<installcode><![CDATA[
$db->hide_errors();
// Create vB Spell Table
$db->query_write("CREATE TABLE IF NOT EXISTS vbspell (
word varchar(30) NOT NULL,
sound varchar(10) NOT NULL,
UNIQUE KEY word (word),
KEY sound (sound)
) TYPE=MyISAM");
// Remove Old vB Spell Table
$db->query_write("DROP TABLE IF EXISTS " . TABLE_PREFIX . "vbspell");
// Add Dictionary Terms
if (is_file("./DICTIONARY.DIC")) {
$start_time = time();
$last_time = 0;
$words_processed = 0;
$FileSize = filesize("./DICTIONARY.DIC");
$fp = fopen("./DICTIONARY.DIC","r");
while (!feof($fp)) {
$data = trim(fgets($fp, 4096));
if ($data != "") {
$words_processed++;
$db->query_write("REPLACE INTO vbspell VALUES('" . addslashes($data) . "', '" . metaphone($data) . "')");
$end_time = time() - $start_time;
if ($end_time > $last_time) {
$loc = ftell($fp);
$percent = round(($loc / $FileSize)*100, 0);
echo construct_phrase($vbphrase['processing_x'], "$words_processed... (".$percent."%)") . "<br />\n";
vbflush();
}
$last_time = $end_time;
}
}
fclose($fp);
}
$db->show_errors();
]]></installcode>
Why is this
Code:
// Remove Old vB Spell Table
$db->query_write("DROP TABLE IF EXISTS " . TABLE_PREFIX . "vbspell");
listed right after the create table? - the way that appears, anyone who sets that up will immediately create a table and then remove it. What should be the case is the Remove old vb Spell Table FIRST, then the Create if not exists. Although on paper, it would appear that it would not delete a regular non-prefixed vbspell table, it does, or in my case, did delete it. We had to manually (twice now - once for initial install, and once for reinstall after I reimported the product) set up the vbspell table.