Posted on: 02/22/10 10:06am
By: manowar
I have installed jQchat, and modify its appearance, font and background basically, but I have three things that do not look good:
1.- My site is in spanish and I can not insert a character "ñ". How can I fix this?
2.- I add a button to accept the typed text, so it is not functioning the chat from the browser on a mobile phone for example and there are users who like to send a button submit.
3.- How can I make the chat show history or at least allows to show more blogs in the block.
My web site is www.huracannaranja.cl.
Best regards from Chile
Re: help me with JQchat
Posted on: 02/22/10 06:11pm
By: suprsidr
1.- My site is in spanish and I can not insert a character "ñ". How can I fix this?
What happens when you do? does it get replaced?
This chat is clientside/browser based. We're not doing anything special with localization here.
But maybe the emoticon script is filtering it out?
Try commenting out public_html/jQchat/process.php lines ~120 - 121:
Text Formatted Code
$em = new Emoticon();
$message = $em->apply($message);
to:
Text Formatted Code
//$em = new Emoticon();
//$message = $em->apply($message);
You will lose emoticons but at least we'll know if that's where we're breaking localization.
add a button to accept the typed text
geeklog/plugins/functions.inc line ~243 in function phpblock_jQchat_block:
Text Formatted Code
<textarea id="sendie" maxlength="350"></textarea>
to:
Text Formatted Code
<textarea id="sendie" maxlength="350"></textarea>
<input type="submit" style="width:100%;-moz-border-radius:3px;-webkit-border-radius:3px;" value="Send Chat" onclick="chat.send(jQuery(\'#sendie\').val());jQuery(\'#sendie\').val(\'\');return false;"/>
How can I make the chat show history or at least allows to show more blogs in the block.
process.php again line ~137:
Text Formatted Code
for ($i = ($count < 6)?0:$count-5; $i < $count; $i++) {
to:
Text Formatted Code
for ($i = 0; $i < $count; $i++) {
-s
Re: help me with JQchat
Posted on: 02/23/10 10:42am
By: manowar
When someone inserts a "ñ" or "Ñ" in chat area, this display this characters "ñ "
This;
159 // $em = new Emoticon();
160 // $message = $em->apply($message);
These lines are the 159 and 160 in my file process.php, but is the same.
I need to fix it, because this chat so I can not use on my webpage. What do you think could be the problem?
I'll try the other answers you left me
Re: help me with JQchat
Posted on: 02/23/10 10:56am
By: suprsidr
I'm the absolute worst at localization. I don't know the mechanics at all.
Could it possibly be the encoding of the flat file(chat.txt) the messages are stored in?
Anybody?
-s
Re: help me with JQchat
Posted on: 02/23/10 01:56pm
By: manowar
My file siteconfig.php
$_CONF['path'] = '/../huracan/';
$_CONF['path_system'] = $_CONF['path'] . 'system/';
$_CONF['default_charset'] = 'utf-8';
$_CONF_FCK['imagelibrary'] = '/images/library';
// Useful Stuff
if (!defined('LB'

) {
define('LB',"\n"

;
}
if (!defined('VERSION'

) {
define('VERSION', '1.6.0'

;
}
?>
Re: help me with JQchat
Posted on: 02/23/10 04:10pm
By: Dirk
I'm not familiar with the code involved here. But it the website is running utf-8 and the text file is written as utf-8, then I would think it should work.
When you open the text file in a text editor that knows about utf-8, do the special characters display correctly?
bye, Dirk
Re: help me with JQchat
Posted on: 02/23/10 06:47pm
By: suprsidr
Ok, with some hints from Tom and Dirk - let's try to encode this chat.txt:
process.php:
basically anywhere you see fwrite(fopen.... we need to wrap the text in utf8_encode()
example:
Text Formatted Code
fwrite(fopen($_CONF['path_data'].$file, 'a'), "<span class=\"".$nickname."\">".$nickname." ".ltrim(date('h:i:s A'), 0)."</span>".$breaking_character.$message);
to:
Text Formatted Code
fwrite(fopen($_CONF['path_data'].$file, 'a'),utf8_encode("<span class=\"".$nickname."\">".$nickname." ".ltrim(date('h:i:s A'), 0)."</span>".$breaking_character.$message));
You'll need to head to jQchat admin and delete blockchat.txt and chat.txt
If this does not work, I'll have to re-work the way they get created to add the necessary headers.
-s
Re: help me with JQchat
Posted on: 02/25/10 08:29am
By: manowar
Quote by: DirkI'm not familiar with the code involved here. But it the website is running utf-8 and the text file is written as utf-8, then I would think it should work.
When you open the text file in a text editor that knows about utf-8, do the special characters display correctly?
bye, Dirk
You mean the file blockchat.txt?
this is an Ñ or ñ(text inserted in chat area).
in the block chat, it looks so
this is an � or ñ
in /path/site_huracan/data/blockchat.txt
it look like this;
<span class="zorro_chilote">zorro_chilote 5:20:24 PM</span><br />this is an Ã<91> or ñ
This file I edit with Vi.
You can view it, edit it with vi and gedit, it looks the same
Re: help me with JQchat
Posted on: 02/25/10 03:36pm
By: manowar
Quote by: suprsidrOk, with some hints from Tom and Dirk - let's try to encode this chat.txt:
process.php:
basically anywhere you see fwrite(fopen.... we need to wrap the text in utf8_encode()
example:
Text Formatted Code
fwrite(fopen($_CONF['path_data'].$file, 'a'), "<span class="".$nickname."">".$nickname." ".ltrim(date('h:i:s A'), 0)."</span>".$breaking_character.$message);
to:
Text Formatted Code
fwrite(fopen($_CONF['path_data'].$file, 'a'),utf8_encode("<span class="".$nickname."">".$nickname." ".ltrim(date('h:i:s A'), 0)."</span>".$breaking_character.$message));
You'll need to head to jQchat admin and delete blockchat.txt and chat.txt
If this does not work, I'll have to re-work the way they get created to add the necessary headers.
-s
I changed process.php as you tell me, I also delete blockchat.txt and chat.txt, but not work to me.
I did not understand this part "You'll need to head to jQchat admin", could you explain me, please.
Thanks you.
Re: help me with JQchat
Posted on: 02/25/10 04:10pm
By: suprsidr
I'll have time to look at it further tonight.
-s
Re: help me with JQchat
Posted on: 02/28/10 06:27pm
By: suprsidr
Finally got a second to look at this.
public_html/jQchat/process.php line~111:
Text Formatted Code
$message = htmlentities(strip_tags($_POST['message']));
to:
Text Formatted Code
$message = strip_tags($_POST['message']);
-s
Re: help me with JQchat
Posted on: 03/04/10 09:32am
By: manowar
After the earthquake we experienced here in Chile, I'm back in search of solving this problem
unfortunately the solution did not work,
$message = htmlentities(strip_tags($_POST['message']));
to
$message = strip_tags($_POST['message']);
Still does not work insert ñ or accented characters such as ó.
Thanks you.
Re: help me with JQchat
Posted on: 03/04/10 09:43am
By: suprsidr
Hope all is well for you in Chile
Really? it worked for me.
Please try my
dev sample[*1] .
If that works, I'll zip that up for you.
-s
Re: help me with JQchat
Posted on: 03/04/10 11:26am
By: manowar
well I tried your example and walk of wonders, but trust me for my not work. What choice do I have?
I'm okay, just a little tired with all the stress that is generated with this situation, fortunately nothing happened to me with the earthquake, but the country has not been well and many people affected, homeless, dead, that was brutal
Re: help me with JQchat
Posted on: 03/04/10 04:51pm
By: suprsidr
I've updated the archive w/ the version from my dev site.
http://www.flashyourweb.com/filemgmt/index.php?id=33
-s
Re: help me with JQchat
Posted on: 03/10/10 02:41pm
By: manowar
worked!!
Thanks you.
un millon de gracias