Location: PHPKode > projects > DDL CMS > Upload these files to your webspace/admin/updatedic.inc
<h2>Update Custom Dictionary</h2>
<?php
	if(isset($_POST) && is_array($_POST) && count($_POST) > 0 && array_key_exists('sub', $_POST))
	{
?>
<p>
Updating custom dictionary:  <?php echo BASEDIR; ?>custom_dictionary.txt...
<br />
<?php
	$pspellLink = pspell_new('en');
	$pspellCustomLink = pspell_new_personal(BASEDIR . 'custom_dictionary.txt', 'en');
	$downloadsQuery = dbcom('SELECT title FROM downloads ORDER BY id DESC LIMIT 10000;');
	while($downloadsArray = mysql_fetch_assoc($downloadsQuery))
	{
		$words = preg_split('/ /', $downloadsArray['title'], -1, PREG_SPLIT_NO_EMPTY);
		for($i = 0; $i < count($words); $i++)
		{
			if(pspell_check($pspellLink, $words[$i]) !== TRUE)
			{
				if(pspell_check($pspellCustomLink, $words[$i]) !== TRUE)
				{
					@pspell_add_to_personal($pspellCustomLink, $words[$i]);
				}
			}
		}
	}
	pspell_save_wordlist($pspellCustomLink);
?>
	<br>
	Done!
</p>
<?php
	}
	else
	{
?>
<p>The Custom Dictionary is used to better match search criteria for the search assistant ("Did you mean") feature of the search function. 
It takes the most recent 10,000 downloads, breaks the titles apart by space, and searches the English dictionary for the correct spelling. 
If a correct spelling is not found, it searches the custom dictionary for the entry and if not found, adds the word to the custom dictionary. 
Updating this dictionary every so often will ensure that search terms are matched more accurately.</p>
<p>Click here to update the custom dictionary now:</p>
<br>
<form action="ddl.php?go=updatedic" method="post">
<input type="submit" value="Update" name="sub" class="formbutton">
</form>
<?php
	}
?>
Return current item: DDL CMS