NineChime forum

Furry stuff, oekaki stuff, and other stuff.

You are not logged in.

Post a reply

Write your message and submit
Options
Humanity test

What is eight + ten?

Go back

Topic review (newest first)

SailorShadow
05-04-2012 00:07:26

Reading through this, it seems like a similar issue to what's happened on our board when upgrading the PHP Version on the server. If it is PHP version 5.2, it works fine, however, changing the PHP Version to 5.3 across the server will result in date/time errors in the comments on the oekaki.

The error code is as follows, which I believe you may have seen:

Code:

Warning: strtotime() [function.strtotime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dnatamer/www/oekaki/index.php on line 669

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/dnatamer/www/oekaki/index.php on line 669

Research led to a wordpress post ( http://wordpress.org/support/topic/php- … s-timezone ) that said it should be defined in the php.ini file to determine the Timezone, but for anyone not able to access the php.ini file, this is suggested and I wanted to share it in case you could figure out some way to make it work for Wackintaki, since I'm not sure about trying it myself without breaking something important... and since a fix would have to set it for anyone who uses Wackintaki, not just one of us and there are a bajillion Timezones. Not sure if any of this will help, though. I hope it does!

If you don't have access to the php.ini, adding this to the top of the wp-config.php file will do much the same thing:

date_default_timezone_set('America/Chicago');

Use whatever timezone is appropriate for you, of course. List is here:
http://us3.php.net/manual/en/timezones.php

Waccoon
03-28-2012 05:58:27

In a nutshell, PHP's locale handler is difficult and about as broken as UTF-8 support.  I just updated to PHP 5.4 and it appears that timezone and locale selections have changed again, so I'm guessing that the code must be tailored for a specific server and the PHP version matters as well.

Alas, this is common with web sites.  Most server software is designed with enterprise use in mind, and not shared hosting meant for redistributable projects.

Sorry, but I'm giving this issue a low priority.

coldZou
03-27-2012 08:28:02

Sorry for that long response,
Thank you, it works on local (wampserver) ! However, it does not online, and I am trying to discover why : (

I think it may come from the php file on the server, but accessing it with my host is a misery ! I have to go through putty etc ...
If you have an idea i'll be glad to hear it smile !

EDIT : NEVERMIND ! I got it :

Code:

setlocale(LC_TIME, 'fr_FR', 'fr');

In place of

Code:

setlocale(LC_ALL, 'fra');

, my bad !

Edit 2 : Maybe it does finally work online, however this time it doesn't on wampserver, someone really gotta tell me what's darn wrong here XD

Waccoon
12-26-2011 19:37:50

*Sigh*  The strftime() function only returns characters in codepage encoding.  You'll need to encode it to UTF-8 yourself:

Code:

utf8_encode(strftime ($datef['post_header'], $my_time ));

...which, of course, would be easier if done this way:

Code:

// COMMON.PHP
function utf_date ($format, $time) {
     return utf8_encode(strftime ($format, $time));
}


// INDEX.PHP
echo utf_date ($datef['post_header'], $my_time);

I'm not sure if PHP's locale functions are reliable enough to add this permanently to the oekaki.  However, I probably should have a custom date printing function, anyway.  Given how much of a mess PHP is, it pretty much demands a full suite of wrappers, so one more won't hurt.  wink

coldZou
12-26-2011 07:08:30

It works : 3 ! Thank you ! However, I had to add this line :

Code:

$datef['admin_edit'] = '%A, %d %B %Y, %H:%M'; // Edited

I didn't realize why php was swearing all the time on edited comments xD

There is just one thing left, for an unknown reason, i have a weird symbol on date accents, that shouldn't happen because the index.php file is already UTF-8 Without BOM =O ! Can this be because of wamp server x) ?

coldZou
12-14-2011 02:57:56

Will try it today, thanks a lot :3 !

Waccoon
12-13-2011 06:31:38

There's a number of problems with what you're trying to do.  Basically, you're trying to replace English words with French words before the date has even been calculated.

The only proper way to print dates in another language is to use the strftime() function instead of date().  I haven't done this, because changing locale under PHP doesn't always work correctly, is inconsistent across different operating systems, and there's multiple issues when mixing character sets.  It's not anywhere near as easy as it should be.

However, this is a start:

Code:

setlocale(LC_TIME, 'fr_FR', 'fr');

$datef['post_header'] = '%A, %d %B %Y, %H:%M';

$my_time = time();
echo strftime ($datef['post_header'], $my_time );

This should print:

Mardi, 13 Décembre 2011, 18:59

It would be necessary to replace all the date() functions throughout the code with strftime().

coldZou
12-12-2011 11:38:02

Hi !

Maybe i'm not doing this right but I was looking for a while now and I can't seem to find anything about changing that $@!#* date >w<.
So far I've been trying, in example, this :

Code:

coldZ Edit : Forget about this code, could be misleading you.

Of course, it din't work : <

If someone could enlighten me I would really appreciate, I'm sure there's another and easier way to do this, lately my mind doesn't work as it should T_T.

Thanks in advance :3

Board footer

Yep, still running PunBB
© Copyright 2002–2008 PunBB