vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=5)
-   -   PHP Spell Checker intergration into vBulletin (https://vborg.vbsupport.ru/showthread.php?t=54204)

iggy123 06-11-2003 10:00 PM

PHP Spell Checker intergration into vBulletin
 
Not too sure if this is where its meant to go but if it should be moved please move it.

I have been trying to find a simple spell checker to work on my forums for a while -
Eventually i found this one http://www.master-technology.com/phpbb/ which was working with phpbb.
As i have no idea how to code anything - at all!!! I asked one of their support teams to help and they gave me the answers.
So I can't take any of the credit for it, and thank them for helping me out.
At present it doesn't support vbulletin but since talkin to them they are going to be doing so in the near future.

files to upload: 17
files to edit: 1
templates to edit: 1 (possibly 2)

Instructions:
See the attached text file

iggy123 06-11-2003 10:32 PM

Here is the zip file:

Unzip them all to a folder on your server called "Spelling" or the spellchecker don't work.

The instructions are included in the zip as well.

Boofo 06-11-2003 10:36 PM

Does this force the spell check on the user or can he/she click a link to use it if they want to? there are some spellings that the user might not want changed automatically.

iggy123 06-11-2003 10:38 PM

No it doesn't force a spell change on them - it highlights spelling mistakes and gives you an option of - however many you choose - so many words which you can change it too.
If it is a word you use a lot - and you know ppl will understand such as vbulletin there is an "learn" option - and in the spell_admin.php there is an add option to add more words.

there is a working version on my board.

http://clanantivirus.com/forums/ if you wish to check it out.
and attached is a picture of the spell check window

Ian Cunningham 06-12-2003 09:41 AM

wow - this looks like the best and easiest spell checking solution yet!

Ian Cunningham 06-12-2003 10:13 AM

I've made a slight change to integrate the spell check button better:

Quote:

<script language='javascript' src='spelling/spellmessage.js'></script>
<input type="button" class="bgclass" value="Spell Check" onclick="openspell();">
This works EXCELLENTLY!

Check http://www.pcreview.co.uk for another demo

Boofo 06-12-2003 10:27 AM

This is what I am getting when I run the spell_admin.php file:

Quote:

Warning: main(spell_MySQL.php) [function.main]: failed to create stream: No such file or directory in /xxxx/xxxx/xxxxxx_xxxx/forum/spelling/spell_config.php on line 166

Warning: main() [function.main]: Failed opening 'spell_MySQL.php' for inclusion (include_path='') in /xxxx/xxxx/xxxxxx_xxxx/forum/spelling/spell_config.php on line 166
You must choose a Database Type in the Spell Configuration file.
And yes, I have set the DB type to MySQL. Any ideas what I am missing or doing wrong?

iggy123 06-12-2003 11:11 AM

did you add your db information to the spell_config.php?

Also i think i had this issue the first time i ran it - i changed the
spell_config to the following:

In spell_config.php set:
$Spell_Config["DB_Type"] = "pspell";

then put the attached file into your admin folder and run it.

I then had to change it back to:

In spell_config.php set:
$Spell_Config["DB_Type"] = "MySQL";

and it worked.

Boofo 06-12-2003 11:41 AM

This is the error I am getting now.

Quote:

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

iggy123 06-12-2003 12:22 PM

Quote:

Today at 01:41 PM Boofo said this in Post #9
This is the error I am getting now.
Ok if you get that error change the spell_config.php back to MySQL and run the admin_spellcheck.php again and it should work.

Boofo 06-12-2003 12:39 PM

Now I get this again.

Warning: main(spell_MySQL.php) [function.main]: failed to create stream: No such file or directory in /xxxx/xxxx/xxxxxx_xxxx/forum/spelling/spell_config.php on line 166

Warning: main() [function.main]: Failed opening 'spell_MySQL.php' for inclusion (include_path='') in /xxxx/xxxx/xxxxxx_xxxx/forum/spelling/spell_config.php on line 166
You must choose a Database Type in the Spell Configuration file.

iggy123 06-12-2003 02:15 PM

did you see if the table is created in your db? it should make the table spelling_words?
apart from that i have no idea - it is working fine on mine and the only difference is that i have set it too forums/spelling rather than forum/spelling
but it shouldnt make much difference. Did you change any of the other files? and you did change the permissions to 755
I spoke to their support team and they said that they are planning on releasing a proper patch for vbulletin in the near future.

I have attached a clean spell_config.php to see if that makes any difference

Boofo 06-12-2003 03:35 PM

The directory permissions are set to 755, but all file permissions are still at 644. No, there is no spelling_words table. And I didn't change any other files. When they release an update for vBulletin, please let me know. Until then, I'm out of luck.

sptechzone 06-19-2003 02:46 PM

But not without a fight. got the message
Quote:

You must choose a Database Type in the Spell Configuration file.
, I had entered the database even tried the full path. That wasn't the problem when I used the MySQL admin tools found that I had a default username entered as "root" no password but a user. Added then did the change from MySQL to pspell and back and it works.

Thanks!

Just want to know if I can remove the Learn button. Want to stop anyone from entering mis-spelled words.

gmarik 06-19-2003 06:22 PM

Is only English supported?

iggy123 06-19-2003 08:07 PM

Quote:

Today at 08:22 PM gmarik said this in Post #15
Is only English supported?
I am sure you can get another language .dic file.... check out their website, there might be one there

iggy123 06-20-2003 10:52 AM

Quote:

Just want to know if I can remove the Learn button. Want to stop anyone from entering mis-spelled words.
Think there is away of turning it off - I will check it out and post it tonight..

Quote:

Is only English supported?
I have a couple of other language packs - again i will try them out tonight and post them here if they work ok.
The languages i have are:

. French
. German
. Italian
. Spainish

Ian Cunningham 06-20-2003 11:40 AM

Just browse one of the files for the HTML code with the insert button, you should be able to just remove it.

I cannot believe how quiet this hack is, I think this is one of the best hacks available - it works excellently on my site and all of my users are praising it!

iggy123 06-20-2003 02:20 PM

Quote:

Today at 01:40 PM Ian Cunningham said this in Post #18


I cannot believe how quiet this hack is, I think this is one of the best hacks available - it works excellently on my site and all of my users are praising it!


I can't understand it either? oh, well never mind LOL

iggy123 06-20-2003 04:40 PM

Quote:

Just want to know if I can remove the Learn button. Want to stop anyone from entering mis-spelled words
To disable the learn function totaly do this:

In the spelling folder open your spelling.js (remember to back it up first...)

Online 404 (approx) find:
PHP Code:

    odoc.write("<input type='button' value='Learn' class='clbutton' 
onclick='this.blur();parent.Learn_Word("
+The_Current_Word_ID+");'><br>"); 

and delete all of it

then still in spelling.js find online 473 (approx):
PHP Code:

function Learn_Word(Word_ID)
{
  
Word Bad_Words[Word_ID].Word;
  
Cookie Get_Cookie("SpellLearned");
  if (
Cookie == nullCookie Word;
  else 
Cookie Cookie "," Word;
  
Set_Cookie("SpellLearned",Cookie);
  
Ignore_All_Words(Word_ID);


and delete that as well.

Save the spelling.js and the learn button is removed.

iggy123 06-20-2003 04:48 PM

here are the extra dictonary files -
I haven't had chance to try them yet so install them at your own risk.
French

iggy123 06-20-2003 04:50 PM

German

iggy123 06-20-2003 04:51 PM

Italian

iggy123 06-20-2003 04:53 PM

Spanish

sptechzone 06-20-2003 06:01 PM

Thanks for the reply, That removed it and all is working fine. Thanks again this work great.

Kars10 06-20-2003 07:11 PM

Cool hack, but i get this error when i am trying to add the dic-file:

Code:

Installing german.dic (german)...
Unable to create dictionary database table: Code: 1064
Message: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(id MEDIUMINT AUTO_INCREMENT NOT NULL, word VARCHAR (30) BINARY
Result: Link: Resource id #4
DB: usr_web5_4 User: Server: localhostUnable to perform spell check at this time.

...any idea? :)

iggy123 06-20-2003 07:29 PM

Did you try the ENGLISH.DIC that came with it?
If that works it could be the dictonary file - try droping the data within the table (if it creates it) and then inserting the data that way.
If it didn't create teh table then it could be something else completly.
Will check it out tonight and let you know

Kars10 06-20-2003 07:53 PM

@ iggy123, no it dosent creates any table. :(
Let me know if it works for you.

Thank you in advance
Kars

iggy123 06-20-2003 08:11 PM

well i just installed the german dictonary without any problems.

when you installed it did you do this part:

https://vborg.vbsupport.ru/showthrea...993#post407993

try that and then connect to the http://yoursite/forums/spelling/spell_admin.php and see if that window shows up

iggy123 06-20-2003 08:16 PM

I will try and figure out how to add the table - manually - but i have no idea on how to write the code... so if someone can help me i would be gratefull...

Intex 06-21-2003 09:24 AM

Iggy123 - I'd tried out the version on your site to see what the spell checking was like. I kept words pretty simple, but it didn't pick up on quite a lot of them.

Obviously that's out of your control. Nice work nevertheless.

Intex 06-21-2003 12:19 PM

Iggy123 - I've integrated the style into my forum, but I can't find where the size of the popup browser is controlled. I've checked phpspell.html and the spelling.js files but can't see it.

Any ideas?

iggy123 06-21-2003 12:28 PM

Quote:

Today at 11:24 AM Intex said this in Post #31
Iggy123 - I'd tried out the version on your site to see what the spell checking was like. I kept words pretty simple, but it didn't pick up on quite a lot of them.

Obviously that's out of your control. Nice work nevertheless.


It all depends on the dictonary file and the settings within the spell_config.php. I have only set it pretty low to test etc but will be getting a new dictonary etc in the next few days and hopefully it should improve

iggy123 06-21-2003 12:32 PM

Quote:

Today at 02:19 PM Intex said this in Post #32
Iggy123 - I've integrated the style into my forum, but I can't find where the size of the popup browser is controlled. I've checked phpspell.html and the spelling.js files but can't see it.

Any ideas?

In the spellmessage.js

find (approx line 19)
Code:

    var LinkToField = "";

          function openspell()

        {

          height = 391;

          width = 555;

          if (ie4) LinkToField = self.vbform.message;

and alter that.

Intex 06-21-2003 12:32 PM

OK, cool - sounds good. It picks up the spelling errors just doesn't make a lot of good suggestions :).

Thx. for the height / width info. I'll try that out now :).

Intex 06-21-2003 12:35 PM

Yep that's it - I'm sure I tried those but obviously I didn't save the file or something after edit. Thx. for the help - appreciated :).

[high]* Intex clicks install.[/high]

Intex 06-21-2003 03:56 PM

Pretty obvious this one, but for anybody else that has FireFly's Quick Reply feature, then just perform the following:

In the 'showthread_replybox' template find the following code:

Code:

<input type="reset" class="bginput" name="reset" value="Reset Form" accesskey="r" tabindex="3">
Under that add the following:

Code:

<script language='javascript' src='spelling/spellmessage.js'></script>
<input type="button" class="" value="Spell Check" onclick="openspell();">


Intex 06-21-2003 04:12 PM

Once again, simple - but others might want to include this too. If your users, edit their post they don't have a way to check the spelling again. Follow the instructions below to include the spell check button when editing posts:

In the 'editpost' template find the following code:

Code:

<input type="reset" class="bginput" value="Reset Message" tabindex="4">
Under that add the following:

Code:

<script language='javascript' src='spelling/spellmessage.js'></script>
<input type="button" class="" value="Spell Check" onclick="openspell();">


Oldfart 06-21-2003 10:00 PM

Quote:

Today at 02:32 PM Intex said this in Post #35
OK, cool - sounds good. It picks up the spelling errors just doesn't make a lot of good suggestions :).

Thx. for the height / width info. I'll try that out now :).

Is there a way to add suggestions to the list? I've installed this nice hack with no problem but the "suggest" list is very weak on suggestions for a miss spelled word. It would be nice if it could be fixed to suggest more words.

iggy123 06-22-2003 06:26 AM

within the spell_config.php there is an option to increase the number of words suggested - however it slows the search down


All times are GMT. The time now is 05:24 AM.

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.01397 seconds
  • Memory Usage 1,839KB
  • 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
  • (6)bbcode_code_printable
  • (2)bbcode_php_printable
  • (13)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