vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Spell Checker: PungoSpell for vBulletin3 Standard and WYSIWYG modes (https://vborg.vbsupport.ru/showthread.php?t=65737)

tamarian 06-01-2004 10:00 PM

Spell Checker: PungoSpell for vBulletin3 Standard and WYSIWYG modes
 
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.

pjdaley 06-02-2004 02:42 AM

your a genious :devious: **installed**

pjdaley 06-02-2004 02:43 AM

which one do you prefer? or recommend?

Erwin 06-02-2004 02:44 AM

Very cool, mate. :)

tamarian 06-02-2004 03:10 AM

Quote:

Originally Posted by pjdaley
which one do you prefer? or recommend?

I'm not sure, so I'll think aloud for a bit :)

I initially preferred the look and feel of PungoSpell, but then I went for PHPSpell for the "learn" feature.

My forum currently uses PHPSpell, and they never saw PungoSpell. I might switch to PungoSpell for a few days, and then ask my members which one they prefer.

But they are both great spell checkers. Several of our members said they prefer PHPSpell over the IE pligin spell checker.

You can make it available to a small group of members, like moderators, and then have them test each one for a week or so, and then see what they think.

I was thinking of making both available, and set up a profile option for the members to choose their preferred spell checker, and even a third option for external spell checkers, like spellcheck.net but this seems like an overkill, and one interface may be best.

Another idea is to track the "installs" on both hacks, and see which one is preferred by other webmasters.

But, if PungoSpell has a "learn" feature, then Pungo would be my favourite. I'll see if I can hack that feature into it.

Another issue is performance. PHPSpell uses MySQL queries, while PungoSpell uses PHP built-in spell checker. I have not tested the performance yet, but I think Pungo would perform better, especially on big forums. But that's just a guess.

Another excellent Spell checker is the plugin for HTMLArea. But that one would require a total revamp of vB's WYSIWYG.

Another issue is browser support. PungoSpell relies on iframe DOM objects, which require new(er) browsers than PHPSpell, so PHPSpell supports older browsers better, and can accomodate more members. But, IMHO, people should not stick to very old browsers, and they'll have to upgrade eventually.

boydekort 06-02-2004 07:59 AM

I installed this but i get the following error on newreply and newthread.

Code:

runtime error: 'spell_formname' is empty or is not an object
and points to

Code:

h_spellform.spell_formname.value = formName;
what could be the problem ?

djohn 06-02-2004 09:47 AM

imho, the other one looked much cooler ;)

tamarian 06-02-2004 11:49 AM

Quote:

Originally Posted by boydekort
I installed this but i get the following error on newreply and newthread.

Code:

runtime error: 'spell_formname' is empty or is not an object
and points to

Code:

h_spellform.spell_formname.value = formName;
what could be the problem ?

Try the instructions again (updated), I missed an important part, this bit is also needed in the template:

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>


boydekort 06-02-2004 12:57 PM

K I added it and now I get a popup with a box below but in top says requested url not found. For what file is it looking then ? I guess it looks for checkspelling.php but when I view source that link points correct.

see below :

http://www.justpron.org/spell.jpg

tamarian 06-02-2004 01:16 PM

Quote:

Originally Posted by boydekort
K I added it and now I get a popup with a box below but in top says requested url not found. For what file is it looking then ? I guess it looks for checkspelling.php but when I view source that link points correct.

It needs the 4 files: (iframedoc.html checkspelling.php spellcheck.js spellwin.php) to be in the same directory as vB files.

My bad! I didn't include iframedoc.html in the zip file. It's now included.

If it doesn't work, pm me with a guest account and I'll check it for you.

boydekort 06-02-2004 03:01 PM

thanks for your quick help m8.

Working perfect

installed!

it was the missing Iframe.html

[edit] and ooh yeah for templates I think editpoll would also be usefull.[/edit]

RickFla 06-02-2004 03:28 PM

*installed*

Thanks for the hack, I am the world's worse speller, so I think it will help me more than my users :)

msimplay 06-02-2004 03:38 PM

i wish i had pspell

MindTrix 06-02-2004 04:20 PM

Am i missing something? i uploaded the files to the root directory and made the template changes, but everytime i do spell check, it says its complete etc, but it wont correct the spelling mistakes or even notice them.

tamarian 06-02-2004 04:59 PM

Quote:

Originally Posted by MindTrix
Am i missing something? i uploaded the files to the root directory and made the template changes, but everytime i do spell check, it says its complete etc, but it wont correct the spelling mistakes or even notice them.

Does your server have aspell dictionaries? Check your aspell config by typeing "aspel config" at the command prompt. And verify the dictionary existed at that path. If that doesn't help, PM a guest account if you want, and I'll check it out.

MindTrix 06-02-2004 05:09 PM

yeah teh pspell thing is there and enabled, so the config says.

tamarian 06-02-2004 05:21 PM

Quote:

Originally Posted by MindTrix
yeah teh pspell thing is there and enabled, so the config says.

That's not what I wanted to check :)
Quote:

Does your server have aspell dictionaries? Check your aspell config by typeing "aspel config" at the command prompt. And verify the dictionary existed at that path.

MindTrix 06-02-2004 05:28 PM

what command prompt? :s

tamarian 06-02-2004 05:33 PM

Quote:

Originally Posted by MindTrix
what command prompt? :s

If you SSH to your server, you just type:

aspell config

MindTrix 06-02-2004 06:07 PM

Well its not my host etc, im helpin runnin it for someone else, the control panel is PLESK and its CRAP!!! well Assassingod was lost with it aswell so i give up :) Im putting it down to a crap host.

It says in the readme.txt u need a php version etc, and this host only has 4.0.1 installed. Old huh

tamarian 06-02-2004 06:15 PM

Quote:

Originally Posted by MindTrix
It says in the readme.txt u need a php version etc, and this host only has 4.0.1 installed. Old huh

Good point. I've added this info to the first post, so others don't have go through what you went through :)

msimplay 06-02-2004 07:05 PM

Quote:

Originally Posted by MindTrix
Well its not my host etc, im helpin runnin it for someone else, the control panel is PLESK and its CRAP!!! well Assassingod was lost with it aswell so i give up :) Im putting it down to a crap host.

It says in the readme.txt u need a php version etc, and this host only has 4.0.1 installed. Old huh

wow i just checked the demo's for plesk its really poop i'd never use that
infact i'm very accustomed to cpanel i doubt i'd move from linux hosting

Bad Bunny 06-03-2004 04:41 PM

Quote:

Originally Posted by msimplay
wow i just checked the demo's for plesk its really poop i'd never use that
infact i'm very accustomed to cpanel i doubt i'd move from linux hosting

I believe plesk and cpanel are simply competing products that you use on *nix servers. Both cost money, but cpanel costs a bit more for the person actually running the server.
I could be wrong though.

tamarian 06-04-2004 12:52 AM

Updated :)

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

tamarian 06-04-2004 01:04 AM

If anyone downloaded the zip file in the last 10 minutes (prior to this post), please re-download. There was a parse error.

pjdaley 06-04-2004 03:25 AM

doesn't this mean that Pungo is better then phpspell?

msimplay 06-04-2004 05:54 AM

Quote:

Originally Posted by Bad Bunny
I believe plesk and cpanel are simply competing products that you use on *nix servers. Both cost money, but cpanel costs a bit more for the person actually running the server.
I could be wrong though.

lol plesk and cpanel may well be competing products but Plesk is very rubbish for an end user like myself

pjdaley 06-04-2004 09:35 AM

yes cpanel does actually cost more. i tried out both... =/ cpanel pwns plesk anyday

tamarian 06-04-2004 10:48 AM

Quote:

Originally Posted by pjdaley
doesn't this mean that Pungo is better then phpspell?

Well, they're now equal, feature-wise, as far as the end user is concerned..

If I can get the auto-scrolling (ScrollIntoView) thing working, I think I'll switch to Pungo..

tamarian 06-04-2004 11:53 AM

Quote:

Originally Posted by boydekort
[edit] and ooh yeah for templates I think editpoll would also be usefull.[/edit]

editpoll has not text box, just editing of poll options.

sketch42 06-04-2004 01:13 PM

Quote:

Originally Posted by tamarian
Updated :)

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

i will be installing this in a few ... i was about to stick with phpspell... but than u post this infor , i hope this works :classic:

NuclioN 06-04-2004 01:29 PM

I've chmod 777 the custom.pws but it not adds new words. Maybe i'm doing something wrong?

sketch42 06-04-2004 02:14 PM

Quote:

Originally Posted by NuclioN
I've chmod 777 the custom.pws but it not adds new words. Maybe i'm doing something wrong?

same here its not learning.... also i wanted to add this to quick reply how would i do that

sketch42 06-04-2004 02:28 PM

not checking spelling in pm's... get this is a test

tamarian 06-04-2004 03:55 PM

For those who don't have the "learn" function working, try this:

Edit the checkspelling.php file and

Change this:

$customwordlist = "custom.pws";

To this:

$customwordlist = "/path/to/file/custom.pws";

i.e., enter the path to the custom.pws file.

Sketch: It will not show in your pm template, until you edit the USERCP_SHELL and pm_newpm as mentioned in the template section.

sketch42 06-04-2004 03:57 PM

Quote:

Originally Posted by tamarian
For those who don't have the "learn" function working, try this:

Edit the checkspelling.php file and

Change this:

$customwordlist = "custom.pws";

To this:

$customwordlist = "/path/to/file/custom.pws";

i.e., enter the path to the custom.pws file.

Sketch: It will not show in your pm template, until you edit the USERCP_SHELL and pm_newpm as mentioned in the template section.

i have edited it... and i kept getting the test page when i clicked spell check... the button was there it just didnt work... can u post what to edit for this to show in quick reply...

ill test these changes when i get bak to work lol...

tamarian 06-04-2004 06:25 PM

Quote:

Originally Posted by sketch42
i have edited it... and i kept getting the test page when i clicked spell check... the button was there it just didnt work...

If you get the test page, this means youhave an error in the javascript. This is most likely due to your editor inserting extra characters into the file. To fix this, re-upload checkspelling.php.

Quote:

can u post what to edit for this to show in quick reply...
I think you will need to put the <head> change (A) in showthread template, and the other changes (B and C) in the showthread_quickreply template.

tamarian 06-04-2004 06:27 PM

Note to those of you using this in other languages:

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

personal_ws-1.1 en 2

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

sketch42 06-04-2004 07:05 PM

Quote:

Originally Posted by tamarian
For those who don't have the "learn" function working, try this:

Edit the checkspelling.php file and

Change this:

$customwordlist = "custom.pws";

To this:

$customwordlist = "/path/to/file/custom.pws";

i.e., enter the path to the custom.pws file.
its in my root path so its /custom.pws

i did that and still the learn mode isnt working

im using WinSyntax for my php editor

sketch42 06-04-2004 07:23 PM

ok also i noticed that when i have the quote options set to 1 and try using the spell check i get "this is a test"


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

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01824 seconds
  • Memory Usage 1,892KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (11)bbcode_code_printable
  • (20)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete