[RC] PHPBB Spell Checker 1.06p - 09/20/05

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Nathan_Anderson
Registered User
Posts: 755
Joined: Tue Mar 19, 2002 5:04 pm
Contact:

Post by Nathan_Anderson »

robert_b wrote:
Nathan_Anderson wrote:
robert_b wrote:Can I change the spelling of some of the buttons?...


Check the spell_english, I believe it has the proper Language_Text that you need to change.

Nathan.

Thanks, yes, that was the file and the changes work.

Am I correct that when someone clicks Learn, it doesn't put the word in the dictionary but it is only for that person at that time?

Bob


That is correct, learn uses a cookie. So Learned only works for that user.

Nathan.
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

asinshesq wrote: I've been using this mod for about a year and never had any problems with it (actually I love it). But a few days ago I found the following lines in my php error log:

Code: Select all

[22-Jun-2005 11:22:46] PHP Notice:  Undefined variable: Word_Is_Case in C:\Program Files\Apache Group\Apache2\htdocs\jdaforum\phpbb2\spelling\spellcheck.php on line 240

[22-Jun-2005 11:22:46] PHP Notice:  Undefined variable: Word_Is_Case in C:\Program Files\Apache Group\Apache2\htdocs\jdaforum\phpbb2\spelling\spellcheck.php on line 241
Those lines were repeated a ton of times but they were all logged at exactly the same time.

Anyway, I took a quick look at the code around where it was complaining and it looks like Word_Is_Case is in fact well defined before lines 240 and 241 in spellcheck.php no matter what path the various if statements take. So I don't know what these warnings are about. It may just be one of those momentary lapses where the server somehow messes up...but I wondered if anyone else has seen something like this or if anyone can tell from the error message why I would ever get that warning (but remember I have only gotten it once in the last year).


Any thoughts on this? It happened again to me.

I noticed when lookinjg at the code that there is a line where $Word_Is_Case gets set to 0 but $Word_Is_Case is only tested in the file to see if it is set to 1 or 2. So what does that line setting it to 0 do? The line where it gets set to zero is this:

Code: Select all

if (strtolower($original_word_to_check) == $original_word_to_check) $Word_Is_Case = 0;
Seems to me that if I change that line to this:

Code: Select all

$Word_Is_Case = 0;
I will get rid of the error without impacting the function of the file (since it would still get set to 1 or 2 in the following loines in the cases where it is supposed to).

Reaction?
Nathan_Anderson
Registered User
Posts: 755
Joined: Tue Mar 19, 2002 5:04 pm
Contact:

Post by Nathan_Anderson »

asinshesq wrote:
asinshesq wrote:I've been using this mod for about a year and never had any problems with it (actually I love it). But a few days ago I found the following lines in my php error log:

Code: Select all

[22-Jun-2005 11:22:46] PHP Notice:  Undefined variable: Word_Is_Case in C:\Program Files\Apache Group\Apache2\htdocs\jdaforum\phpbb2\spelling\spellcheck.php on line 240

[22-Jun-2005 11:22:46] PHP Notice:  Undefined variable: Word_Is_Case in C:\Program Files\Apache Group\Apache2\htdocs\jdaforum\phpbb2\spelling\spellcheck.php on line 241
Those lines were repeated a ton of times but they were all logged at exactly the same time.

Anyway, I took a quick look at the code around where it was complaining and it looks like Word_Is_Case is in fact well defined before lines 240 and 241 in spellcheck.php no matter what path the various if statements take. So I don't know what these warnings are about. It may just be one of those momentary lapses where the server somehow messes up...but I wondered if anyone else has seen something like this or if anyone can tell from the error message why I would ever get that warning (but remember I have only gotten it once in the last year).


Any thoughts on this? It happened again to me.

I noticed when lookinjg at the code that there is a line where $Word_Is_Case gets set to 0 but $Word_Is_Case is only tested in the file to see if it is set to 1 or 2. So what does that line setting it to 0 do? The line where it gets set to zero is this:

Code: Select all

if (strtolower($original_word_to_check) == $original_word_to_check) $Word_Is_Case = 0;
Seems to me that if I change that line to this:

Code: Select all

$Word_Is_Case = 0;
I will get rid of the error without impacting the function of the file (since it would still get set to 1 or 2 in the following loines in the cases where it is supposed to).

Reaction?


I suspect it is a word like "hOwdY" mixed case. Then it is unable to match the case and it spits out the error. I'll have to add a default in. Good catch.

Nathan.
robert_b
Registered User
Posts: 76
Joined: Sat Sep 03, 2005 2:43 pm

Post by robert_b »

Using the standalone version? From the install docs, I get the impression that I can use phpSpell with other boards but more to my interest (it's working great with my phpBB) is some forms I have that relate to my phpBB but are not directly integrated. In other words, standalone forms. Can I install phpSpell to spellcheck my PHP-generated forms. For example, I have a form that people can get to (via URL or via link within a post on my phpBB) that asks some questions and has a few <textarea> fields. Can I install phpSpell to work with those forms as well?

Bob
Nathan_Anderson
Registered User
Posts: 755
Joined: Tue Mar 19, 2002 5:04 pm
Contact:

Post by Nathan_Anderson »

robert_b wrote: Using the standalone version? From the install docs, I get the impression that I can use phpSpell with other boards but more to my interest (it's working great with my phpBB) is some forms I have that relate to my phpBB but are not directly integrated. In other words, standalone forms. Can I install phpSpell to spellcheck my PHP-generated forms. For example, I have a form that people can get to (via URL or via link within a post on my phpBB) that asks some questions and has a few <textarea> fields. Can I install phpSpell to work with those forms as well?

Bob


Yep. phpSpell can be integrated with any textarea form.

Nathan.
robert_b
Registered User
Posts: 76
Joined: Sat Sep 03, 2005 2:43 pm

Post by robert_b »

Nathan_Anderson wrote: Yep. phpSpell can be integrated with any textarea form.

Nathan.

Can the form have more than one textarea? The phpBB/survey form I have has 5 textarea fields (and 20 text input fields -- I take it that the text input fields are not spellchecked? (I use a Firefox plugin speller that is interesting because I can spellcheck any field that the cursor is in, or highlight sections of text and just the highlighted area is spellchecked. Nice plugin.) Anyway, was curious about multiple textarea field forms support for phpSpell.

Bob
Nathan_Anderson
Registered User
Posts: 755
Joined: Tue Mar 19, 2002 5:04 pm
Contact:

Post by Nathan_Anderson »

robert_b wrote:
Nathan_Anderson wrote:Yep. phpSpell can be integrated with any textarea form.

Nathan.

Can the form have more than one textarea? The phpBB/survey form I have has 5 textarea fields (and 20 text input fields -- I take it that the text input fields are not spellchecked? (I use a Firefox plugin speller that is interesting because I can spellcheck any field that the cursor is in, or highlight sections of text and just the highlighted area is spellchecked. Nice plugin.) Anyway, was curious about multiple textarea field forms support for phpSpell.

Bob


You would basically have to have a separate spellcheck button per textarea.

Nathan.
Koyaanis
Registered User
Posts: 74
Joined: Sun Sep 04, 2005 3:05 pm

Dictionary in Separate Database

Post by Koyaanis »

Problem: The dictionary word list was getting added to my normal phpBB database. That's all fine and well, but I didn't like having an extra 10+ megs of data to back-up every time I did a full phpBB SQL database back-up. (Data that could easily be imported again from the dictionary word-list files, with just a few clicks.)

Solution: I made a separate 'dictionary' SQL database, and used phpSpell in "Native MySQL" mode with phpBB. (Following the somewhat confusing installation instructions, I got it working just fine.)

I added the english word list to the 'dictionary' database just fine, tested it with the spell-check feature in phpBB, all's well and good. I deleted the 'spelling_words' table from my phpBB SQL database, tested the spelling function in phpBB again to make sure it was now reading words from the new 'dictionary' database ... works great!

Conversion to new database is solved, and my original phpBB database is back to its manageable size.


NEW Problem: (somewhat minor, but important)

Realizing that spell_phpBB was originally getting my smilies code list from my original database, I copied over the 'smilies' table from my phpBB database to the new 'dictionary' database. Great, that's solved, but I can't get "spell_MySQL.php" to create the 'smilies" data needed from the new 'dictionary' database.

I've tried editing spell_config.php to include the variables needed being set properly (phpBB's settings to MySQL's settings, and importing the "Create_PHPBB_Smilies" code from the spell_phpbb.php file to spell_MySQL.php file ... but so far, no go. I get various variables or tables, or whatnot not being set properly (reported when I run spell_diags.php).

Is there a simple way to do what I'd like to do?? I'm no programmer, I'm just going on cues and clues from what I see in the existing code.

Summary: I'd like to use a separate database for the word list, but keep the other phpBB specific (i.e. smilies table query) functions intact.

Yes, I realize I could tediously edit that "$Spell_Config['Symbol_Tags'] =" line in my spell_config.php file, but I have over 150 new symbols, and each time I change them I'd have to tediously hand-edit that line. Each time my smilies data changes I'd like to just import the new 'smilies' table from my 'phpBB' database to the new 'dictionary' database. So much simpler.

(Great MOD by the way... THANKS!!!!)
Koyaanis
Registered User
Posts: 74
Joined: Sun Sep 04, 2005 3:05 pm

Post by Koyaanis »

In the meantime, I added my 200+ smilies to the 'Symbol_Tags' table in spell_config.php, but now I find a new problem. Any smilie strings that contain the ' (apostrophe) character in them throws off the php code for that string. Took me quite a long time to hunt down and find the 5 that wouldn't allow it to work.

There's got to be an easier way (and that would be what I need in the above post).
Nathan_Anderson
Registered User
Posts: 755
Joined: Tue Mar 19, 2002 5:04 pm
Contact:

Post by Nathan_Anderson »

Koyaanis wrote: In the meantime, I added my 200+ smilies to the 'Symbol_Tags' table in spell_config.php, but now I find a new problem. Any smilie strings that contain the ' (apostrophe) character in them throws off the php code for that string. Took me quite a long time to hunt down and find the 5 that wouldn't allow it to work.

There's got to be an easier way (and that would be what I need in the above post).


The easist way would be to use the phpbb module, and then in the spell ENGLISH file, change the $DB_TableName from:

Code: Select all

 $DB_TableName=$table_prefix."spelling_words"; 
to:

Code: Select all

  $DB_TableName='yourdatbaasename.spelling_words';
Assuming that your new spelling_words table does NOT have a prefix.

Nathan.
TheYoMan
Registered User
Posts: 19
Joined: Sat Mar 12, 2005 12:41 am

Post by TheYoMan »

Hello,

First, Thank you for this wonderfull mod ;)

I have installed it on my phpBB forum, but i have a problem.


When, in then admin panel, I clic on "SpellCheck' I have this error message :
Warning: main(spell_phpbb.php): failed to open stream: No such file or directory in /var/www/free.fr/.../forums/spelling/spell_config.php on line 157

Warning: main(): Failed opening 'spell_phpbb.php' for inclusion (include_path='/var/www/free.fr/.../include:.') in /var/www/free.fr/.../forums/spelling/spell_config.php on line 157

You must choose a Database Type in the Spell Configuration file.


So I checked my "spell_config.php" file to choose a database type on it... but il is right configured.
// ----------------------------------------------
// Set Default Database Engine
// If you are using phpbb thiw will Need to be 'PHPBB'
// If this is Hivemail; then set it to 'Hivemail'
// if this is PHPNuke then set it to phpnuke
//
// If you are attempting to integrate yourself into
// a product then use 'MySQL' and change the parameters
// ----------------------------------------------
// ----- Uncomment which ever line you need -----
// ----------------------------------------------
$Spell_Config['DB_Type'] = 'PHPBB';
// $Spell_Config['DB_Type'] = 'Hivemail';
// $Spell_Config['DB_Type'] = 'MySQL';
// $Spell_Config['DB_Type'] = 'PHPNuke';
// $Spell_Config['DB_Type'] = 'PSPELL';
// $Spell_Config['DB_Type'] = 'Invision';
// $Spell_Config['DB_Type'] = 'vBulletin';
// $Spell_Config['DB_Type'] = 'phpMail';


Can you help me please ?
Nathan_Anderson
Registered User
Posts: 755
Joined: Tue Mar 19, 2002 5:04 pm
Contact:

Post by Nathan_Anderson »

TheYoMan wrote: Hello,

First, Thank you for this wonderfull mod ;)

I have installed it on my phpBB forum, but i have a problem.


When, in then admin panel, I clic on "SpellCheck' I have this error message :
Warning: main(spell_phpbb.php): failed to open stream: No such file or directory in /var/www/free.fr/.../forums/spelling/spell_config.php on line 157

Warning: main(): Failed opening 'spell_phpbb.php' for inclusion (include_path='/var/www/free.fr/.../include:.') in /var/www/free.fr/.../forums/spelling/spell_config.php on line 157

You must choose a Database Type in the Spell Configuration file.
Copy the spell_phpbb.php from the phpbb directory in the mod into the same spelling directory. You don't have it in that directory or your permsisions on it are such that php can't read it.

Nathan.
robert_b
Registered User
Posts: 76
Joined: Sat Sep 03, 2005 2:43 pm

Re: Dictionary in Separate Database

Post by robert_b »

Koyaanis wrote: Problem: The dictionary word list was getting added to my normal phpBB database. That's all fine and well, but I didn't like having an extra 10+ megs of data to back-up every time I did a full phpBB SQL database back-up. (Data that could easily be imported again from the dictionary word-list files, with just a few clicks.)

Solution: I made a separate 'dictionary' SQL database, and used phpSpell in "Native MySQL" mode with phpBB. (Following the somewhat confusing installation instructions, I got it working just fine.)

I like this idea and will give it a try to install as "Native MySQL" as well because I'm going to use phpSpell for some other things such as forms and would just as soon it reside in its own database.

For what it's worth, if you back up phpBB from within the Admin, it won't back up the speller table. It only backs up the tables that originally come with phpBB as far as I can tell. You have to explicitly type in any additional tables. Similarly, if using another backup procedure, you can exclude tables. What I did, using phpMyAdmin, was make a backup of the spelling table only (though as you point out it's easy enough to reinstall, albeit without the words subsequently added). When I make a phpBB backup via the Admin, it doesn't have the speller table unless I type it into the additional tables field. Nevertheless, I do like the idea of setting it up separately and will try to give that a go.

Bob
TheYoMan
Registered User
Posts: 19
Joined: Sat Mar 12, 2005 12:41 am

Post by TheYoMan »

Nathan_Anderson wrote:
TheYoMan wrote:Hello,
First, Thank you for this wonderfull mod ;)
I have installed it on my phpBB forum, but i have a problem.
When, in then admin panel, I clic on "SpellCheck' I have this error message :
Warning: main(spell_phpbb.php): failed to open stream: No such file or directory in /var/www/free.fr/.../forums/spelling/spell_config.php on line 157
Warning: main(): Failed opening 'spell_phpbb.php' for inclusion (include_path='/var/www/free.fr/.../include:.') in /var/www/free.fr/.../forums/spelling/spell_config.php on line 157
You must choose a Database Type in the Spell Configuration file.

Copy the spell_phpbb.php from the phpbb directory in the mod into the same spelling directory. You don't have it in that directory or your permsisions on it are such that php can't read it.
Nathan.


Thank's . All Is good. :)

But I have a probleme when I use the Spell_Checker (in french). It cut some word....
For exemple : the word "évolution" is cut on "é" and "volution"... and the spell_checker want to change "volution" by "évolution". So if I accept the entire word become "éévolution" (2 é).
What can I do to correct this big probleme please ?
Nathan_Anderson
Registered User
Posts: 755
Joined: Tue Mar 19, 2002 5:04 pm
Contact:

Post by Nathan_Anderson »

TheYoMan wrote:
Nathan_Anderson wrote:
TheYoMan wrote:Hello,
First, Thank you for this wonderfull mod ;)
I have installed it on my phpBB forum, but i have a problem.
When, in then admin panel, I clic on "SpellCheck' I have this error message :
Warning: main(spell_phpbb.php): failed to open stream: No such file or directory in /var/www/free.fr/.../forums/spelling/spell_config.php on line 157
Warning: main(): Failed opening 'spell_phpbb.php' for inclusion (include_path='/var/www/free.fr/.../include:.') in /var/www/free.fr/.../forums/spelling/spell_config.php on line 157
You must choose a Database Type in the Spell Configuration file.

Copy the spell_phpbb.php from the phpbb directory in the mod into the same spelling directory. You don't have it in that directory or your permsisions on it are such that php can't read it.
Nathan.


Thank's . All Is good. :)

But I have a probleme when I use the Spell_Checker (in french). It cut some word....
For exemple : the word "évolution" is cut on "é" and "volution"... and the spell_checker want to change "volution" by "évolution". So if I accept the entire word become "éévolution" (2 é).
What can I do to correct this big probleme please ?


You need to create a spell_french.php;

Nathan.
Locked

Return to “[2.0.x] MODs in Development”