UTF-8 render

Is message board greying out your hair (at least what's left of it)? Let us help you here
ngosac
Posts: 15
Joined: Sun Mar 23, 2008 3:30 am

UTF-8 render

Post by ngosac »

Script URL:www.ngogiatrang.com/xomnoixamphp
Version of script: 1.3
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:
UTF-8
Write your message below:

Dear Klemen Stirn,

First, I would like to thank you very much for spending time to write the free MBoard and build this support forum. I like your script alot and also purchased the copyright remove. It works right away! I have only one problem and spent alot of times to read, search all the forum and web for my question, but couldn't find the answer. The only thing I need your help to complete my message board is:

I used a JavaScript to enter Vietnamese text message and it was successful but only on new topic. When I click that new topic to reply, the Java Script still there (looked in browser's source code) but I couldn't type Vietnamse in text area. The JavaScript is instructed to put at the end of page (before </HTML>). Meta tag already changed like this in both new and reply page:
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">

I really appreciate any help or answer.
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post by Henrie »

Have you already changed the mboard.php file.

You should change it to use the UTF-8 charset.
Open mboard.php and find line 346

Code: Select all

<meta content="text/html; charset=windows-1250">
and replace it with

Code: Select all

<meta content="text/html; charset=utf-8">
Also do the same at line 746.

Now it should be correct in all new postings.

Greetings,
Henrie
ngosac
Posts: 15
Joined: Sun Mar 23, 2008 3:30 am

Post by ngosac »

Thanks for suggestion, Henrie.

Maybe I confused you. I changed Charset=UTF-8 in Mboard.pl before post my question and UTF-8 rendered good in browser.
My real question is "I don't know why the Javascript I installed only works on New Topic, not the NewReply ?"

Thanks again for quick reply
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post by Henrie »

Indeed, i misunderstood you.

I think it is because you use a relative path to the javascript:

Code: Select all

<script language="Javascript" src='./viettypingplus.js'></script>
.Try replacing this with

Code: Select all

<script language="Javascript" src='http://www.ngogiatrang.com/viettypingplus.js'></script>
in the footer.txt file.

The messages are stored in a subfolder msg of the mboard. Because of that relative paths which work in mboard.php (New Topic) will not work in the messages (where you have New Reply).

Greetings,
Henrie
ngosac
Posts: 15
Joined: Sun Mar 23, 2008 3:30 am

Post by ngosac »

Henrie,

You are the best . It works as I wanted. I don't know how to appreciate your help .

Thank you and God bless you !
:)
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post by Henrie »

You could buy Klemen a beer!
Klemen, author
PHPJunkyard - free PHP scripts

Was this response helpful? Do you like my scripts? Feel free to buy me a beer!
Link buy Klemen a beer!

Greetings,
Henrie
ngosac
Posts: 15
Joined: Sun Mar 23, 2008 3:30 am

Post by ngosac »

I bought Klemen a beer :wink:

Another question:
Currently, when delete a message in MBoard, it will delete other reply message to the one being deleted !
Is there any way to delete individual message with out effected other message replied to it ?

I also like to remove the number of message replied to a post but don't know how !

Always appreciate your help.
ngosac
Posts: 15
Joined: Sun Mar 23, 2008 3:30 am

found 1 answer

Post by ngosac »

found the answer for number of reply removal :
viewtopic.php?t=1665

works great !
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Henrie, send me your PayPal address, I think I owe you a beer :wink:
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post by Henrie »

I'm sorry, I don't like beer :) . I would rather have a glass of Fanta or Coca Cola :D

But buying me one from this distance will be hard as I don't have a paypal address (yet). So just drink one extra for me 8) .

Greetings,
Henrie
ngosac
Posts: 15
Joined: Sun Mar 23, 2008 3:30 am

Post by ngosac »

Henie and Klemen,

On the reply post, when too many poster reply to 1 post, it will show " Re:Re:Re:Re: that topic"

How can I just leave only 1 Re: to the main topic ?

Also, I add Vietnamese Bad Words on en file with Unicode characters and mboard seems like won't take and won't show the replacement . Any suggestion ?

Thanks in advance .
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post by Henrie »

Hello ngosac,

" Re:Re:Re:Re: that topic"
To get only one Re: you will have to edit mboard.php
Find line 399

Code: Select all

<b>Subject:</b><br><input type=text name="subject" value="Re: '.$subject.'" size=30 maxlength=100><br><br>
and replace it with:

Code: Select all

<b>Subject:</b><br><input type=text name="subject" value="';
if (substr ($subject, 0, 3)!='Re:') {$content .= 'Re: ';}
$content .= ''.$subject.'" size=30 maxlength=100><br><br>
Now only the first reply will get a Re:, the other Replys will have the same name as the first reply with only one Re:

add Vietnamese Bad Words on en file with Unicode characters
This is a little harder for me because I do not know how to test. But I know the original badwords en file is saved is in ansi coding. Have you converted it to UTF-8 before adding your UTF-8 badwords?

Greetings,
Henrie
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Ngosac I'm also not sure what's wrong with badwords, but it's probably an encoding issue (like Henrie said). Make sure you write badwords in UTF-8 compatible editor and you can also try changing

Code: Select all

$text = preg_replace("/\b$k\b/i",$v,$text);
to

Code: Select all

$text = htmlspecialchars($text);
$text = preg_replace("/\b$k\b/i",$v,$text);
to see if it makes a difference.

Henrie, sure, it can be a Fanta, let me know when you have an account :wink:
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
ngosac
Posts: 15
Joined: Sun Mar 23, 2008 3:30 am

Post by ngosac »

Henrie and Klemen,

Thank you very much.I like MBoard very much ! The Re:Re:Re:Topic and UFT-8 Badwords are fixed as your suggestions with replacing codes.

Can not wait till the next 1.4 release :)

You guys are very knowledge and helpful.
ngosac
Posts: 15
Joined: Sun Mar 23, 2008 3:30 am

Post by ngosac »

Henrie,

Emergency !
If I enter to go to next paragraph when posting, it will become a whole bun of code :(

please go to xomnoixam.net to look at it if you can . I will buy a coffee for you :)

Thank you
Locked