This mod require Spellchecking to be enabled and working correctly.
What it does: For every word that is spelt incorrectly, user loses 2 times Per Word Bonus.
WARNING: If you make this change, you might find that SMFShop will have issues uninstalling and updating to future version. To correct this, you will need to take this out when you go and uninstall or patch.
open Sources/Post.php
Find
// The bonus for each word...
$points += ($modSettings['shopPointsPerWord'] * str_word_count($plaintext));
// ...and bonus for each letter
$points += ($modSettings['shopPointsPerChar'] * strlen($plaintext));
Add After
if(!empty($modSettings['enableSpellChecking']) && function_exists('pspell_new')){
// Okay, this looks funny, but it actually fixes a weird bug.
ob_start();
$old = error_reporting(0);
// See, first, some windows machines don't load pspell properly on the first try. Dumb, but this is a workaround.
pspell_new('en');
// Next, the dictionary in question may not exist. So, we try it... but...
$pspell_link = pspell_new($txt['lang_dictionary'], $txt['lang_spelling'], '', strtr($context['character_set'], array('iso-' => 'iso', 'ISO-' => 'iso')), PSPELL_FAST | PSPELL_RUN_TOGETHER);
error_reporting($old);
ob_end_clean();
// Most people don't have anything but english installed... so we use english as a last resort.
if (!$pspell_link)
$pspell_link = pspell_new('en', '', '', '', PSPELL_FAST | PSPELL_RUN_TOGETHER);
$known_words = array('smf', 'php', 'mysql', 'www', 'gif', 'jpeg', 'png', 'http', 'smfisawesome', 'grandia', 'terranigma', 'rpgs');
$plaintextExploded = explode(" ", $plaintext);
foreach($plaintextExploded as $k => $v) {
if (!(pspell_check($pspell_link, $v) || in_array($v,$known_words)))
$points -= ($modSettings['shopPointsPerWord']*2);
}
}
If you have any issues, please let me know.