Welcome to Geeklog Sunday, October 24 2021 @ 11:46 pm EDT

Geeklog Forums

help me with JQchat


Status: offline

manowar

Forum User
Regular Poster
Registered: 07/11/07
Posts: 81
Location:Santiago - Chile
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
 Quote

Status: offline

suprsidr

Forum User
Full Member
Registered: 29/12/04
Posts: 555
Location:Champaign, Illinois
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:
PHP Formatted Code

            $em = new Emoticon();
            $message = $em->apply($message);
 

to:
PHP 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:
PHP Formatted Code

                <textarea id="sendie" maxlength="350"></textarea>
 

to:
PHP 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:
PHP Formatted Code
            for ($i = ($count < 6)?0:$count-5; $i < $count; $i++) {

to:
PHP Formatted Code
            for ($i = 0; $i < $count; $i++) {


-s


FlashYourWeb and Your Gallery with the E2 XML Media Player for Gallery2 - http://www.flashyourweb.com
 Quote

Status: offline

manowar

Forum User
Regular Poster
Registered: 07/11/07
Posts: 81
Location:Santiago - Chile
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

 Quote

Status: offline

suprsidr

Forum User
Full Member
Registered: 29/12/04
Posts: 555
Location:Champaign, Illinois
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
FlashYourWeb and Your Gallery with the E2 XML Media Player for Gallery2 - http://www.flashyourweb.com
 Quote

Status: offline

manowar

Forum User
Regular Poster
Registered: 07/11/07
Posts: 81
Location:Santiago - Chile
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'Wink) {
define('LB',"\n"Wink;
}
if (!defined('VERSION'Wink) {
define('VERSION', '1.6.0'Wink;
}

?>
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 12/01/02
Posts: 13073
Location:Stuttgart, Germany
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
 Quote

Status: offline

suprsidr

Forum User
Full Member
Registered: 29/12/04
Posts: 555
Location:Champaign, Illinois
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:
PHP Formatted Code
            fwrite(fopen($_CONF['path_data'].$file, 'a'), "<span class=\"".$nickname."\">".$nickname."&nbsp;".ltrim(date('h:i:s A'), 0)."</span>".$breaking_character.$message);

to:
PHP Formatted Code
            fwrite(fopen($_CONF['path_data'].$file, 'a'),utf8_encode("<span class=\"".$nickname."\">".$nickname."&nbsp;".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
FlashYourWeb and Your Gallery with the E2 XML Media Player for Gallery2 - http://www.flashyourweb.com
 Quote

Status: offline

manowar

Forum User
Regular Poster
Registered: 07/11/07
Posts: 81
Location:Santiago - Chile
Quote 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



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&nbsp;5:20:24 PM</span><br />this is an &Atilde;<91> or &Atilde;&plusmn;

This file I edit with Vi.

You can view it, edit it with vi and gedit, it looks the same
 Quote

Status: offline

manowar

Forum User
Regular Poster
Registered: 07/11/07
Posts: 81
Location:Santiago - Chile
Quote 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:

PHP Formatted Code
            fwrite(fopen($_CONF['path_data'].$file, 'a'), "<span class="".$nickname."">".$nickname."&nbsp;".ltrim(date('h:i:s A'), 0)."</span>".$breaking_character.$message);

to:
PHP Formatted Code
            fwrite(fopen($_CONF['path_data'].$file, 'a'),utf8_encode("<span class="".$nickname."">".$nickname."&nbsp;".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.
 Quote

Status: offline

suprsidr

Forum User
Full Member
Registered: 29/12/04
Posts: 555
Location:Champaign, Illinois
I'll have time to look at it further tonight.

-s
FlashYourWeb and Your Gallery with the E2 XML Media Player for Gallery2 - http://www.flashyourweb.com
 Quote

Status: offline

suprsidr

Forum User
Full Member
Registered: 29/12/04
Posts: 555
Location:Champaign, Illinois
Finally got a second to look at this.
public_html/jQchat/process.php line~111:
PHP Formatted Code
        $message = htmlentities(strip_tags($_POST['message']));

to:
PHP Formatted Code
        $message = strip_tags($_POST['message']);


-s
FlashYourWeb and Your Gallery with the E2 XML Media Player for Gallery2 - http://www.flashyourweb.com
 Quote

Status: offline

manowar

Forum User
Regular Poster
Registered: 07/11/07
Posts: 81
Location:Santiago - Chile
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.
 Quote

Status: offline

suprsidr

Forum User
Full Member
Registered: 29/12/04
Posts: 555
Location:Champaign, Illinois
Hope all is well for you in Chile
Really? it worked for me.
Please try my dev sample.

If that works, I'll zip that up for you.

-s
FlashYourWeb and Your Gallery with the E2 XML Media Player for Gallery2 - http://www.flashyourweb.com
 Quote

Status: offline

manowar

Forum User
Regular Poster
Registered: 07/11/07
Posts: 81
Location:Santiago - Chile
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
 Quote

Status: offline

suprsidr

Forum User
Full Member
Registered: 29/12/04
Posts: 555
Location:Champaign, Illinois
I've updated the archive w/ the version from my dev site.
http://www.flashyourweb.com/filemgmt/index.php?id=33

-s
FlashYourWeb and Your Gallery with the E2 XML Media Player for Gallery2 - http://www.flashyourweb.com
 Quote

Status: offline

manowar

Forum User
Regular Poster
Registered: 07/11/07
Posts: 81
Location:Santiago - Chile
worked!!

Thanks you.

un millon de gracias
 Quote

All times are EDT. The time is now 11:46 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content