>>  Site Map >>  Forums >>  Blocks

Forum module - topics in forum:



Blocks - Having problems with a block? Code doesn't work, get help here.



time offset is incorrect for block-Forums.php

website: http://www.royalmilitia.com/wow2/modules.php?name=Forums

the block-Forums.php up top lists the time of the last posts made but lists it as when it was FIRST POSTED.

That works fine. However, the time offset is incorrect. The times for everything else on the forums is correctly displayed as EST.

How can I fix it?

Here's the coding for block-Forums.php:

Code: :

<?php

/************************************************************************/
/* Forums Block for phpBB 2.0.0 port to PHP Nuke 6.5b6+                 */
/* ====================================================                 */
/*                                                                      */
/* Copyright (c) 2002 by Francisco Burzi (fbc@mandrakesoft.com)         */
/* http://phpnuke.org                                 */
/*                                             */
/* Version 1, modified by Sébastien Vaast                               */
/* http://membres.lycos.fr/projectpluto/                                */
/*                                                                      */
/* Updated by Tom Nitzschner 22/06/2002 to add the scrolling text       */
/*                                                                      */
/* Updated by Paul Laudanski 14 Jan 2003                                */
/* NukeCops.com  |  ComputerCops.biz                     */
/*                                                         */
/* Updated by Matthew Bolt 20 Dec 2003                                  */
/* Masheads.com                                                         */
/*                                                                      */
/* Last Edited - 14 Jan 2003                              */
/*                                                         */
/* This Block shows the last 20 topics where a message was posted,   */
/* along with the username of the last poster and the day and time   */
/* of the post.                                    */
/* It will also show smileys in the topic titles thanks to the      */
/* smileys.php file found in Leo Tan Block Forums version            */
/* (http://www.cybercomp.d2g.com).                           */
/*                                             */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/

if (eregi("block-Forums.php", $PHP_SELF)) {
    Header("Location: index.php");
    die();
}

include_once ('blocks/smileys.php');

global $prefix, $dbi, $sitename, $user, $cookie, $group_id;
$count = 1;
$result1 = sql_query("SELECT t.topic_id, t.topic_last_post_id, t.topic_title, f.forum_name, f.forum_id FROM ".$prefix."_bbtopics t, ".$prefix."_bbforums f where t.forum_id=f.forum_id and f.auth_view=0  ORDER BY t.topic_last_post_id DESC LIMIT 10", $dbi);
$content .= "<br><table border=\"0\"><tr><td>&nbsp;</td><td><b>Topic</b></td><td><b>Last Post By</b></td><td><b>Posted On</b></td></tr>";
while(list($topic_id, $topic_last_post_id, $topic_title, $forum_name, $forum_id) = sql_fetch_row($result1, $dbi)) {
$result2 = sql_query("SELECT topic_id, poster_id, FROM_UNIXTIME(post_time,'%e-%m-%Y @ %r') as post_time FROM ".$prefix."_bbposts where post_id='$topic_last_post_id'", $dbi);
list($topic_id, $poster_id, $post_time)=sql_fetch_row($result2, $dbi);

$result3 = sql_query("SELECT username, user_id FROM ".$prefix."_users where user_id='$poster_id'", $dbi);
list($username, $user_id)=sql_fetch_row($result3, $dbi);

$topic_title=parseEmoticons($topic_title);

$content .= "<tr><td width=\"5%\"><img src=\"modules/Forums/templates/subSilver/images/icon_mini_message.gif\" border=\"0\" alt=\"\"></td><td width=\"45%\"><a href=\"modules.php?name=Forums&amp;file=viewtopic&amp;p=$topic_last_post_id#$topic_last_post_id\"STYLE=\"text-decoration: none\"><b> $topic_title </b></a></td><td width=\"25%\"nowrap><A HREF=\"modules.php?name=Forums&file=profile&mode=viewprofile&u=$user_id\"STYLE=\"text-decoration: none\"> $username </a></td><td width=\"25%\"nowrap>$post_time</td></tr>";

$count = $count + 1;
}
$content .= "</table><br><center>[ <a href=\"modules.php?name=Forums\"STYLE=\"text-decoration: none\">Access Forums ]</center>";
?>


I have already corrected the mainfile.php for the News posts as well as the lang-english.php to correctly list the timezone as EST. That, however, doesn't affect this.

It references:

Code: :

$result2 = sql_query("SELECT topic_id, poster_id, FROM_UNIXTIME(post_time,'%e-%m-%Y @ %r') as post_time FROM ".$prefix."_bbposts where post_id='$topic_last_post_id'", $dbi);
list($topic_id, $poster_id, $post_time)=sql_fetch_row($result2, $dbi);


I'm not so savvy with php but I know this is my main lead into fixing this.

Thx in advance for any help!






Quote: :
$result2 = sql_query("SELECT topic_id, poster_id, FROM_UNIXTIME(post_time,'%e-%m-%Y @ %r') as post_time FROM ".$prefix."_bbposts where post_id='$topic_last_post_id'", $dbi);
list($topic_id, $poster_id, $post_time)=sql_fetch_row($result2, $dbi);
Represents the server time.

You can set forum offset from forum profiles and from the admin panel>>>> forums>>>> configuration.

The block is only pulling the info from the server and the accounts so if they are wrong the block too will be wrong.






that's why i'm confused.

The forum times are correct. These, however, as displayed are incorrect. Click the link and see yourself.

Can't figure it out =\




Attention! You are currently viewing sitemap page!
We strongly suggest to look at original content

Search from web

Valid HTML 4.01 Valid CSS