Fixing timezone convertions in forums

skala
Julio Montoya 14 years ago
parent b8196ecbe2
commit b911e15689
  1. 2
      main/forum/iframe_thread.php
  2. 2
      main/forum/index.php
  3. 6
      main/forum/viewforum.php
  4. 9
      main/forum/viewthread_flat.inc.php
  5. 2
      main/forum/viewthread_nested.inc.php
  6. 2
      main/forum/viewthread_threaded.inc.php

@ -107,7 +107,7 @@ while ($row = Database::fetch_array($result)) {
$name = api_get_person_name($row['firstname'], $row['lastname']);
}
echo $name.'<br />';
echo $row['post_date'].'<br /><br />';
echo api_convert_and_format_date($row['post_date']).'<br /><br />';
echo "</td>";
echo "<td class=\"forum_message_post_title\">".Security::remove_XSS($row['post_title'])."</td>";

@ -400,7 +400,7 @@ if (is_array($forum_categories_list)) {
echo '<td nowrap="nowrap">';
if (!empty($forum['last_post_id'])) {
echo api_convert_and_format_date($forum['last_post_date'], null, date_default_timezone_get()).'<br /> '.get_lang('By').' '.display_user_link($poster_id, $name);
echo api_convert_and_format_date($forum['last_post_date']).'<br /> '.get_lang('By').' '.display_user_link($poster_id, $name);
}
echo '</td>';
echo '<td nowrap="nowrap" align="center">';

@ -374,19 +374,19 @@ if (is_array($threads)) {
// If the last post is invisible and it is not the teacher who is looking then we have to find the last visible post of the thread.
if (($row['visible'] == '1' OR api_is_allowed_to_edit(false, true)) && $origin != 'learnpath') {
$last_post = api_convert_and_format_date($row['thread_date'], null, date_default_timezone_get()).' '.get_lang('By').' '.display_user_link($row['last_poster_user_id'], $name);
$last_post = api_convert_and_format_date($row['thread_date']).' '.get_lang('By').' '.display_user_link($row['last_poster_user_id'], $name);
} elseif ($origin != 'learnpath') {
$last_post_sql = "SELECT post.*, user.firstname, user.lastname FROM $table_posts post, $table_users user WHERE post.poster_id=user.user_id AND visible='1' AND thread_id='".$row['thread_id']."' ORDER BY post_id DESC";
$last_post_result = Database::query($last_post_sql);
$last_post_row = Database::fetch_array($last_post_result);
$name = api_get_person_name($last_post_row['firstname'], $last_post_row['lastname']);
$last_post = api_convert_and_format_date($last_post_row['post_date'], null, date_default_timezone_get()).' '.get_lang('By').' '.display_user_link($last_post_row['poster_id'], $name);
$last_post = api_convert_and_format_date($last_post_row['post_date']).' '.get_lang('By').' '.display_user_link($last_post_row['poster_id'], $name);
} else {
$last_post_sql = "SELECT post.*, user.firstname, user.lastname FROM $table_posts post, $table_users user WHERE post.poster_id=user.user_id AND visible='1' AND thread_id='".$row['thread_id']."' ORDER BY post_id DESC";
$last_post_result = Database::query($last_post_sql);
$last_post_row = Database::fetch_array($last_post_result);
$name = api_get_person_name($last_post_row['firstname'], $last_post_row['lastname']);
$last_post = api_convert_and_format_date($last_post_row['post_date'], null, date_default_timezone_get()).' '.get_lang('By').' '.$name;
$last_post = api_convert_and_format_date($last_post_row['post_date']).' '.get_lang('By').' '.$name;
}
echo '<td>'.$last_post.'</td>';

@ -34,11 +34,11 @@ if (isset($current_thread['thread_id'])){
echo "<td rowspan=\"3\" class=\"$leftclass\">";
if ($row['user_id']=='0') {
$name=prepare4display($row['poster_name']);
$name = prepare4display($row['poster_name']);
} else {
$name=api_get_person_name($row['firstname'], $row['lastname']);
$name = api_get_person_name($row['firstname'], $row['lastname']);
}
if($origin!='learnpath') {
if ($origin!='learnpath') {
if (api_get_course_setting('allow_user_image_forum')) {
echo '<br />'.display_user_image($row['user_id'],$name).'<br />';
}
@ -46,7 +46,8 @@ if (isset($current_thread['thread_id'])){
} else {
echo $name. '<br />';
}
echo api_convert_and_format_date($row['post_date'], null, date_default_timezone_get()).'<br /><br />';
echo api_convert_and_format_date($row['post_date']).'<br /><br />';
// get attach id
$attachment_list=get_attachment($row['post_id']);
$id_attach = !empty($attachment_list)?$attachment_list['id']:'';

@ -54,7 +54,7 @@ foreach ($rows as $post) {
echo '<br />'.display_user_image($post['user_id'],$name,$origin).'<br />';
}
echo display_user_link($post['user_id'], $name, $origin).'<br />';
echo api_convert_and_format_date($post['post_date'], null, date_default_timezone_get()).'<br /><br />';
echo api_convert_and_format_date($post['post_date']).'<br /><br />';
// get attach id
$attachment_list=get_attachment($post['post_id']);
$id_attach = !empty($attachment_list)?$attachment_list['id']:'';

@ -164,7 +164,7 @@ if ($rows[$display_post_id]['user_id']=='0') {
if (api_get_course_setting('allow_user_image_forum')) {echo '<br />'.display_user_image($rows[$display_post_id]['user_id'],$name, $origin).'<br />'; }
echo display_user_link($rows[$display_post_id]['user_id'], $name, $origin).'<br />';
echo api_convert_and_format_date($rows[$display_post_id]['post_date'], null, date_default_timezone_get()).'<br /><br />';
echo api_convert_and_format_date($rows[$display_post_id]['post_date']).'<br /><br />';
// get attach id
$attachment_list=get_attachment($display_post_id);
$id_attach = !empty($attachment_list)?$attachment_list['id']:'';

Loading…
Cancel
Save