Pagina 1 di 1

Format_date da post_time in POSTS_TABLE

Inviato: 20/10/2012, 20:30
da digreo

Codice: Seleziona tutto

$sql = "SELECT forum_id, topic_id, post_id, post_subject FROM ".POSTS_TABLE." ORDER BY post_time DESC LIMIT 0,10";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)){
 $template->assign_block_vars('last_topics',array(
  'POST_TIME' => $user->format_date($row['post_time'])
  ));
}
$db->sql_freeresult($result);
Il signor POST_TIME è sempre uguale a 01/01/1970, 0:00
Devo includere altra qualche cosa?

Questi a seguito sono già inclusi!

Codice: Seleziona tutto

include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
:geek:

Re: Format_date da post_time in POSTS_TABLE

Inviato: 24/10/2012, 14:44
da digreo
RISOLTO:
Dovevo dichiarare post_time nella Select::

$sql = "SELECT forum_id, topic_id, post_id, post_subject, post_time FROM ".POSTS_TABLE." ORDER BY post_time DESC LIMIT 0,10";

:D