Perhaps it's going to be useful to someone.
I have a phpbb forum and an external site where I'm including a lasttopics.php page, which shows up the latest posts or topics.
The main problem is that both phpbb and the site have GMT/UTC time settings, and while the posts are taken from the forum and displayed to the site, every date misses two hours (I'm UTC -2 and think that both phpbb and the site are taking their -2 hours from the posts).
As a result, I was missing 2 hours on the site (but only for the lastposts, because every other date is OK).
Yes, I said WAS missing, because here there is a very simple solution:
Just add this line:
Code: Select all
date_default_timezone_set('Europe/Rome');
before:
Code: Select all
$table_topics = $table_prefix. "topics";
$table_forums = $table_prefix. "forums";
and everything should be great.
Of course put your location instead of Rome!
Hope this helps.
On the other hand, I still have something else that troubles me.
Both forum and site has UTF-8, but the topics are loosing the encoding.
I mean, in the forum everything is great, like the éàù letters, but on the site this letters are changed, like that the double encoding isn't good for them (like it was for the post time).
Has someone a solution for this?
Thanks.
NEVERMIND, I seem to have found the solution also for this one. It seems the collation of my database is different from utf-8 or something like this.
To avoid strange characters in topic names, you should put
Code: Select all
@mysql_query('SET CHARACTER SET UTF8');
before
Code: Select all
$query = "SELECT t.topic_id, t.topic_title, t.to.....