Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases

Reply
 
Thread Tools
Spell Checker: PungoSpell for vBulletin3 Standard and WYSIWYG modes Details »»
Spell Checker: PungoSpell for vBulletin3 Standard and WYSIWYG modes
Version: 1.6, by tamarian tamarian is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 3.0.7 Rating:
Released: 06-01-2004 Last Update: 12-25-2005 Installs: 68
Template Edits
Additional Files  
No support by the author.

There's also a vB 3.5 version: https://vborg.vbsupport.ru/showthrea...threadid=83258

PungoSpell for vBulletin3 WYSIWYG and Standard mode

Intro: PungoSpell supports WYSIWYG mode disply using DHTML on the spell check popup window. It uses PHP's buitin PSPELL module. Many have this already compiled in, but if not, it's easy to add.

What this hack does This hack modifies the PungoSpell software package from PungoSpell to allow spell checking on vBulletin for both modes, WYSIWYG and standard mode.

Change Log:

v1.6 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)

v1.5. Minor bug fixes

v1.4
1. Fixed scrolling, so the spelling window will scroll to the next mis-spelled word.
2. Changed config defaults to allow the most common configuration. The "Learn" function is turned of by default. Make sure you test it before tunrning it on.
3. Re-worded comments on config options, hopefully they will now make sense.

v1.3
1. Created a new config file (pungo-spell-config.php) to avoid the need to edit checkspelling.php, which is a bit tricky with end of line characters.
2. Added an option to disable the learn feature. This may be needed if your aspell setup does not allow, or not properly setup, for personal wordlists.
3. The language is now defined in the config file as well.

v1.1:
1. Added a "Learn" button. This allows users to add words into the dictionary.
2. Restricted access to members only, with allowed usergroups definable in config file
3. Restrict user groups allowed to use the "Learn" feature. Configurable option.
3. Options to ignore quote blocks, code bloacks, and PHP blocks
4. Added buttons (Thesarus and Lookup) with links to Merriam Webster's online thesarus and dictionary links with the suggestion for misspelled words.
5. Added Quit and Done buttons. One to quite without saving, and one to save without going through the whole post for suggestions.
6. Fixed extra lines added for WYSIWYG paragraphs
7. Made it skip vBCode tags, so it won't spell check URL's

v1.0:
Initial version, . Identical to PungoSpell functionality, but adapted to handle vBulletins's WYSIWYG and standard mode.


Note:
There's another hack for spell checker for vBulletin3 using PHPSpell. You might want to compare both to decide which one you like best.
https://vborg.vbsupport.ru/showthrea...threadid=65723

PHPSpell has a "learn" button, to allow adding new words to the dictionary, PungoSpell does not. PungoSpell has a better WYSIWYG display, while PHPSpell does not hide HTML and vBCode tags. So each one has it's advantages and disadvantages.

In a future release, I'll try to add a "learn" functionality to PungoSpell. (done)

Credit PungoSpell Is a free software using the MIT license. By default, it will work fine in standard mode. This hack will allow it to work for both standard and WYSIWYG.

Requirements: You will need to have PSPELL compiled into your PHP setup. Many have this by default. To find out if you already have it, check your PHP info from the vBulletin Admin Panel: Import & Maintenance > View PHP Info. Search for "pspell". If it's there, you're fine. If not, you can recompile PHP with the "--with-pspell" paramater.

From the readme file:

Quote:
What does it require?
---------------------

PHP 4.3.1 (http://www.php.net) or greater with Pspell support enabled.
If your system doesn't have pspell/aspell installed, see the pspell source page at
http://pspell.sourceforge.net to download it.

What browsers does it work with?
-------------------------------

Only "modern" browsers that support DOM level 2 (http://www.w3.org/TR/DOM-Level-2-Core/) are supported. MSIE 5.5+, Opera 7.2+, NS 6+ should work fine for you. Your milage may vary.
Demo: http://frigate.clemson.edu/local/pun...l/example.html

Bugs: Scrolling down to the misspelled word is not yet working.

Instructions

1. Download the attached file, and unpack into your main forum directory. Make sure the file "custom.pws" is writable by apache, otherwise the "Learn" function will not work.

2. It has English setup by default. If you want it to use any other language, it's easy. Just edit the config file "pungo-spell-config.php".

Change this line:

$my_lang = "en";

"en" stands for English. Change it to the code of the language you want. Like "fr" for French, for example. Make sure your system has the required dictionary. You see the dictionary config by typing "aspell config" at the command line, to see which dictionaries you have.

Also, in the file custom.pws, the first line reads something like:

personal_ws-1.1 en 0

You will need to change en to the language you use, like fr

3. Edit the config section in checkspelling.php to suit your needs:
[code]
// Config section
$my_lang = "en"; // set the language you want, make sure you have the correct aspell dictionary on your system

// Access restriction options
$allow_guests = 0; // Change to 1 if you allow guests to post and use the spell checker
$restrict_groups = 0; // Change to 1 to enable access restriction by group id
$allowd_groups = array (2, 5, 6); // usergroups who can access the spell checker

// Learn function options
$customwordlist = "custom.pws"; // make sure this file is readable by your apache user
$learn_enabled = 0; // set to 1 to enable the learn feature. Make sure you test first, to ensure your server setup allows this.
$restrict_learn_function = 0; // set to 1 if you want to restrict which usergroup id may add words to your dictionary.
$word_list_maintainers = array (2, 5, 6); // usergroups that are allowed to use the "Learn" feature
//

// Ignore options
$ignore_quotes = 1; // 1 means ignore the [QUOTE] block, 0 means spell check within quotes
$ignore_code = 1; // Same but for the
Code:
 tag
 $ignore_php = 1; 				// Same, but for the [PHP] tag 
 
 // end config section
4. Edit each template where you'd like to have the spell checker. For example:

newreply template

A. Find

Code:
</head>
Add above

Code:
<script src="spellcheck.js"></script>

B.
Add somewhere the followin (below $navbar for example)g:
Code:
   <form name="spell_form" id="spell_form" method="POST" target="spellWindow"
                    action="checkspelling.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:

Code:
		<input type="submit" class="button" name="sbutton" value="$vbphrase[submit_reply]" accesskey="s" tabindex="1" />
 		<input type="submit" class="button" name="preview" value="$vbphrase[preview_post]" accesskey="p" tabindex="1" />
Add below:
Code:
           <if condition="DOTOOLBAR!=2">
           <input type="hidden" name="toolbar" value="1" />
           <input type="button" class="button" value="Spell Check" onClick="spellCheck( 'vbform',  'message', '1');">
           <else />
           <input type="hidden" name="toolbar" value="2" />
           <input type="button" class="button" value="Spell Check" onClick="spellCheck( 'vbform',  'WYSIWYG_HTML', '2');">
           </if>
And repeat the same steps for other templates like newthread etc.

Optional: Other Templates that contain edit boxes are:
USERCP_SHELL just add the first change (A) here in above the </head section. Required for pm_newpm and modifysignature.
editpost
Calendar Templates: calendar_edit
New Posting Templates: newreply, newthread
Modify User Options Templates: modifysignature (add the the first change (A) in USERCP_SHELL) and the rest (B and C) here.


Quick reply

1
. Show Thread Templates: Put change (A) in showthread, and the rest (B and C) in showthread_quickreply

2.
Contributed by Boofo:

change:

<if condition="DOTOOLBAR!=2">

to:

<if condition="$WYSIWYG!=2">

I may have missed a few templates, so let me know.


Private Messages

To install in Private Messaging, check Chris's post here:
https://vborg.vbsupport.ru/showpost....6&postcount=84

------

Trouble shooting:

1. If you get a spell check window that says "This is a test". This is most likely due to end of line characters caused by an editor. To resolve this, re-upload the original files with FTP in binary mode. When editing the config file, make sure you use an editor that does not add any end of line characters, such as "vi" or others.

2.
Learn doesn't work: Try this: Change the first line from custom.pws:

personal_ws-1.1 en 0

To:

personal_ws-1.1 english 0

en worked fine for me on Fedora and Gentoo, but I had to change to english on RHE.

-----

Enjoy

P.S. The two screenshots below show the spell check popup menu. One for standard mode, and one for WYSIWYG mode.

Show Your Support

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

Comments
  #62  
Old 06-05-2004, 11:20 PM
dbroomjr dbroomjr is offline
 
Join Date: Aug 2002
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
[/usr/share/aspell]# ls
./                  iso8859-10.dat  iso8859-4.dat  iso8859-8.dat  spell*
../                 iso8859-10.map  iso8859-4.map  iso8859-8.map  standard.kbd
ASCII.dat           iso8859-1.dat   iso8859-5.dat  iso8859-9.dat  unicode.dat
ASCII.map           iso8859-1.map   iso8859-5.map  iso8859-9.map  viscii.dat
en.dat              iso8859-2.dat   iso8859-6.dat  ispell*        viscii.map
english.dat         iso8859-2.map   iso8859-6.map  koi8-f.dat
english_phonet.dat  iso8859-3.dat   iso8859-7.dat  koi8-r.dat
en_phonet.dat       iso8859-3.map   iso8859-7.map  SGML.map
Fatal error: Call to undefined function: pspell_new() in /home/share/public_html/Forum/checkspelling.php on line 26

Still get the same error. As you can see, I now have english and en both in that directory. I have tried changing custom.pws to english and back to en and neither work. Any other idea's?

Also, thanks for the help.

David
Reply With Quote
  #63  
Old 06-05-2004, 11:35 PM
tamarian tamarian is offline
 
Join Date: Oct 2001
Location: Canada
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by dbroomjr
Still get the same error. As you can see, I now have english and en both in that directory. I have tried changing custom.pws to english and back to en and neither work. Any other idea's?
I'm out of ideas..... Does it work when you disable the learn function?
Reply With Quote
  #64  
Old 06-05-2004, 11:41 PM
dbroomjr dbroomjr is offline
 
Join Date: Aug 2002
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tamarian
I'm out of ideas..... Does it work when you disable the learn function?
No, Learn is not enabled and never has been. I just tried enabling it and it errors out on it also. So, I guess I will just uninstall this one until someone can come up with the solution to the problem. I have tried everything I know.

I know its not your script, its bound to be something different in versions, OS's, etc. Just can't track down what it is.

Thanks for the help.

David
Reply With Quote
  #65  
Old 06-06-2004, 01:49 PM
tamarian tamarian is offline
 
Join Date: Oct 2001
Location: Canada
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by dbroomjr
No, Learn is not enabled and never has been. I just tried enabling it and it errors out on it also. So, I guess I will just uninstall this one until someone can come up with the solution to the problem. I have tried everything I know.

I know its not your script, its bound to be something different in versions, OS's, etc. Just can't track down what it is.

Thanks for the help.

David
No problem. I found that there isn't much information out there in the web regarding the combination of aspell and PHP's PSPELL + dictionary and wordlist setup, which indicate it's not used much.

You might want to try the PHPSpell hack.
Reply With Quote
  #66  
Old 06-06-2004, 01:57 PM
Brad Brad is offline
 
Join Date: Nov 2001
Posts: 4,765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very good hack my friend, one of the best I have seen. This will defentaly be installed on my board, I don't try to hack much but you can't pass this one up
Reply With Quote
  #67  
Old 06-06-2004, 02:48 PM
teksigns's Avatar
teksigns teksigns is offline
 
Join Date: Sep 2003
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

mine works fine with learn disabled ......

buts errors with it enabled
Reply With Quote
  #68  
Old 06-08-2004, 04:04 AM
wdarton wdarton is offline
 
Join Date: Apr 2003
Location: Phoenix AZ 85308
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok I have a new error that I didn't see anywhere in this thread. When I hit the spellcheck button, the spellcheck window opens with all of the correct information, but another window pops up on top that says Spell Check complete "ok" then it exits out when you hit ok.

I'm kinda confused.... Help?
Reply With Quote
  #69  
Old 06-08-2004, 09:44 AM
tamarian tamarian is offline
 
Join Date: Oct 2001
Location: Canada
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by wdarton
Ok I have a new error that I didn't see anywhere in this thread. When I hit the spellcheck button, the spellcheck window opens with all of the correct information, but another window pops up on top that says Spell Check complete "ok" then it exits out when you hit ok.

I'm kinda confused.... Help?
This is the default behaviour for PungoSpell, when the text contains not spelling mistakes.
Reply With Quote
  #70  
Old 06-08-2004, 10:54 AM
wdarton wdarton is offline
 
Join Date: Apr 2003
Location: Phoenix AZ 85308
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well except that the text does contain spelling errors. But I think I found the problem. Aspell doesn't have a default dictionary assigned to it. When I do a "aspell dump dicts" I get an "invalid dump" specification, so I'm guesssing that aspell isn't configured properly. I started working on it last night, but didn't get it solved. Still hacking away at it. I'll let you ya know
Reply With Quote
  #71  
Old 06-09-2004, 01:18 PM
floridaideal floridaideal is offline
 
Join Date: Aug 2002
Posts: 136
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello

I also have the same problem as Wdarton, see attached image. I installed it fine and get no errors but soon as I open Spell Check I get "Spell Checking Complete" pop up , it just won't spell check!

Got Pspell and Aspell installed.

Anyone please help!

Thank you

Stuart
Reply With Quote
Reply

Thread Tools

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 07:59 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.04688 seconds
  • Memory Usage 2,332KB
  • 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
  • (5)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
  • (1)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