Author Topic: [MOD] Goggie Spell Rechtschreibprüfung  (Read 24258 times)

0 Members and 1 Guest are viewing this topic.

Offline dosensteck

  • Full Member
  • ***
  • Posts: 160
    • View Profile
[MOD] Goggie Spell Rechtschreibprüfung
« on: September 03, 2006, 02:10:51 AM »
Originall ein Mod für PHPBB der auch in 4images funktioniert! Das PHPBB Forenthema findet ihr hier


- Download der aktuellen Library
- Download des Proxy-Skriptes
- Upload des Ordners /googiespell ins root der Präsenz (wo auch die config.php liegt), Upload des Proxy-Skriptes in den googiespell-Ordner

Öffne die comment_form.html

füge ganz oben an der Datei ein:
Code: [Select]
<script type="text/javascript" src="googiespell/AJS.js"></script>
  <script type="text/javascript" src="googiespell/googiespell.js"></script>
  <script type="text/javascript" src="googiespell/cookiesupport.js"></script>
  <link rel="stylesheet" href="googiespell/googiespell.css" type="text/css" />

Finde:
Code: [Select]
<textarea name="comment_text"
danach einfügen
Code: [Select]
id="message"
Finde
Code: [Select]
</textarea>
danach einfügen
Code: [Select]
<script type="text/javascript">
  var googie1 = new GoogieSpell("googiespell/", "googiespell/sendReq.php?lang=");
  googie1.setLanguages({'de': 'Deutsch', 'en' : 'Englisch'});
  googie1.lang_chck_spell = "Rechtschreibprüfung";
  googie1.lang_rsm_edt = "Text bearbeiten";
  googie1.lang_close = "schliessen";
  googie1.lang_no_error_found = "Kein Fehler gefunden";
  googie1.lang_revert = "zurücksetzen auf";
  googie1.decorateTextarea("message");
  </script>

Und das wars auch schon :)





« Last Edit: September 04, 2006, 03:31:28 PM by mawenzi »

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Goggie Spell Rechtschreibprüfung
« Reply #1 on: September 03, 2006, 02:35:04 AM »
Please note, this mod requires PHP v5 (or with little modification it can be used on PHP v4.3) and it must be compilled/enabled with OpenSSL extension...

Other than that this mod works great :)

P.S. sorry for reply in english ;)
« Last Edit: September 04, 2006, 02:58:31 AM by V@no »
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Goggie Spell Rechtschreibprüfung
« Reply #2 on: September 03, 2006, 04:45:57 AM »
Another issue with Proxy-Skriptes is this warning messages:
Quote
PHP Warning:  fgets() [<a href='function.fgets'>function.fgets</a>]: SSL: fatal protocol error in googiespell/sendReq.php on line 23
After some research I found this:
Quote
When using SSL, Microsoft IIS will violate the protocol by closing the connection without sending a close_notify indicator. PHP will report this as "SSL: Fatal Protocol Error" when you reach the end of the data. To workaround this, you should lower your error_reporting level not to include warnings. PHP 4.3.7 and higher can detect buggy IIS server software when you open the stream using the https:// wrapper and will suppress the warning for you. If you are using fsockopen() to create an ssl:// socket, you are responsible for detecting and suppressing the warning yourself.
This indicates that this is actualy google server's problem...so adding @ into this line fixes this issue:[qcode]       $store .= @fgets($fp, 128);
[/qcode]
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline dosensteck

  • Full Member
  • ***
  • Posts: 160
    • View Profile
Re: Goggie Spell Rechtschreibprüfung
« Reply #3 on: September 04, 2006, 02:52:24 AM »
oh thx for the warnings... can you translate the mod in english (or mawenzi ect.)? my english is not so good and you understand my german instroductions :D

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Goggie Spell Rechtschreibprüfung
« Reply #4 on: September 04, 2006, 03:44:07 AM »
Ok, here you go (i've made little modifications inthe code you published for comment_form.html: combinened two steps and changed textarea ID)
Step 1
-Download lattest GoogieSpell Library
Create new folder googiespell at your 4images gallery root directory on the server
Upload all files from the GoogieSpell Library package into googiespell folder.
- Download lattest Proxy-Skriptes script
Upload it into googiespell folder.

Step 2

Open comment_form.html

Find:
Code: [Select]
<textarea name="comment_text"Add into that line:
Code: [Select]
id="comment_text"The result should be like this:
Code: [Select]
<textarea name="comment_text" id="comment_text"
Step 2.1
Find:
Code: [Select]
</textarea>Insert below:
Code: [Select]
<script type="text/javascript" src="googiespell/AJS.js"></script>
 <script type="text/javascript" src="googiespell/googiespell.js"></script>
 <script type="text/javascript" src="googiespell/cookiesupport.js"></script>
 <link rel="stylesheet" href="googiespell/googiespell.css" type="text/css" />
<script type="text/javascript">
 var googie1 = new GoogieSpell("googiespell/", "googiespell/sendReq.php?lang=");
 googie1.setLanguages({'de': 'Deutsch', 'en' : 'English'});
 googie1.lang_chck_spell = "{lang_googie_chck_spell}";
 googie1.lang_rsm_edt = "{lang_googie_rsm_edt}";
 googie1.lang_close = "{lang_googie_close}";
 googie1.lang_no_error_found = "{lang_googie_no_error_found}";
 googie1.lang_revert = "{lang_googie_revert}";
 googie1.show_change_lang_pic = true; //show language select menu
 googie1.decorateTextarea("comment_text");
 </script>


Step 3
In lang/<your language>/main.php at the end, above closing ?> insert:

:flag-de: Deutsch:
Code: [Select]
$lang['googie_chck_spell'] = "Rechtschreibprüfung";
$lang['googie_rsm_edt'] = "Text bearbeiten";
$lang['googie_close'] = "schliessen";
$lang['googie_no_error_found'] = "Kein Fehler gefunden";
$lang['googie_revert'] = "zurücksetzen auf";
$lang['googie_no_suggestions'] = "Keine Vorschläge";

:flag-en: English:
Code: [Select]
$lang['googie_chck_spell'] = "Check spelling";
$lang['googie_rsm_edt'] = "Resume editing";
$lang['googie_close'] = "Close";
$lang['googie_no_error_found'] = "No spelling errors found";
$lang['googie_revert'] = "Revert to";
$lang['googie_no_suggestions'] = "No suggestions";

:flag-ru: Русский:
Code: [Select]
$lang['googie_chck_spell'] = "Проверить ошибки";
$lang['googie_rsm_edt'] = "Продолжить редактирование";
$lang['googie_close'] = "Закрыть";
$lang['googie_no_error_found'] = "Ошибки не найдены";
$lang['googie_revert'] = "Исправить на";
$lang['googie_no_suggestions'] = "Нет предложений";


Step 4
Open details.php
Find:
Code: [Select]
    $comment_form = $site_template->parse_template("comment_form");
Insert above:
Code: [Select]
$site_template->register_vars(array(
  "lang_googie_chck_spell" => $lang['googie_chck_spell'],
  "lang_googie_rsm_edt" => $lang['googie_rsm_edt'],
  "lang_googie_close" => $lang['googie_close'],
  "lang_googie_no_error_found" => $lang['googie_no_error_found'],
  "lang_googie_revert" => $lang['googie_revert'],
  "lang_googie_no_suggestions" => $lang['googie_no_suggestions'],
));

P.S. in your original tutorial you did not translate "No suggestions", so I left it in english ;)

P.P.S.
By default the language select will show two languages Deutsch and English.
You can add/remove language selection in this line from step 2.1:
Code: [Select]
googie1.setLanguages({'de': 'Deutsch', 'en' : 'English'});
(note, you may add more languages, but it does not mean google will be able spell check your language ;))
Each language must be separated from others by a comma and must have " : " separator between two-letters language abriviation and actual language name that will be showed in the menu.

If you want to use only one language or if you dont want to show the language menu, then you can set to false this line in Step 2.1:
Code: [Select]
googie1.show_change_lang_pic = true; //show language select menu

edit by mawenzi :
Step 2.1 - googie1.decorateTextarea("comment_form"); -> googie1.decorateTextarea("comment_text");
Step 3 - Deutsch
Step 4 - }; -> ));
« Last Edit: September 04, 2006, 10:46:47 PM by mawenzi »
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: Goggie Spell Rechtschreibprüfung
« Reply #5 on: September 04, 2006, 03:27:15 PM »
... thanks dosensteck and v@no for this tiny smart modification ... saw it on gallery.vano.org , works perfectly ...  :D
... but on my site the language select menu, check spelling, error, ... are not shown ... test here ... ?
... have you an idea for a solution of that problem ...
... this mod requires PHP v5 ... ? ... my server version is PHP v4.4.4
« Last Edit: September 04, 2006, 05:25:02 PM by mawenzi »
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Goggie Spell Rechtschreibprüfung
« Reply #6 on: September 04, 2006, 09:19:48 PM »
yes, this mod requires PHP v5 with OpenSSL extension.

PHP5 is required because of file_get_contents() function used in sendReq.php but you can try fix it by adding on top of that file this:
Code: [Select]
if(!function_exists('file_get_contents'))
{
  function file_get_contents($file)
  {
    $file = file($file);
    return !$file ? false : implode('', $file);
  }
}
Yet, I dont know if its going to work...

But, if your PHP compilled without OpenSSL extension, there is no work around...it simply wont work...
You can check in phpinfo, if you see ssl in "Registered Stream Socket Transports" section, then it might work for you ;)

[EDIT]
Actualy there is a work around these restrictions, but every time you hit spell check link a popup will be showed asking you permission.
in comment_form.html template instead of
Code: [Select]
googiespell/sendReq.php?lang= use this:
Code: [Select]
https://www.google.com/tbproxy/spell?lang=
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline dosensteck

  • Full Member
  • ***
  • Posts: 160
    • View Profile
Re: [MOD] Goggie Spell Rechtschreibprüfung
« Reply #7 on: September 04, 2006, 10:02:07 PM »
@mawenzi

versuche mal dieser sockspell.php
Code: [Select]
<?php
/**
 * sockspellphp - php proxy for googiespell
 *
 * @author: Andreas Krapohl [larsneo]
 * @link http://www.krapohl.info
 * @credits: Marcin 'nosferathoo' Puchalski
 * @credits: Johan Sijbesma
 * @credits: James Edgington
 * @credits: Stephen Wald
 * @license GNU/GPL - http://www.gnu.org/copyleft/gpl.html
 */

// get (and sanitize) $lang from GPC
$lang=strip_tags($_GET['lang']);
$lang=substr($lang02);

// set enviroment
$google 'www.google.com';
$path="/tbproxy/spell?lang=$lang";
$data file_get_contents('php://input');


  
// create a new curl resource
  
$curl_handle curl_init();

  
// URL: Host und Pfad via HTTPS (= SSL)
  
curl_setopt($curl_handleCURLOPT_URL'https://'.$google.$path);
  
// Port
  
curl_setopt($curl_handleCURLOPT_PORT443);

  
// Prüfung des SSL-Zertifikats abschalten
  
curl_setopt($curl_handleCURLOPT_SSL_VERIFYPEERfalse);
  
// curl_setopt($curl_handle, CURLOPT_SSL_VERIFYHOST, false);

  // kein Header in der Ausgabe
  // curl_setopt($curl_handle, CURLOPT_HEADER, false);
  // HTTP-Version 1.1
  
curl_setopt($curl_handleCURLOPT_HTTP_VERSIONCURL_HTTP_VERSION_1_1);

  
// POST-Request
  // curl_setopt($curl_handle, CURLOPT_POST, true);
  
$curl_headers = array('Host: '.$google,
                        
'Content-Type: application/x-www-form-urlencoded',
                        
'Content-Length: '.strlen($data),
                        
'Connection: Close');
  
curl_setopt($curl_handleCURLOPT_HTTPHEADER$curl_headers);
  
curl_setopt($curl_handleCURLOPT_POSTFIELDS$data);
  
curl_setopt($curl_handleCURLOPT_POSTFIELDSIZEstrlen($data));

  
curl_setopt($curl_handleCURLOPT_CONNECTTIMEOUT30);
  
curl_setopt($curl_handleCURLOPT_TIMEOUT30);
  
curl_setopt($curl_handleCURLOPT_RETURNTRANSFERtrue);

  
// Request durchführen und Output einlesen
  
$store curl_exec($curl_handle);

  if (
== curl_errno($curl_handle)) {
    
curl_close($curl_handle);
  }

// print response
print $store;
?>

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] Goggie Spell Rechtschreibprüfung
« Reply #8 on: September 04, 2006, 11:06:01 PM »
@ v@no
... thanks for your solutions ... but I can't get it to work ...
... with dosensteck's sockspell.php it shows check spelling and messages but not the language select menu ...
... and the check works also not correctly ...

@ dosensteck
... mit der sockspell.php bin ich nun ein Stückchen weiter gekommen ...
... doch so perfekt arbeiten wie auf v@nos website tut es leider noch nicht ...
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Goggie Spell Rechtschreibprüfung
« Reply #9 on: September 04, 2006, 11:35:15 PM »
Quote
Warning: fsockopen() has been disabled for security reasons in googiespell/sendReq.php on line 12
and
Quote
Fatal error: Call to undefined function: curl_init() in googiespell/sockspell.php on line 25
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline JensF

  • Addicted member
  • ******
  • Posts: 1.028
    • View Profile
    • http://www.terraristik-galerie.de
Re: [MOD] Goggie Spell Rechtschreibprüfung
« Reply #10 on: September 10, 2006, 07:48:54 PM »
Hi,

thanks for this Mod. I have install it and it works....
Mit freundlichem Gruß
Jens Funk



-> Sorry for my bad English <-

Offline ccsakuweb

  • Sr. Member
  • ****
  • Posts: 498
  • Patri
    • View Profile
    • My Art
Re: [MOD] Goggie Spell Rechtschreibprüfung
« Reply #11 on: April 09, 2007, 12:13:06 AM »
thank you very much for this mod. I've intalled with PHP version 4.4.6 (with Vano's modification in sendReq.php) :D
:arrow: 4images Paid Mods: Links, Blog, Albums, Subdomains for users, Diferent templates for user profile, Related picture in details, Last pictures in details.
And the mod that you request me.   Demo: http://www.myart.es

A website dedicated to artist people who loves drawing, design, writing and more

Offline ccsakuweb

  • Sr. Member
  • ****
  • Posts: 498
  • Patri
    • View Profile
    • My Art
Re: [MOD] Goggie Spell Rechtschreibprüfung
« Reply #12 on: April 10, 2007, 12:56:41 AM »
does it work only in details??? doesn't it work in index and categories??? the english people could help with googie spell if they doesn't understand some word in spanish (my gallery is in spanish)
:arrow: 4images Paid Mods: Links, Blog, Albums, Subdomains for users, Diferent templates for user profile, Related picture in details, Last pictures in details.
And the mod that you request me.   Demo: http://www.myart.es

A website dedicated to artist people who loves drawing, design, writing and more

Offline MrAndrew

  • Sr. Member
  • ****
  • Posts: 302
    • View Profile
    • Aviation PhotoBase
Re: [MOD] Goggie Spell Rechtschreibprüfung
« Reply #13 on: March 13, 2011, 08:46:49 AM »
Something wrong with my Russian unicode... How to resolve?

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.806
  • I ♥ 4I
    • View Profile