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)
-   -   vB Spell :: Spell Checker in WYSIWYG and Standard Modes (https://vborg.vbsupport.ru/showthread.php?t=91850)

tamarian 07-07-2005 10:00 PM

vB Spell :: Spell Checker in WYSIWYG and Standard Modes
 
There's also a vB 3.5 version: https://vborg.vbsupport.ru/showthrea...threadid=92202

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 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:
1. Download vbspell.zip and upload the files and run vbspell_install.php
2. Go to AdminCP > vBulletin Options > vB Spell and edit your usergroup permisisons.
3. For each template where you would like to add a vB Spell, do the following edits (Example: editpost, newreply, newthread, etc.)

Note: For those running PHP in cgi mode and get timeouts while installing the dictionary, you can download the file dictionary_sql_for_php_cgi.zip to import it to mysql through the mysql command line.

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="">
        <input type="hidden" name="toolbar" 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:

<if condition="$show['wysiwyg']">
        <input type="button" class="button" value="Spell Check" onClick="spellCheck('vbform', 'WYSIWYG_HTML', '2');">
<else />
        <input type="button" class="button" value="Spell Check" onClick="spellCheck('vbform', 'message', '1');">
</if>


Other templates:

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: add the the first change (A) in USERCP_SHELL) and the rest (B and C) in modifysignature

Quick reply: . Put change (A) in showthread, above </head>. Then add change B to the beginning of showthread_quickreply. Then find
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" />
Add after it:
HTML Code:

<if condition="$WYSIWYG == 2">
        <input type="button" class="button" value="Spell Check" onClick="spellCheck('vbform', 'WYSIWYG_HTML', '2');">
<else />
        <input type="button" class="button" value="Spell Check" onClick="spellCheck('vbform', 'message', '1');">
</if>

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: Fixed a bug with slashes in text.

Oct 17, 2005: v0.9.5 Cecks for primnary and secondary group permission. Also fixed quoted words.

July 10, 2005: v0.9.4 Added an error if accessing vB Spell directly, like from who's online page.

July 10, 2005: v0.9.3 Fixed a problem with capitalized first letter of words, so chosing a suggested alternative would not alter capitalization.

July 10, 2005: v0.9.2 Fixed a browser bug, fixed an installer issue effecting some, and fixed handling of some special characters.

July 9, 2005: v0.9.1 Learned words in cookies are no longer case sensitive. Abbreviations are ignored and not spell checked.

July 8, 2005. initial release, v0.9

Please click Install if you have installed this mod.

Boofo 07-09-2005 01:32 AM

Is this better to use than Pungo-spell?

tamarian 07-09-2005 01:36 AM

Quote:

Originally Posted by Boofo
Is this better to use than Pungo-spell?

I think so. No need to recompile PHP and install aspell, or rely on the server's config and system call, etc..

Corriewf 07-09-2005 03:17 AM

WOW! This is the best system for spell check I have ever seen. Thank you very much! :)

Is there anyway you could put the above posted template edits in a text file so I can store it in case?

tamarian 07-09-2005 03:21 AM

Quote:

Originally Posted by corriewf
WOW! This is the best system for spell check I have ever seen. Thank you very much! :)

Is there anyway you could put the above posted template edits in a text file so I can store it in case?


Sure thing :)

diettalk 07-09-2005 03:30 AM

Looks great tamarian.

cutetxblonde 07-09-2005 07:31 AM

During step 4 I get this:
-------------------------------------------------------------
Database error in vBulletin 3.0.7:

Invalid SQL: CREATE TABLE vbspell (
word varchar(30) NOT NULL,
sound varchar(10) NOT NULL,
UNIQUE KEY word (word),
KEY sound (sound)
) ENGINE=MyISAM
mysql error: You have an error in your SQL syntax near 'ENGINE=MyISAM' at line 6

mysql error number: 1064

Date: Saturday 09th of July 2005 01:29:23 AM
Script: (my site)/community/admincp/vbspell_install.php?do=install&step=4
--------------------------------------

Where did I mess it up? This is such a simple hack..lol

diettalk 07-09-2005 10:56 AM

My users are getting the good old "you do not have permission to view...." error... I can see it fine and I used my "secret account" and sure enough, "you do not... ".

Mr. Brian 07-09-2005 10:58 AM

Looks cool, will install this and let u know later. :)

-Brian

tamarian 07-09-2005 11:24 AM

Quote:

Originally Posted by cutetxblonde
During step 4 I get this:
-------------------------------------------------------------
Database error in vBulletin 3.0.7:

Invalid SQL: CREATE TABLE vbspell (
word varchar(30) NOT NULL,
sound varchar(10) NOT NULL,
UNIQUE KEY word (word),
KEY sound (sound)
) ENGINE=MyISAM
mysql error: You have an error in your SQL syntax near 'ENGINE=MyISAM' at line

Replace ENGINE=MyISAM with TYPE=MyISAM, or re-upload vbspell_install.php from the zip file. I think ENGINE keyword is for newer MySQL versions.

tamarian 07-09-2005 11:25 AM

Quote:

Originally Posted by diettalk
My users are getting the good old "you do not have permission to view...." error... I can see it fine and I used my "secret account" and sure enough, "you do not... ".

Check the vB Options > vB Spell in the AdminCP. You can click yes to allow all but guests to use it, or explicitly list usergroup ids allowed to use it.

Mr. Brian 07-09-2005 11:41 AM

Do u mind provide me the Queries? I think I need to run it manually.

Thanks.

Mr. Brian 07-09-2005 11:48 AM

I'm stuck at step 5, unable to load the Dictionary.

diettalk 07-09-2005 11:54 AM

didn't see that. Working great now. thanks.

Quote:

Originally Posted by tamarian
Check the vB Options > vB Spell in the AdminCP. You can click yes to allow all but guests to use it, or explicitly list usergroup ids allowed to use it.


Mr. Brian 07-09-2005 12:04 PM

When I click on Spell check it show this:

Quote:

vB Spell installation problem, please notify the webmaster

Any clue?

tamarian 07-09-2005 12:08 PM

Quote:

Originally Posted by Mr. Brian
When I click on Spell check it show this:

Any clue?

I think it's related to the failed step4 you had. I recommend running uninstall, then re-install from the beginning.

tamarian 07-09-2005 12:09 PM

Quote:

Originally Posted by diettalk
didn't see that. Working great now.

Good to hear :)

Gudrune 07-09-2005 12:15 PM

I like this spell checker. Couple things. The installer didn't put prefix for vbspell table. I had to ad vb_vbspell via phpmyadmin. After that the install worked fine.

Is it normal for no misspelled word to open and close right away? Only way the pop-up window stays open is if there is a misspelled word. This happens with both firefox and IE.

Last how would I add a Spell Check on the quick reply? I figured it out for all but that.

Thanks for the nice mod.

Mr. Brian 07-09-2005 12:19 PM

Quote:

Originally Posted by tamarian
I think it's related to the failed step4 you had. I recommend running uninstall, then re-install from the beginning.

I believe something to do with step 5, I just unable to load step 5. Keep getting "The page cannot be displayed" text.

tamarian 07-09-2005 12:31 PM

Quote:

Originally Posted by Gudrune
I like this spell checker. Couple things. The installer didn't put prefix for vbspell table. I had to ad vb_vbspell via phpmyadmin. After that the install worked fine.

Ah, I always forgot about those with table prefix :) Fixed and uploaded in the zip file.

Quote:

Is it normal for no misspelled word to open and close right away? Only way the pop-up window stays open is if there is a misspelled word. This happens with both firefox and IE.
Yes, that's how PungoSpell (vB Spell's ancestor) worked. It basically finds nothing to spell check or suggest, so it closes.

Quote:

Last how would I add a Spell Check on the quick reply? I figured it out for all but that.
Not sure, as I haven't installed it in QR. Check the PungoSpell thread, I think someone posted about it.

tamarian 07-09-2005 12:32 PM

Quote:

Originally Posted by Mr. Brian
I believe something to do with step 5, I just unable to load step 5. Keep getting "The page cannot be displayed" text.

Have you re-uploaded the installer from the new zip file, and started from scratch after a re-install?

Do you have safemode on?

Mr. Brian 07-09-2005 12:47 PM

Hi tamarian,

Do u mind lent me a helping hand? I've no ideal whats wrong with my installing process. Maybe becoz I'm using dailup or?

tamarian 07-09-2005 12:51 PM

Quote:

Originally Posted by Mr. Brian
Hi tamarian,

Do u mind lent me a helping hand? I've no ideal whats wrong with my installing process. Maybe becoz I'm using dailup or?

No problem, let's do it by PM, as I need to see your PHP info and a smuch details as possible :)

Mr. Brian 07-09-2005 03:31 PM

So how?

Code Monkey 07-09-2005 04:53 PM

Most excellent Job.

For quick reply just add the stuff up top to the SHOWTHREAD template. And then add the button code to the showthread_quickreply template.

Aeolian_X 07-09-2005 05:16 PM

So what on PHPSpell do I have to remove to install this... if anything?

Mr. Brian 07-09-2005 05:17 PM

*Brian click Install* :)

tamarian 07-09-2005 05:23 PM

Quote:

Originally Posted by Aeolian_X
So what on PHPSpell do I have to remove to install this... if anything?

You don't have to remove anything, just replace the template edits. Once it's running and you're happy with it, you can then uninstall PHPSpell.

Renada 07-09-2005 06:31 PM

Hi,

Thanks very much for this - its a great addition. :)

I have one question. Is there a way to change the background colour of the spellchecker popup to plain white?

Regards,
Renada

tamarian 07-09-2005 06:40 PM

Quote:

Originally Posted by Renada
I have one question. Is there a way to change the background colour of the spellchecker popup to plain white?

Yes. It currently uses your wysiwyg css class. So you can either edit the wysiwyg class from vB's class editor, or, if you just want to change the background for the spelling window, then edit vbspell_iframe.php

Find:
<body class="wysiwyg" onLoad="assignSelf(); window.parent.startsp();" id="theBody">
And replace the class with another, or replace it with bgcolor="white"

This is on for the framed box in the window. The rest of the spelling window can be modified in the vbspell template.

Aeolian_X 07-09-2005 08:00 PM

I'll be installing this tonight. Thank youvery much!

**Clicks Install and Rocks On!**

tamarian 07-10-2005 02:13 AM

July 10, 2005: v0.9.2 Fixed a browser bug, fixed an installer issue effecting some, and fixed handling of some special characters.

To upgrade, just upload vbspell.php and vbspell.js from the zip file.

Corriewf 07-10-2005 02:31 AM

Quote:

Originally Posted by tamarian
July 10, 2005: v0.9.2 Fixed a browser bug, fixed an installer issue effecting some, and fixed handling of some special characters.

To upgrade, just upload vbspell.php and vbspell.js from the zip file.


One little problem I have. The spell checker shows up on whos online. Now when I click on it I get the message about it being installed wrong. How can I fix this as I know some will click on it? Its no big deal at all if it cant.

tamarian 07-10-2005 02:53 AM

Quote:

Originally Posted by corriewf
One little problem I have. The spell checker shows up on whos online. Now when I click on it I get the message about it being installed wrong. How can I fix this as I know some will click on it? Its no big deal at all if it cant.

Ah, yes, I guess at least we can throw a specific error message for this one :)

Corriewf 07-10-2005 03:05 AM

What would be better is if it redirected them back to whos online so it would seem like nothing happened but a refresh.

tamarian 07-10-2005 04:36 AM

Quote:

Originally Posted by corriewf
What would be better is if it redirected them back to whos online so it would seem like nothing happened but a refresh.

Sure. Put this code in vbspell_iframe.php

Find:

PHP Code:

include('global.php'); 

Place after:

PHP Code:

if (strpos(REFERRER"vbspell") === false) {
        
$url REFERRER;
        eval(
print_standard_redirect("vB Spell cannot be accessed directly"0));                   



Acedeal 07-10-2005 09:06 AM

for the calendar edit your need to find;

PHP Code:

value="$vbphrase[save_event]accesskey="s" tabindex="1" />
        <
input type="reset" class="button" value="$vbphrase[reset_fields]accesskey="r" tabindex="1" /> 

then place your code under that for the spell check button

cutetxblonde 07-10-2005 12:06 PM

Woo hoo! Uploaded the new installer, and it is working like a charm! :) Thank you so much :) *install clicked*

tamarian 07-10-2005 02:57 PM

If anyone here uses the latest Safari browser, please confirm if this works on Safari/Mac. TIA

Corriewf 07-10-2005 06:36 PM

Quote:

Originally Posted by tamarian
Sure. Put this code in vbspell_iframe.php

Find:

PHP Code:

include('global.php'); 

Place after:

PHP Code:

if (strpos(REFERRER"vbspell") === false) {
        
$url REFERRER;
        eval(
print_standard_redirect("vB Spell cannot be accessed directly"0));                   



It doesnt work. Will refer ever ocurance of its opening to the page of which you clicked it on.


All times are GMT. The time now is 04: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.01482 seconds
  • Memory Usage 1,870KB
  • 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
  • (8)bbcode_html_printable
  • (5)bbcode_php_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