Zeit 01.01.1970
Verfasst: 09.07.2004 15:15
ok die andere Sache hab ich gelöst,aber jetzt wird bei jedem Post bei der Zeit des letzen Beitrages der 1. Januar 1970 angezeigt...
Code: Alles auswählen
$sql = "SELECT *
FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f , " . USERS_TABLE . " u, " . POSTS_TABLE . " p
WHERE t.topic_type = 2
AND t.forum_id = f.forum_id
AND t.topic_id = p.topic_id
AND p.post_id = t.topic_last_post_id
AND u.user_id = p.poster_id
ORDER BY t.topic_time DESC
LIMIT 5";
$result = mysql_query($sql);
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error in obtaining Announcement data', '', __LINE__, __FILE__, $sql);
}
$AnnouncementList = array();
while ($row = $db->sql_fetchrow($result) )
{
$AnnouncementList['title'] = $row['topic_title'];
$AnnouncementList['forum_name'] = $row['forum_name'];
$AnnouncementList['forum_id'] = $row['forum_id'];
$AnnouncementList['last_post_time'] = $row['last_post_time'];
$AnnouncementList['views'] = $row['topic_views'];
$AnnouncementList['comments'] = $row['topic_replies'];
$AnnouncementList['last_post_author'] = $row['username'];
$AnnouncementList['last_post_time'] = date ("d.m.Y", $row['last_post_time']);
$AnnouncementList['topic_id'] = $row['topic_id'];
$AnnouncementList['last_post_user_id'] = $row['user_id'];
$AnnouncementList['last_post_id'] = $row['topic_last_post_id'];
$template->assign_block_vars('announcement', array(
'ATOPICTITLE' => $AnnouncementList['title'],
'ATOPICFORUM' => $AnnouncementList['forum_name'],
'ATOPICLASTPOSTTIME' => $AnnouncementList['last_post_time'],
'ATOPICVIEWS' => $AnnouncementList['views'],
'ATOPICREPLIES' => $AnnouncementList['comments'],
'ATOPICFORUMID' => $AnnouncementList['forum_id'],
'ATOPICLASTPOSTID' => $AnnouncementList['last_post_id'],
'ATOPICID' => $AnnouncementList['topic_id'],
'ATOPICLASTPOSTTIME' => $AnnouncementList['last_post_time'],
'ATOPICLASTPOSTAUTHOR' => $AnnouncementList['last_post_author'],
'ATOPICLASTPOSTUSERID' => $AnnouncementList['last_post_user_id'])
);
}