|
@@ -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']);
|