Welcome, Guest. Please Login or Register.
May 14, 2025, 11:45:26 AM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  How bouta a speel cheker? « previous next »
Pages: 1 2 [3] 4 5 Reply Ignore Print
Author Topic: How bouta a speel cheker?  (Read 3147 times)
groundup
Disciple of Joe, Head Cleric
Mod Team
YaBB God
*****
Posts: 2983


Error 309: Please notify the administrator of this

WWW
Re:How bouta a speel cheker?
« Reply #30 on: July 24, 2002, 10:55:56 PM »
Reply with quote

edit your template and put this into the <head>
<script type="text/javascript" language="javascript"  src="../spellchecker.js">
</script>

search for:
   <input type="submit" name="$waction" value="$txt[507]" onClick="WhichClicked('$waction');" accesskey="p">
add after:
<input onclick="DoSpell('postmodify', 'message')" type="button" value="Check Spelling" name="SpellChk.x">
search for:
print <<<EOT
   <tr>
      <td align=center colspan=2>
       <input type="hidden" name="waction" value="imsend">
       <input type="submit" value="$submittxt" onClick="WhichClicked('imsend');" accesskey="s">
       <input type="submit" name="preview" value="$txt[507]" onClick="WhichClicked('previewim');" accesskey="p">
       <input type="reset" value="$txt[329]" accesskey="r">
      </td>
     </tr>
EOT;
}
print <<<EOT
<tr>
<td colspan=2></td>
</tr>
</table></form>

add after:
         <FORM name=SPELLDATA>
        <P><FONT face="Times New Roman, Times, serif"><INPUT type=hidden
        name=formname> <INPUT type=hidden name=subjectname> <INPUT type=hidden
        name=messagebodyname> <INPUT type=hidden value=body3 name=TextBox3>
        <INPUT type=hidden value=body4 name=TextBox4> <INPUT type=hidden
        name=companyID> <INPUT type=hidden name=language> <INPUT type=hidden
        name=opener> <INPUT type=hidden name=formaction>
      </FONT></P></FORM>
Logged

http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
fastfinancialfreedom.org
groundup
Disciple of Joe, Head Cleric
Mod Team
YaBB God
*****
Posts: 2983


Error 309: Please notify the administrator of this

WWW
Re:How bouta a speel cheker?
« Reply #31 on: July 24, 2002, 10:58:15 PM »
Reply with quote

then create a page called init.html:

<HTML>
<HEAD><TITLE>Loading Spell Checker</TITLE>
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--

function window_onload() {
document.SPELLDATA.formname.value=opener.document.SPELLDATA.formname.value
document.SPELLDATA.subjectname.value=opener.document.SPELLDATA.subjectname.value
document.SPELLDATA.messagebodyname.value=opener.document.SPELLDATA.messagebodyname.value
document.SPELLDATA.companyID.value=opener.document.SPELLDATA.companyID.value
document.SPELLDATA.language.value=opener.document.SPELLDATA.language.value
document.SPELLDATA.opener.value=opener.document.SPELLDATA.opener.value
document.SPELLDATA.action=opener.document.SPELLDATA.formaction.value
                                       

var flen=opener.document.forms.length

var index=flen
for(i=0; i<flen; i++){
   if(opener.document.forms[i].name==document.SPELLDATA.formname.value){
      index=i
      i=flen
      }
   }
   
if(index<flen){
   var ilen=opener.document.forms[index].elements.length
   var indexcontrol=ilen
   if(document.SPELLDATA.subjectname.value!=""){
      for(i=0; i<ilen; i++){
         if(opener.document.forms[index].elements[i].name==document.SPELLDATA.subjectname.value){
            indexcontrol=i
            i=ilen
            }
         }   
      if(indexcontrol<ilen)      
         document.SPELLDATA.subject.value=opener.document.forms[index].elements[indexcontrol].value
      }
            
   if(document.SPELLDATA.messagebodyname.value!=""){
      indexcontrol=ilen
      for(i=0; i<ilen; i++){
         if(opener.document.forms[index].elements[i].name==document.SPELLDATA.messagebodyname.value){
            indexcontrol=i
            i=ilen
            }
         }   
      if(indexcontrol<ilen)      
         document.SPELLDATA.messagebody.value=opener.document.forms[index].elements[indexcontrol].value
      }   
   document.SPELLDATA.submit()
   }else{
      alert("no form found.  Check java function call")
      window.close()
      }
}

//-->
</SCRIPT>
</HEAD>
<BODY LANGUAGE=javascript onload="return window_onload()">
<FORM action="" method=post name=SPELLDATA LANGUAGE=javascript>

   <H1>Loading Spell Checker. Please wait</H1>
   <INPUT name="formname"  type=hidden >
   <INPUT name="messagebodyname" type=hidden >
   <INPUT name="subjectname" type=hidden >
   <INPUT name="companyID"  type=hidden >
   <INPUT name="language"  type=hidden >
   <INPUT name="opener"  type=hidden >
   <INPUT name="closer"  type=hidden value="finish.asp">
   <INPUT name="IsHTML"  type=hidden value=0>
   
   <P>&nbsp;</P>
   <P>&nbsp;</P>
   <P>&nbsp;</P>
   <P>&nbsp;</P>
   <P>&nbsp;</P>
   <P>&nbsp;</P>
   <P>&nbsp;</P>
   <P>&nbsp;</P>
   <P>&nbsp;</P>
   <P>&nbsp;</P>
   <P>&nbsp;</P>
   <P>&nbsp;</P>
   <P>&nbsp;</P>
   <P>&nbsp;</P>
   <P>&nbsp;</P>
   <P>&nbsp;</P>
   <P>&nbsp;</P>
   <P>&nbsp;</P>
   <P>&nbsp;</P>
   <TEXTAREA name=subject></TEXTAREA>
   <TEXTAREA name=messagebody></TEXTAREA>
</FORM>
</BODY>
</HTML>

then create a js page called spellchecker.js
//formname is the name of form
//subject is the name of subject control
//body is the name of message body control
//compnayid, each company will give a company id.  This is used to find the location
//of custom dictionary
//If you run from your own location, you can just pass custom as the value.
//all custom dictionary will created under this sub directory
//sproxylocation is location of done.asp or done.cgi

//this file will be generated for each customer
function DoSpell(formname, subject, body)
{
   document.SPELLDATA.formname.value=formname
   if(subject!=null)
      document.SPELLDATA.subjectname.value=subject
   
   if(body!=null)
      document.SPELLDATA.messagebodyname.value=body
   
   document.SPELLDATA.companyID.value="custom\\CompuBridge"
   document.SPELLDATA.language.value=1033
   document.SPELLDATA.formaction.value="http://www.spellchecker.com/spell/startspelling.asp"
   
//   document.SPELLDATA.opener.value="../cgi-bin/sproxy.exe"
   document.SPELLDATA.opener.value="http://your.url/cgi-bin/sproxy.pl"
//   document.SPELLDATA.opener.value="http://www.spellchecker.com/spell/sproxy.asp"
   
   window.open("http://your.url/Initspell.htm","Spell",
      "toolbar=no,directories=no,resizable=yes,width=620,height=500,top=100,left=100 menubar=no")
}

Now if this is too hard, too bad :P
Logged

http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
fastfinancialfreedom.org
Wiziwig
Sr. Member
****
Posts: 407


Programmer and Users Liason and Manager

WWW
Re:How bouta a speel cheker?
« Reply #32 on: July 25, 2002, 01:54:24 AM »
Reply with quote

Has it worked for you just fine? If so congrats, I had suggested this alternative many months ago., A proper mod release would be nice for the masses who don't understand code posts.
Logged

groundup
Disciple of Joe, Head Cleric
Mod Team
YaBB God
*****
Posts: 2983


Error 309: Please notify the administrator of this

WWW
Re:How bouta a speel cheker?
« Reply #33 on: July 25, 2002, 03:02:42 AM »
Reply with quote

i haven't tested it, you can do that.  If you want to make it into a mod, make sure you include the original author's name (and mine if it works without any hitches)
Logged

http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
fastfinancialfreedom.org
Wiziwig
Sr. Member
****
Posts: 407


Programmer and Users Liason and Manager

WWW
Re:How bouta a speel cheker?
« Reply #34 on: July 25, 2002, 03:16:27 AM »
Reply with quote

I think you need to look into that package a little closer at first. it calls spellchecker.pl from sources. What manner of integration have you thought up to include that perl code into yabb php? From the looks of it, it's not just a matter of calling the java file and modifying the template.


Quote from: groundup on July 25, 2002, 03:02:42 AMi haven't tested it, you can do that.  If you want to make it into a mod, make sure you include the original author's name (and mine if it works without any hitches)
« Last Edit: July 25, 2002, 03:27:51 AM by Wiziwig » Logged

groundup
Disciple of Joe, Head Cleric
Mod Team
YaBB God
*****
Posts: 2983


Error 309: Please notify the administrator of this

WWW
Re:How bouta a speel cheker?
« Reply #35 on: July 25, 2002, 04:12:00 AM »
Reply with quote

ok, I just noticed the JS.  There was nothing about this in the readme file though

[edit]Just looked into it and I found this file (sproxy.pl)  I don't know perl but I can try:

#!/usr/bin/perl
print "Content-type: text/html\n\n";

if ($ENV{'REQUEST_METHOD'} ne 'POST')
{
     print <<"HTML";
     <HTML>
     <BODY>
     only method POST is support here.
     </BODY>
     </HTML>

HTML

     exit;
}

read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs)
       {
   ($name, $value) = split(/=/, $pair);
   $value =~ tr/+/ /;
   $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
   print $value;
   if($name eq "f")
      {
      print "<textarea name=TextBox1>"
      }
   if($name eq "g")
      {
      print "</textarea><textarea name=TextBox2>"
      }
   if($name eq "h")
      {
      print "</textarea>"
      }
    }

exit;
 
« Last Edit: July 25, 2002, 04:13:24 AM by groundup » Logged

http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
fastfinancialfreedom.org
groundup
Disciple of Joe, Head Cleric
Mod Team
YaBB God
*****
Posts: 2983


Error 309: Please notify the administrator of this

WWW
Re:How bouta a speel cheker?
« Reply #36 on: July 25, 2002, 06:25:58 AM »
Reply with quote

if ($getenv('REQUEST_METHOD') != 'POST')
{
     print <<<EOT
"HTML";
<HTML>
<BODY>
only method POST is support here.
</BODY>
</HTML>

EOT;

     exit;
}

fopen(php://STDIN, $buffer, $getenv('CONTENT_LENGTH'));
$pairs = array();
$pairs = split(/&/, $buffer);
foreach $pairs as $pair
       {
/*
# confusing stuff that i will try to port
   ($name, $value) = split(/=/, $pair);
list($key,$value) = explode('=',$pair);
   $value =~ tr/+/ /;
$value = urldecode($value[]);
$output = '';
for ($i = 0; $i < strlen ($data[1]); $i+=2)
{
$output .= urldecode ('%'.substr ($data[1], $i, 2);
}
   $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
# end confusing stuff
*/
   print $value;
   if($name == "f")
      {
      print "<textarea name=TextBox1>"
      }
   if($name == "g")
      {
      print "</textarea><textarea name=TextBox2>"
      }
   if($name == "h")
      {
      print "</textarea>"
      }
    }

exit;

inside of the confusing stuff.. wherever there are no whitespace before the code, that is php.  Just check to see if that is correct
Logged

http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
fastfinancialfreedom.org
newbieyabbie
Jr. Member
**
Posts: 83


ahead warp nine

Re:How bouta a speel cheker?
« Reply #37 on: October 10, 2002, 02:53:48 AM »
Reply with quote

Hi guys, sorry to bring back such a dead subject, but first I want to thank groundup for the effort. I just tried this spell checker, it all seems to work up until the end of spell checking-changing a word, then insted of taking me back to the post, I get this junk:
Quoteif ($getenv('REQUEST_METHOD') != 'POST') { print << only method POST is support here. EOT; exit; } fopen(php://stdin, $buffer, $getenv('CONTENT_LENGTH')); $pairs = array(); $pairs = split(/&/, $buffer); foreach $pairs as $pair { /* # confusing stuff that i will try to port ($name, $value) = split(/=/, $pair); list($key,$value) = explode('=',$pair); $value =~ tr/+/ /; $value = urldecode($value[]); $output = ''; for ($i = 0; $i < strlen ($data[1]); $i+=2) { $output .= urldecode ('%'.substr ($data[1], $i, 2); } $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; # end confusing stuff /* print $value; if($name == "f") { print ""
      }
   if($name == "g")
      {
      print ""
      }
   if($name == "h")
      {
      print "" } } exit;
I know this is from sproxy, but what's confusing me is: I changed the name from sproxy.pl to sproxy.php with the above code, should I have not done that?
Did anyone get this working? is this conversion from .pl to .php that groundup did for sproxy functional?
can anyone go over this and confirm it's functionality?
Logged

Go beyond what you know!
newbieyabbie
Jr. Member
**
Posts: 83


ahead warp nine

Re:How bouta a speel cheker?
« Reply #38 on: October 11, 2002, 02:06:27 AM »
Reply with quote

Seems like the script doesn't know what to do with the corrected text.
Logged

Go beyond what you know!
newbieyabbie
Jr. Member
**
Posts: 83


ahead warp nine

Re:How bouta a speel cheker?
« Reply #39 on: October 11, 2002, 06:02:06 PM »
Reply with quote

OK, I got working finally, but using the original sproxy.pl script. Now I am a happy camper.Thanx.
« Last Edit: October 11, 2002, 06:03:05 PM by newbieyabbie » Logged

Go beyond what you know!
Wiziwig
Sr. Member
****
Posts: 407


Programmer and Users Liason and Manager

WWW
Re:How bouta a speel cheker?
« Reply #40 on: October 11, 2002, 07:53:33 PM »
Reply with quote

OK so how does all this work again and what would the rest of us do or have to get to get this to work on our systems?
Logged

groundup
Disciple of Joe, Head Cleric
Mod Team
YaBB God
*****
Posts: 2983


Error 309: Please notify the administrator of this

WWW
Re:How bouta a speel cheker?
« Reply #41 on: October 13, 2002, 03:44:06 AM »
Reply with quote

inside of the "confusing stuff" comments there are 2 lines of perl. the 2 lines that have whitespace before them. those have to be converted to PHP for this to work.
Logged

http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
fastfinancialfreedom.org
newbieyabbie
Jr. Member
**
Posts: 83


ahead warp nine

Re:How bouta a speel cheker?
« Reply #42 on: October 14, 2002, 01:40:52 AM »
Reply with quote

Hi, here is what I did. Followed Groundup's instructions starting on reply #30 of this topic, in the .js file you must put your full URL where it says www.your.url.com
Quote//formname is the name of form
//subject is the name of subject control
//body is the name of message body control
//compnayid, each company will give a company id.  This is used to find the location
//of custom dictionary
//If you run from your own location, you can just pass custom as the value.
//all custom dictionary will created under this sub directory
//sproxylocation is location of done.asp or done.cgi

//this file will be generated for each customer
function DoSpell(formname, subject, body)
{
   document.SPELLDATA.formname.value=formname
   if(subject!=null)
      document.SPELLDATA.subjectname.value=subject
   
   if(body!=null)
      document.SPELLDATA.messagebodyname.value=body
   
   document.SPELLDATA.companyID.value="custom\\www.your_url.com"
   document.SPELLDATA.language.value=1033
   document.SPELLDATA.formaction.value="http://www.spellchecker.com/spell/startspelling.asp"
   
//   document.SPELLDATA.opener.value="../cgi-bin/sproxy.exe"
   document.SPELLDATA.opener.value="http://your.url/cgi-bin/sproxy.pl"
//   document.SPELLDATA.opener.value="http://www.spellchecker.com/spell/sproxy.asp"
   
   window.open("http://www.your.url/Initspell.htm","Spell",
      "toolbar=no,directories=no,resizable=yes,width=620,height=500,top=100,left=100 menubar=no")
}
Notice that I only got it to work using the actual perl script which I palced in my cgi-bin directory, I couldn't change it to .php, so I kept it as is.

This is the sproxy.pl script that worked for  me
Quote#!/usr/bin/perl
print "Content-type: text/html\n\n";

if ($ENV{'REQUEST_METHOD'} ne 'POST')
{
    print <<"HTML";
    <HTML>
    <BODY>
    only method POST is support here.
    </BODY>
    </HTML>

HTML

    exit;
}

read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs)
      {
   ($name, $value) = split(/=/, $pair);
   $value =~ tr/+/ /;
   $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
   print $value;
   if($name eq "f")
      {
      print "<textarea name=TextBox1>"
      }
   if($name eq "g")
      {
      print "
« Last Edit: December 13, 2002, 05:22:16 AM by newbieyabbie » Logged

Go beyond what you know!
groundup
Disciple of Joe, Head Cleric
Mod Team
YaBB God
*****
Posts: 2983


Error 309: Please notify the administrator of this

WWW
Re:How bouta a speel cheker?
« Reply #43 on: October 14, 2002, 04:59:11 PM »
Reply with quote

can you show me a copy of it running on your board?
Logged

http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
fastfinancialfreedom.org
newbieyabbie
Jr. Member
**
Posts: 83


ahead warp nine

Re:How bouta a speel cheker?
« Reply #44 on: October 15, 2002, 02:44:32 PM »
Reply with quote

Sure groundup, but first this. By no means may board is modified for best design, as this is my first venture into such things with very little tools available for me and know nothing about coding whatsoever, so don't laugh, ok? :)
www.allaboutpalestine.com/yabbse/index.php
Logged

Go beyond what you know!
Pages: 1 2 [3] 4 5 Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  How bouta a speel cheker? « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.038 seconds with 20 queries.