Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
vB Spell :: Spell Checker in WYSIWYG and Standard Modes Details »
vB Spell :: Spell Checker in WYSIWYG and Standard Modes
Mod Version: 0.9.12, by tamarian (Member) tamarian is offline
Developer Last Online: Mar 2016 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 3.5.3 Rating: (2 votes - 4.50 average) Installs: 262
Released: 14 Jul 2005 Last Update: 26 Dec 2005 Downloads: 131
Not Supported Template Edits Additional Files  

A 3.6 version by cynix2 is posted here:
http://www.vbulletin.org/forum/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 : http://www.vbulletin.org/forum/showp...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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Add before:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

B. Find: (or anywhere in the body)

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Add after:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

C. Find the submit and preview buttons:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Add below:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Right after this (also in showthread):

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

For quick edit in postbit_quickedit, use this for step C (A and B are in showthread):

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

After this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


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)

Download Now

Only licensed members can download files, Click Here for more information.

Screenshots

Click image for larger version

Name:	admin.jpg
Views:	3893
Size:	131.8 KB
ID:	32034   Click image for larger version

Name:	standard.jpg
Views:	2131
Size:	76.2 KB
ID:	32035   Click image for larger version

Name:	wysiwyg.jpg
Views:	1694
Size:	85.6 KB
ID:	32036  

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Similar Mod
Mod Developer Type Replies Last Post
New Posting Features vB Spell :: Spell Checker in WYSIWYG and Standard Modes Replicators vBulletin 3.7 Add-ons 105 10 Nov 2011 01:27
vB Spell :: Spell Checker in WYSIWYG and Standard Modes tamarian vBulletin 3.0 Full Releases 212 12 Feb 2009 15:14
PungoSpell Spell Checker for vB3.5 WYSIWYG and Standard mode tamarian vBulletin 3.5 Add-ons 103 23 Oct 2006 11:17
Spell Checker: PungoSpell for vBulletin3 Standard and WYSIWYG modes tamarian vBulletin 3.0 Full Releases 254 16 Jan 2006 20:29

  #346  
Old 28 May 2006, 05:10
boduzapho boduzapho is offline
 
Join Date: Feb 2006
Unhappy Issue on 3.5.4

Just installed this on my clean 3.5.4 When the popup box shows it has only this in it..

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; } function strip_attributes ($html, $attrs) { if (!is_array($attrs)) { $array= array( "$attrs" ); unset($attrs); $attrs= $array; } foreach ($attrs AS $attribute) { // once for ", once for ', s makes the dot match linebreaks, too. $search[]= "/".$attribute.'\s*=\s*".+"/Uis'; $search[]= "/".$attribute."\s*=\s*'.+'/Uis"; // and once more for unquoted attributes $search[]= "/".$attribute."\s*=\s*\S+/i"; } $html= preg_replace($search, "", $html); // do another pass and strip_tags() if matches are still found foreach ($search AS $pattern) { if (preg_match($pattern, $html)) { $html= strip_tags($html); break; } } return $html; } // the safe_html() function // note, there is a special format for $allowedtags, see ~line 90 function safe_html ($html, $allowedtags="") { /* safe_html.php http://chxo.com/scripts/safe_html/ Copyright 2003 by Chris Snyder (csnyder@chxo.com) Free to use and redistribute, but see License and Disclaimer below - Huge thanks to James Wetterau for initial testing and feedback! - Originally posted at http://lists.nyphp.org/pipermail/tal...ay/003832.html Version History: 2005-09-05 - 0.5 -- upgrade to handle cases at http://ha.ckers.org/xss.html 2005-04-24 - 0.4 -- added check for encoded ascii entities 2003-05-31 - 0.3 -- initial public release License and Disclaimer: Copyright 2003 Chris Snyder. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // anything with ="javascript: is right out -- strip all tags if found $pattern= "/=[\S\s]*s\s*c\s*r\s*i\s*p\s*t\s*:\s*\S+/Ui"; if (preg_match($pattern, $html)) { $html= strip_tags($html); return $html; } // anything with encoded entites inside of tags is out, too $pattern= "/<[\S\s]*&#[x0-9]*[\S\s]*>/Ui"; if (preg_match($pattern, $html)) { $html= strip_tags($html); return $html; } // setup -- $allowedtags is an array of $tag=>$closeit pairs, // where $tag is an HTML tag to allow and $closeit is 1 if the tag // requires a matching, closing tag if ($allowedtags=="") { $allowedtags= array ( "p"=>1, "br"=>1, "a"=>1, "img"=>1, "li"=>1, "ol"=>1, "ul"=>1, "font"=>1, "b"=>1, "i"=>1, "em"=>1, "strong"=>1, "del"=>1, "ins"=>1, "u"=>1, "code"=>1, "pre"=>1, "blockquote"=>1, "hr"=>1 ); } elseif (!is_array($allowedtags)) { $array= array( "$allowedtags" ); } // there's some debate about this.. is strip_tags() better than rolling your own regex? // note: a bug in PHP 4.3.1 caused improper handling of ! in tag attributes when using strip_tags() $stripallowed= ""; foreach ($allowedtags AS $tag=>$closeit) { $stripallowed.= "<$tag>"; } //print "Stripallowed: $stripallowed -- ".print_r($allowedtags,1); $html= strip_tags($html, $stripallowed); // also, lets get rid of some pesky attributes that may be set on the remaining tags... // this should be changed to keep_attributes($htmlm $goodattrs), or perhaps even better keep_attributes // should be run first. then strip_attributes, if it finds any of those, should cause safe_html to strip all tags. $badattrs= array("on\w+", "style", "fs\w+", "seek\w+"); $html= strip_attributes($html, $badattrs); // close html tags if necessary -- note that this WON'T be graceful formatting-wise, it just has to fix any maliciousness foreach ($allowedtags AS $tag=>$closeit) { if (!$closeit) continue; $patternopen= "/<$tag\b[^>]*>/Ui"; $patternclose= "/<\/$tag\b[^>]*>/Ui"; $totalopen= preg_match_all ( $patternopen, $html, $matches ); $totalclose= preg_match_all ( $patternclose, $html, $matches2 ); if ($totalopen>$totalclose) { $html.= str_repeat("", ($totalopen - $totalclose)); } } return $html; } $mystr = str_replace('\\', '\\\\', $_REQUEST['spellstring']); $mystr = stripslashes($mystr); $mystr = safe_html($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') . '");'); ?>

Apparently after it includes global.php it dies...

Any help?:surprised:
Reply With Quote
  #347  
Old 30 May 2006, 23:29
Justdave Justdave is offline
 
Join Date: May 2005
Originally Posted by zylstra
4 forms of the word masturbate are mispelled (masterbate) in your dictionary, among many others.

Who provided the dictionary?
Damn, that's fahny! :knockedout:
Reply With Quote
  #348  
Old 02 Jun 2006, 17:05
FFMania FFMania is offline
 
Join Date: Mar 2002
Is it only me or does the hack not functioning properly on the quick post edit template? I tried it on my board by typing something that is wrong into the quick edit box... and when I did a spell check, it just said that "spell check is complete". Anything that I am missing here?
Reply With Quote
  #349  
Old 02 Jun 2006, 21:47
Kihon Kata's Avatar
Kihon Kata Kihon Kata is offline
 
Join Date: Nov 2003
I installed this last year, but never clicked install. WTF uhm Hi

Hey, I noticed that the ZIP says "vBSpell 0 9 12" but when I downloaded it, the version at the top of the php files say "v0.9.7"

Am I seeing something strange here with version differences?
__________________
3MultiMedia.com - Simple, Effective CMS WebDesign

Last edited by Kihon Kata; 02 Jun 2006 at 21:52.
Reply With Quote
  #350  
Old 04 Jun 2006, 14:37
user02934123123 user02934123123 is offline
 
Join Date: Apr 2006
Originally Posted by FFMania
Is it only me or does the hack not functioning properly on the quick post edit template? I tried it on my board by typing something that is wrong into the quick edit box... and when I did a spell check, it just said that "spell check is complete". Anything that I am missing here?
I've had this same problem (and I believe I reported it somewhere above in this thread) -- and have found no way to work around it. It just doesn't work in the quick post edit window. I've found it best not to provide it there in the templates; so there's no spell check button on the Quick Edit in-line editor (it's always available to users who click 'Go advanced' for the full editor).

It would be nice if this bug could be fixed, though.
Reply With Quote
  #351  
Old 04 Jun 2006, 17:33
Zowners Zowners is offline
 
Join Date: Dec 2005
I get that same error, except after it says the spell check is complete, it erases the text in the messagebox.

I also get an error in edit post. I did A B and C from the top because it doesn't say otherwise. When I click the Check Spelling button it just doesn't open and I get the error icon at the bottom left of internet explorer.
Reply With Quote
  #352  
Old 11 Jun 2006, 01:38
moonclamp's Avatar
moonclamp moonclamp is offline
 
Join Date: May 2004
Real name: Paul
Just installed and everything seems to work well
Reply With Quote
  #353  
Old 12 Jun 2006, 15:57
user02934123123 user02934123123 is offline
 
Join Date: Apr 2006
Install doesn't work on vB 3.6b1

Seems this hack doesn't work properly on vB 3.6b1. I've just attemped a fresh install of the hack on my vb 3.6b1 test board, and on step 1 of the vbspell_install.php script, received the following DB error:
Database error in vBulletin 3.6.0 Beta 1:

Invalid SQL:
INSERT INTO settinggroup (grouptitle, displayorder, volatile) VALUES ('vbspell', '999', '0');

MySQL Error : Duplicate entry 'vbspell' for key 1
Error Number : 1062
Date : Monday, June 12th 2006 @ 10:55:55 AM
Script : http://.../admincp/vbspell_install.p...install&step=1
Referrer : http://.../admincp/vbspell_install.php
When can we expect a fix so that vbSpell works with 3.6?
Reply With Quote
  #354  
Old 12 Jun 2006, 17:37
danhaga danhaga is offline
 
Join Date: Mar 2005
Im attempting to install this mod but having trouble. When the installer gets to step 5 it takes a long time and than pops up a window asking me if i want to download the install file.... any ideas?
Attached Images
File Type: jpg spellinstall.jpg (81.1 KB, 16 views)
Reply With Quote
  #355  
Old 13 Jun 2006, 00:27
moonclamp's Avatar
moonclamp moonclamp is offline
 
Join Date: May 2004
Real name: Paul
Originally Posted by moonclamp
Just installed and everything seems to work well
No, maybe not.

If an internet explorer user posts a message with a smiley in it, then spell checks the message from within the preview window their post ends up with < img>< /img> at the end of it.
Reply With Quote
  #356  
Old 13 Jun 2006, 00:51
moonclamp's Avatar
moonclamp moonclamp is offline
 
Join Date: May 2004
Real name: Paul
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
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

at the end of your headinclude template.

Put
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

at the end of your header template.



Link to the dictionnary

editor_toolbar_on:

Find

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Replace with

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.




postbit_quickedit AND showthread_quickreply :

Find

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Replace with



Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


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
This is a better alternative ... but it loses the mouseover hover colour for some reason
Reply With Quote
  #357  
Old 13 Jun 2006, 13:06
danhaga danhaga is offline
 
Join Date: Mar 2005
Ok I need help...

My install gets stuck at Step 5: Load the dictionary. After taking what seems like too long a pop-up appears (see attachment)

I went ahead with the install and added the buttons. Everything seems to work and function just fine but it tells me that a lot of words are wrong which really are not so Im assuming its just not seeing those words in the dictionary because of my error during the install.

Anyone have any suggestions
Attached Images
File Type: jpg spellinstall.jpg (81.1 KB, 11 views)

Last edited by danhaga; 13 Jun 2006 at 13:09.
Reply With Quote
  #358  
Old 16 Jun 2006, 17:38
danhaga danhaga is offline
 
Join Date: Mar 2005
Still looking for help with the above problem... thanks
Reply With Quote
  #359  
Old 16 Jun 2006, 19:40
tamarian tamarian is offline
 
Join Date: Oct 2001
Check for errors in your apache error log
Reply With Quote
  #360  
Old 16 Jun 2006, 20:39
danhaga danhaga is offline
 
Join Date: Mar 2005
Originally Posted by tamarian
Check for errors in your apache error log
how do I do that? i have webhosting thru yahoo so I dunno if i can or not?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

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


New To Site? Need Help?

All times are GMT. The time now is 20:09.

Layout Options | Width: Wide Color: