Improve flat view for linked LP forum - refs #8004

1.10.x
Angel Fernando Quiroz Campos 9 years ago
parent 8567e0756f
commit 5f6d4d615d
  1. 8
      main/forum/viewthread.php
  2. 27
      main/forum/viewthread_flat.inc.php
  3. 47
      main/forum/viewthread_nested.inc.php

@ -262,17 +262,15 @@ if ($my_message != 'PostDeletedSpecial') {
switch ($viewMode) {
case 'flat':
//no break
default:
include_once 'viewthread_flat.inc.php';
break;
case 'threaded':
//include_once 'viewthread_threaded.inc.php';
//break;
//no break;
case 'nested':
include_once 'viewthread_nested.inc.php';
break;
default:
include_once 'viewthread_flat.inc.php';
break;
}
}

@ -36,6 +36,8 @@ if (isset($current_thread['thread_id'])) {
$closedPost = null;
if (!empty($rows)) {
$postCount = count($rows);
foreach ($rows as $row) {
if ($row['user_id'] == '0') {
$name = prepare4display($row['poster_name']);
@ -118,20 +120,31 @@ if (isset($current_thread['thread_id'])) {
array('class' => 'title-username')
);
} else {
$name = Display::tag('strong', "#" . $postCount--, ['class' => 'text-info']) . " | $name";
$html .= Display::tag(
'span',
'p',
$name,
array(
'title' => api_htmlentities($username, ENT_QUOTES)
'title' => api_htmlentities($username, ENT_QUOTES),
'class' => 'lead'
)
);
}
$html .= Display::tag(
'p',
api_convert_and_format_date($row['post_date']),
array('class' => 'post-date')
);
if ($origin != 'learnpath') {
$html .= Display::tag(
'p',
api_convert_and_format_date($row['post_date']),
array('class' => 'post-date')
);
} else {
$html .= Display::tag(
'p',
api_convert_and_format_date($row['post_date'], DATE_TIME_FORMAT_SHORT),
array('class' => 'text-muted')
);
}
// get attach id
$attachment_list = get_attachment($row['post_id']);

@ -34,6 +34,8 @@ $sessionId = api_get_session_id();
$currentThread = get_thread_information($_GET['thread']);
$userId = api_get_user_id();
$postCount = count($rows);
foreach ($rows as $post) {
// The style depends on the status of the message: approved or not.
if ($post['visible'] == '0') {
@ -68,19 +70,40 @@ foreach ($rows as $post) {
$name = api_get_person_name($post['firstname'], $post['lastname']);
}
if (api_get_course_setting('allow_user_image_forum')) {
$html .= '<div class="thumbnail">' . display_user_image($post['user_id'], $name, $origin) . '</div>';
if ($origin != 'learnpath') {
if (api_get_course_setting('allow_user_image_forum')) {
$html .= '<div class="thumbnail">' . display_user_image($post['user_id'], $name, $origin) . '</div>';
}
$html .= Display::tag(
'h4',
display_user_link($post['user_id'], $name, $origin, $username),
array('class' => 'title-username')
);
} else {
$html .= Display::tag(
'p',
$name,
array(
'title' => api_htmlentities($username, ENT_QUOTES),
'class' => 'lead'
)
);
}
if ($origin != 'learnpath') {
$html .= Display::tag(
'p',
api_convert_and_format_date($post['post_date']),
array('class' => 'post-date')
);
} else {
$html .= Display::tag(
'p',
api_convert_and_format_date($post['post_date'], DATE_TIME_FORMAT_SHORT),
array('class' => 'text-muted')
);
}
$html .= Display::tag(
'h4',
display_user_link($post['user_id'], $name, $origin, $username),
array('class' => 'title-username')
);
$html .= Display::tag(
'p',
api_convert_and_format_date($post['post_date']),
array('class' => 'post-date')
);
// get attach id
$attachment_list = get_attachment($post['post_id']);

Loading…
Cancel
Save