Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
vB Spell :: Spell Checker in WYSIWYG and Standard Modes Details »»
vB Spell :: Spell Checker in WYSIWYG and Standard Modes
Version: 0.9.12, by tamarian tamarian is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 3.5.3 Rating:
Released: 07-13-2005 Last Update: 12-25-2005 Installs: 262
Template Edits
Additional Files  
No support by the author.

A 3.6 version by cynix2 is posted here:
https://vborg.vbsupport.ru/showthread.php?t=124578

What this does: vB Spell allows you to install a dictionary (English dictionary included) into your MysQL database, and provide a spell checking window that works in both of vB's editor modes, standard and WYSIWYG.

Background: Many of you liked PungoSpell, but didn't like recompiling PHP for it. Many liked PHPSpell, but didn't like the lack of WYSIWYG support and browser compatibility. vB Spell solved both problems, I hope, by combining the best of each.

Features:
o Supports most recent versions of browsers. Tested on IE, Firefox, Mozilla/Netsacpe, Opera and Konqueror (Konqueror implies Safari, but please confirm Mac folks)
o Learn Feature uses cookies, so it won't increase the database size
o Admin panel options
o Works in WYSIWYG toolbar, Standard toolbar, and no toolbar
o Can be added in full edit mode, quick edit and quick reply.
o Skips quoted text and other tags (PHP, code, etc.)
o Usergroup permisisons
o Template based interface, and uses your default style.
o Link buttons (Thesarus and Lookup) with links to Merriam Webster's online thesarus and dictionary links with the suggestion for misspelled words.

Installation:
Note: There is a french version of vB Spell, by cclaerhout posted here

1. Upload files and run vbspell_install.php
2. Go to AdminCP > vBulletin Options > vB Spell and edit your usergroup permisisons.
3. Template edits: (see alternative method, if you don't mind removing the ieSpell button made by vB : https://vborg.vbsupport.ru/showpost....9&postcount=48)

For each template where you would like to add a vB Spell, do the following edits (Example: editpost, newreply, newthread, etc.)

A. Find:
HTML Code:
</head>
Add before:
HTML Code:
<script src="vbspell.js"></script>
B. Find: (or anywhere in the body)
HTML Code:
$navbar
Add after:
HTML Code:
<form name="spell_form" id="spell_form" method="POST" target="spellWindow" action="vbspell.php">
        <input type="hidden" name="spell_formname" value="">
        <input type="hidden" name="spell_fieldname" value="">
        <input type="hidden" name="spellstring" value="">
</form>
C. Find the submit and preview buttons:
HTML Code:
		<input type="submit" class="button" name="sbutton" value="$vbphrase[save_changes]" accesskey="s" tabindex="1" />
		<input type="submit" class="button" name="preview" value="$vbphrase[preview_changes]" accesskey="p" tabindex="1" />
Add below:
HTML Code:
<input type="button" class="button" value="Spell Check" onClick="spellCheck('vbform', '$editorid', '2');" />

Other templates:

Optional: Other Templates that contain edit boxes are:
USERCP_SHELL just add A before the </head section and B after it. Required for pm_newpm and modifysignature.
editpost
Calendar Templates: calendar_edit
New Posting Templates: newreply, newthread

Quick reply: . Put change A and B in showthread, as the rest, and use this for step C:
HTML Code:
<input type="button" class="button" value="Spell Check" onClick="spellCheck('qrform', '$editorid', '2');" />
Right after this (also in showthread):
HTML Code:
			<input type="submit" class="button" value="$vbphrase[go_advanced]" accesskey="x" title="(Alt + X)" name="preview" tabindex="3" id="qr_preview" onclick="this.form.clickedelm.value = this.value" />
For quick edit in postbit_quickedit, use this for step C (A and B are in showthread):
HTML Code:
		<input type="button" class="button" value="Spell Check" onClick="spellCheck('vbform', '$editorid', '2');" />
After this:
HTML Code:
		<input type="button" class="button" tabindex="1" accesskey="p" value="$vbphrase[go_advanced]" id="{$editorid}_adv" />

History:
December 25, 2005: Security fix for cases where you allow HTML posts and they contain malicious code (Credit goes to Brendan Donahue for finding the issue and alerting TechGuy, and to TechGuy for alerting me to it)
November 2nd. 2005: Fixes a bug with slashes in text.
October 17. 2005: Check for primary and secondary group for permission. Bug fix for quoted words.
September 13, 2005: v0.9.9 Bugfix for JS on IE with RC3
July 15, 2005: v0.9.8 Bugfix for JS code mismatch with template.
July 14, 2005: v0.9.7 Initial release for vB 3.5 beta-4

Please click Install if you have installed this mod.

Scrrenshots: (from the 3.0.7, but it's identical)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #172  
Old 11-06-2005, 01:30 AM
tamarian tamarian is offline
 
Join Date: Oct 2001
Location: Canada
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by thewitt
Have you looked at the integration comments for template editing from message #48? These are very slick and so far seem to work great.

It replaces the IE only enabled ABC-checkmark with this editor. It seems to work really well and only required three template edits.

Comments?

-t
I like it. I've made a link to it in the instructions as an alternative method. Some minor drawbacks are: 1) vbspell.js will be loaded on everypage, and 2) it removed the ieSpell button, which some users may still prefer.
Reply With Quote
  #173  
Old 11-06-2005, 04:52 PM
puertoblack2003's Avatar
puertoblack2003 puertoblack2003 is offline
 
Join Date: Aug 2005
Location: Philadelphia
Posts: 1,073
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

love this hack this reminds me of outlook good program..ok ..maybe you can help me i read through the thread looking for the error messages i get through ie and in firefox don't get any thing to work..everything is installed but when running a test on it i get an error message in ie and in firefox nothing happen can you help me to see where i messed up at.

thanks in advance :ermm:
Reply With Quote
  #174  
Old 11-06-2005, 07:16 PM
tamarian tamarian is offline
 
Join Date: Oct 2001
Location: Canada
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by nievesidenshop
i get an error message in ie and in firefox nothing happen can you help me to see where i messed up at.
This might be due to errors in your template edits.
Reply With Quote
  #175  
Old 11-07-2005, 01:58 AM
puertoblack2003's Avatar
puertoblack2003 puertoblack2003 is offline
 
Join Date: Aug 2005
Location: Philadelphia
Posts: 1,073
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tamarian
This might be due to errors in your template edits.
yep found the problem in template had to double check and forgot to add a script....click installed
Reply With Quote
  #176  
Old 11-07-2005, 11:01 AM
wArDoG wArDoG is offline
 
Join Date: Mar 2004
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by cclaerhout
Your hack is really great and it works with french language. Thanks you very much.

I've just modified the installation process. I find it easier.

Code installation
Put
Code:
<script src="vbspell.js"></script>
at the end of your headinclude template.

Put
Code:
<form name="spell_form" id="spell_form" method="POST" target="spellWindow" action="vbspell.php">
        <input type="hidden" name="spell_formname" value="">
        <input type="hidden" name="spell_fieldname" value="">
        <input type="hidden" name="spellstring" value="">
</form>
at the end of your header template.



Link to the dictionnary

editor_toolbar_on:

Find
Code:
			<if condition="is_browser('ie') AND !is_browser('mac')">
				<td><div class="imagebutton" id="{$editorid}_cmd_spelling"><img src="$stylevar[imgdir_editor]/spelling.gif" width="21" height="20" alt="$vbphrase[check_spelling]" /></div></td>
			</if>
Replace with
Code:
				<td onclick="spellCheck('vbform', '$editorid', '2');"><div class="imagebutton"><img src="$stylevar[imgdir_editor]/spelling.gif" width="21" height="20" alt="$vbphrase[check_spelling]" /></div></td>



postbit_quickedit AND showthread_quickreply :

Find
Code:
	<if condition="is_browser('ie')">
			<td><img src="$stylevar[imgdir_editor]/separator.gif" width="6" height="20" alt="" /></td>
			<td><div class="imagebutton" id="{$editorid}_cmd_spelling"><img src="$stylevar[imgdir_editor]/spelling.gif" width="21" height="20" alt="$vbphrase[check_spelling]" /></div></td>
		</if>
Replace with


Code:
		
		<td><img src="$stylevar[imgdir_editor]/separator.gif" width="6" height="20" alt="" /></td>
		<td onclick="spellCheck('vbform', '$editorid', '2');"><div class="imagebutton"><img src="$stylevar[imgdir_editor]/spelling.gif" width="21" height="20" alt="$vbphrase[check_spelling]" /></div></td>

What does it do ?
It replaces vB spell check with this one. I'm so happy it works with french language

Precision : i've got vB Gold Version
Hi Thanks for the help with this.

What template(s) do I need to edit to get the spell checker ilinked to PM's?

Steve
Reply With Quote
  #177  
Old 11-08-2005, 09:57 PM
seg seg is offline
 
Join Date: Apr 2005
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the Spell Checker mod. Everything works great except for the Quick edit. I was confused by the notes, is this fixed yet, or is it still not supposed to work?
Quote:
Fix: Quick edit no longer works, must switch to advanced mode.
Also, just a suggestion for future versions. It would be nice to have a centralized dictionary where the Admin can allow certain words used by all members of the board.
Reply With Quote
  #178  
Old 11-08-2005, 10:01 PM
seg seg is offline
 
Join Date: Apr 2005
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In the instructions above in the "Other templates:" section there are instructions for the template "pm_newpm"

Quote:
Originally Posted by wArDoG
Hi Thanks for the help with this.

What template(s) do I need to edit to get the spell checker ilinked to PM's?

Steve
Reply With Quote
  #179  
Old 11-09-2005, 05:06 AM
Code Monkey's Avatar
Code Monkey Code Monkey is offline
 
Join Date: May 2004
Posts: 1,080
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

All of a sudden, I notice that this is not working as it did before. Now when I click spellcheck I get the popup and it's just displays the following.

Code:
options['vbspell_allow_all'] OR is_member_of($vbulletin->userinfo, explode(',', $vbulletin->options['vbspell_use_groups']))) $vbulletin->userinfo['can_use_vbspell'] = TRUE; if (!$vbulletin->userinfo['can_use_vbspell'] OR $vbulletin->userinfo['usergroupid'] == 0) print_no_permission(); $PersonalWords = array(); if (!empty($_COOKIE['vbspell_words'])) $PersonalWords = explode(',', urldecode(strtolower($_COOKIE['vbspell_words']))); require_once('./includes/searchwords.php'); // get search engine stop words, to save on queries. function MisSpelled($word) { global $db, $badwords, $PersonalWords; $word = trim($word, "'"); $partial = explode('\'', strtolower($word)); if (count($partial) > 1) $CheckPartial = TRUE; else $CheckPartial = FALSE; if (in_array($partial[0], $PersonalWords)) return FALSE; // User have "learned" this word elseif ($CheckPartial AND in_array(strtolower($word), $PersonalWords)) return FALSE; // User have "learned" this word elseif ($word === strtoupper($word)) return FALSE; // All uppercase, treat as abbriviation, might want to make this an admincp option.. elseif (in_array($partial[0], $badwords)) return FALSE; // Very common word elseif ($CheckPartial AND in_array($partial[0] . $partial[1], $badwords)) return FALSE; // Very common word elseif ($db->query_first("SELECT word FROM " . TABLE_PREFIX . "vbspell WHERE word = '" . addslashes($partial[0]) . "'")) return FALSE; // Found In dictionary else return TRUE; // probably mis-spelled } function Suggest($for) { global $db, $vbulletin; $for = trim($for, "'"); $WordList = array(); $SuggestedList = array(); $Suggestions = $db->query_read("SELECT word FROM " . TABLE_PREFIX . "vbspell WHERE sound = '" . addslashes(metaphone($for)) . "'"); while ($Suggestion = $db->fetch_array($Suggestions)) $WordList[$Suggestion['word']] = levenshtein($for, $Suggestion['word']); asort($WordList); reset($WordList); foreach ($WordList as $word => $distance) if ($distance <= $vbulletin->options['vbspell_levenshtein_distance']) $SuggestedList[] = $word; if ($for === ucfirst($for)) { foreach ($SuggestedList as $key => $word) $SuggestedList[$key] = ucfirst($word); } elseif ($for === strtoupper($for)) { // not possible yet, but might be allowed in admincp. foreach ($SuggestedList as $key => $word) $SuggestedList[$key] = strtoupper($word); } return $SuggestedList; } $mystr = str_replace('\\', '\\\\', $_REQUEST['spellstring']); $mystr = stripslashes($mystr); $FormName = $_POST['spell_formname']; $FieldName = $_POST['spell_fieldname']; // can't have newlines or carriage returns in javascript string $mystr = str_replace("\r", "", $mystr); $mystr = str_replace("\n", "_|_", $mystr); $mystr = trim($mystr); $ignore_sets = '\[QUOT.+\].*\[\/QUOTE\]|'; $ignore_sets .= '\[CODE\].*\[\/CODE\]|'; $ignore_sets .= '\[PHP\].*\[\/PHP\]|'; $ignore_sets .= '\[img\].*\[\/img\]|'; $ignore_sets .= '\[url.*\].*\[\/url\]|'; $ignore_sets .= '.*<\/a>|'; preg_match_all ( "/" . $ignore_sets . "\[[^\]]+\]|[[:alpha:]']+|<[^>]+>|&[^;\ ]+;/im", $mystr, $alphas, PREG_OFFSET_CAPTURE|PREG_PATTERN_ORDER); $mystr = str_replace('\\', '\\\\', $mystr); // this has to be done _after_ the matching. it messes up the // indexing otherwise. I have not figured out exactly why this // happens but I know this fixes it. $mystr = str_replace("\"", "\\\"", $mystr); $js .= 'var mispstr = "'.$mystr.'";'."\n"; $js .= 'var misps = Array('; $curindex = 0; for($i = 0; $i < sizeof($alphas[0]); $i++) { // if the word is an html tag or entity then skip it if (preg_match("/<[^>]+>|&[^;\ ]+;/", $alphas[0][$i][0])) continue; // ignore quotes if (preg_match("/\[QUOTE\].\[\/QUOTE\]/ism", $alphas[0][$i][0])) continue; // ignore BBCODE/VBCODE tags if (preg_match("/\[[^\]]+/", $alphas[0][$i][0])) continue; if (MisSpelled($alphas[0][$i][0])) { $js .= "new misp('" . str_replace("'", "\\'",$alphas[0][$i][0]) . "',". $alphas[0][$i][1] . "," . (strlen($alphas[0][$i][0]) + ($alphas[0][$i][1] - 1) ) . ",["; $suggestions = Suggest($alphas[0][$i][0]); foreach ($suggestions as $suggestion) { $sugs[] = "'".str_replace("'", "\\'", $suggestion)."'"; } if (sizeof($sugs)) { $js .= join(",", $sugs); } unset($sugs); $js .= "]),\n"; $sugs_found = 1; } } if ($sugs_found) $js = substr($js, 0, -2); $js .= ");"; eval('print_output("' . fetch_template('vbspell') . '");'); ?>
Reply With Quote
  #180  
Old 11-09-2005, 05:17 AM
Code Monkey's Avatar
Code Monkey Code Monkey is offline
 
Join Date: May 2004
Posts: 1,080
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Never mind. I forgot I turned off short open tags. This is why you should never use short open tags. *waves finger*



Simple fix by adding php after <? in vbspell.php.
Reply With Quote
  #181  
Old 11-09-2005, 06:23 PM
tamarian tamarian is offline
 
Join Date: Oct 2001
Location: Canada
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by JumpD
Never mind. I forgot I turned off short open tags. This is why you should never use short open tags. *waves finger*



Simple fix by adding php after <? in vbspell.php.

Good point
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:27 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07327 seconds
  • Memory Usage 2,354KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (7)bbcode_code
  • (10)bbcode_html
  • (7)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete