Page 1 of 2

UTF-8 render

Posted: Sun Mar 23, 2008 4:16 am
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.

Posted: Sun Mar 23, 2008 6:55 am
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

Posted: Sun Mar 23, 2008 4:08 pm
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

Posted: Sun Mar 23, 2008 5:04 pm
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

Posted: Sun Mar 23, 2008 6:30 pm
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 !
:)

Posted: Sun Mar 23, 2008 6:41 pm
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

Posted: Sun Mar 23, 2008 8:04 pm
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.

found 1 answer

Posted: Sun Mar 23, 2008 10:54 pm
by ngosac
found the answer for number of reply removal :
viewtopic.php?t=1665

works great !

Posted: Mon Mar 24, 2008 1:22 pm
by Klemen
Henrie, send me your PayPal address, I think I owe you a beer :wink:

Posted: Mon Mar 24, 2008 3:09 pm
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

Posted: Mon Mar 24, 2008 5:45 pm
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 .

Posted: Mon Mar 24, 2008 8:17 pm
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

Posted: Mon Mar 24, 2008 8:43 pm
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:

Posted: Tue Mar 25, 2008 4:01 am
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.

Posted: Tue Mar 25, 2008 4:07 pm
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