Guestbook in Hungarian

More
10 years 11 months ago #13512 by Pete
Replied by Pete on topic Guestbook in Hungarian

igorlaszlo wrote: Oh, yes, it works ! But only with the new messages... i guess you can change the date of the existing messages also, in the list.txt in the data folder but i prefer not to touch it until Pete confirms that it is possible and we do not lose the old messages with editing the text file...


I don't recommend editing the list.txt data file manually, as it stores entries as serialized objects and is a lot more complex then it looks. But if you are set on changing it, review this post I wrote a while back on how to do it:

www.digioz.com/forum/2-php/885-how-to-sa...-guestbook-data-file

igorlaszlo wrote: So Pete, just to summerize :

- how can we integrate GMT+1 in the code ?
- how can we change the language for the day (ie. Friday = Péntek) to Hungarian ?
- how to change the charset to UTF-8 to show the special characters like "é" ?

I thought i am ready with my website, i always find things :woohoo:


For timezone, you will have to use the "date_timezone_set" function in PHP ( list of supported timezones ):
Code:
$date->setTimezone(new DateTimeZone('Europe/Vienna')); $date = date("Y M d H:i, l");

As for changing the days of the week, you will have to use the local function:
Code:
setlocale (LC_TIME, "Hungarian");

As for UTF-8, the guestbook should already show special characters in UTF-8, but only if:

1- The guestbook script files were created as UTF-8 (which they were), and also when you edited the contents of the PHP file, you didn't change the encoding.
2- The Server tells what's the encoding of the delivered file. Usually if #1 is true, then the server renders the UTF-8, but there is a way to force the server to render UTF-8:

I. Add the following header right below each PHP opening tag in each PHP file:
Code:
header('Content-type: text/html; charset=utf-8')

II. Put a .htaccess file which contains the following in it:
Code:
AddDefaultCharset UTF-8

III. Add the following meta to the HTML header section of the guestbook:
Code:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

That should do it for you!

Pete

DigiOz Webmaster
www.digioz.com

Please Log in or Create an account to join the conversation.

More
10 years 11 months ago - 10 years 11 months ago #13515 by igorlaszlo
Replied by igorlaszlo on topic Guestbook in Hungarian
Hello pete,

thanks for your answer, i hope you had a nice trip the weekend...

So, nothing works for the moment...

To changing the days of the week, i did not try because i would not like to use it, i do not know if Boby had a succes or not...

Concerning the Time Zone, i put your code
Code:
$date->setTimezone(new DateTimeZone('Europe/Paris'));
in the add.php file, just before the
Code:
$date = date("d F Y, H:i");
code. (Europe/Paris exists as far as i know)
When i want to post a test message, the system does not let me but saying the followings : "Fatal error: Call to a member function setTimezone() on a non-object in /home/igorlasz/public_html/guestbook/add.php on line 77". It corresponds exactly with your code...

Concerning the UTF-8...
I added your code
Code:
header('Content-type: text/html; charset=utf-8')
(i added a ";" at the end) to the add.php, list.php, header.php, guestbook.php, index.php and language.php files but it did not solve the problem.
You have to know that i visualize the guesbook on my webpage in an iframe. My webpage shows special characters. Also the posted messages are well-shown. But when you see for example the label of the form : Email (Not published / Non publié), it has a "�" instead of an "é". Also, when you write a message, the confirmation text does not support the special characters... so it is something about the language file, isn't it ?

Do you still have patience to solve it ? :)
Last edit: 10 years 11 months ago by igorlaszlo.

Please Log in or Create an account to join the conversation.

More
10 years 11 months ago #13518 by Pete
Replied by Pete on topic Guestbook in Hungarian
Hello Igor,

Please provide the following info:
  1. What is the exact version of PHP on your Server?
  2. What Operating System does your Server run on?
  3. What is your Web Server Software (Apache/IIS) and exact version?

Also, could you zip up your whole guestbook folder and send it over to me at webmaster@digioz.com?

Thanks,
Pete

DigiOz Webmaster
www.digioz.com

Please Log in or Create an account to join the conversation.

Time to create page: 0.119 seconds
Powered by Kunena Forum