diff --git a/main/forum/index.php b/main/forum/index.php index 9dcb78af98..f004858c5d 100755 --- a/main/forum/index.php +++ b/main/forum/index.php @@ -404,6 +404,7 @@ if (is_array($forumCategories)) { $form_count++; $mywhatsnew_post_info = isset($whatsnew_post_info[$forum['forum_id']]) ? $whatsnew_post_info[$forum['forum_id']] : null; + $html = '
| ';
+ $forumId = $forum_category['cat_id'];
+ $forumTitle = $forum_category['cat_title'];
+ $linkForumCategory = 'viewforumcategory.php?'.api_get_cidreq().'&forumcategory='.strval(intval($forumId));
+ $descriptionCategory = $forum_category['cat_comment'];
+ $icoCategory = Display::return_icon('forum_blue.png',
+ get_lang($forumCategory['cat_title']),
+ array('class'=>''),
+ ICON_SIZE_MEDIUM
+ );
- echo ''.prepare4display($forum_category['cat_title']).$session_displayed.''. $session_img .' '; + if (api_is_allowed_to_edit(false, true) && !($forum_category['session_id'] == 0 && intval($my_session) != 0)) { - echo ''.prepare4display($forum_category['cat_comment']).''; + $iconsEdit = ''. + Display::return_icon( + 'edit.png', + get_lang('Edit'), + array(), + ICON_SIZE_SMALL + ).''; + $iconsEdit .= '". + Display::return_icon( + 'delete.png', + get_lang('Delete'), + array(), + ICON_SIZE_SMALL + ).''; + $iconsEdit .= return_visible_invisible_icon('forumcategory', $forum_category['cat_id'], $forum_category['visibility'], array('forumcategory' => $_GET['forumcategory'])); + $iconsEdit .= return_lock_unlock_icon('forumcategory', $forum_category['cat_id'], $forum_category['locked'], array('forumcategory' => $_GET['forumcategory'])); + $iconsEdit .= return_up_down_icon('forumcategory', $forum_category['cat_id'], $forum_categories_list); + $html .= Display::tag('div',$iconsEdit,array('class'=>'pull-right')); + } - if (api_is_allowed_to_edit(false, true) && !($forum_category['session_id'] == 0 && intval($my_session) != 0)) { - echo ' | '; - echo ''.Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).''; - echo '".Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).''; - display_visible_invisible_icon('forumcategory', $forum_category['cat_id'], $forum_category['visibility'], array('forumcategory' => $_GET['forumcategory'])); - display_lock_unlock_icon('forumcategory', $forum_category['cat_id'], $forum_category['locked'], array('forumcategory' => $_GET['forumcategory'])); - display_up_down_icon('forumcategory', $forum_category['cat_id'], $forum_categories_list); - echo ' | '; + $html .= Display::tag( + 'h3',$icoCategory. + Display::tag('a', + $forumTitle, + array( + 'href'=>$linkForumCategory, + 'class'=>status_visible_invisible(strval(intval($forum_category['visibility']))) + ) + ).$session_displayed.$session_img, + null + ); + + + + if ($descriptionCategory != '' && trim($descriptionCategory)!= ' ') + { + $html .= '||||
|---|---|---|---|---|---|
| '; */ + // Step 3: The interim headers (for the forum). + /* echo ' | |||||
| '.get_lang('Forum').' | '; echo ''.get_lang('ForumThreads').' | '; @@ -190,7 +233,12 @@ if ($action_forums != 'add') { echo ''.get_lang('Actions').' | '; echo '|||
| ';
+
+ $html = ' ';
+ $html .= ' ';
+
$my_whatsnew_post_info = isset($whatsnew_post_info[$forum['forum_id']]) ? $whatsnew_post_info[$forum['forum_id']] : null;
- if ($forum['forum_of_group'] !== '0') {
- if (is_array($my_whatsnew_post_info) && !empty($my_whatsnew_post_info)) {
- echo Display::return_icon('forumgroupnew.gif');
- } else {
- echo Display::return_icon('forumgroup.gif', get_lang('GroupForum'));
- }
+
+
+ if ($forum['forum_of_group'] == '0') {
+ $forum_image = Display::return_icon(
+ 'forum_group.png',
+ get_lang('GroupForum'),
+ null,
+ ICON_SIZE_LARGE
+ );
+
} else {
- if (is_array($my_whatsnew_post_info) && !empty($my_whatsnew_post_info)) {
- echo Display::return_icon('forum.gif', get_lang('Forum'));
- } else {
- echo Display::return_icon('forum.gif');
- }
+ $forum_image = Display::return_icon(
+ 'forum.png',
+ get_lang('Forum'),
+ null,
+ ICON_SIZE_LARGE
+ );
}
- echo ' | ';
if ($forum['forum_of_group'] != '0') {
$my_all_groups_forum_name = isset($all_groups[$forum['forum_of_group']]['name']) ? $all_groups[$forum['forum_of_group']]['name'] : null;
@@ -276,15 +330,93 @@ if ($action_forums != 'add') {
} else {
$session_displayed = '';
}
- echo ''.prepare4display($forum['forum_title']).$session_displayed.''.$forum_title_group_addition.' '.prepare4display($forum['forum_comment']).' | ';
//$number_forum_topics_and_posts=get_post_topics_of_forum($forum['forum_id']); // deprecated
// the number of topics and posts
- $my_number_threads = isset($forum['number_of_threads']) ? $forum['number_of_threads'] : '';
+ $my_number_threads = isset($forum['number_of_threads']) ? $forum['number_of_threads'] : 0 ;
+
+ $my_number_posts = isset($forum['number_of_posts']) ? $forum['number_of_posts'] : 0 ;
+
+ $html .= ''.$my_number_threads.' | '; - echo ''.$my_number_posts.' | '; // the last post in the forum if ($forum['last_poster_name'] != '') { $name = $forum['last_poster_name']; @@ -293,38 +425,54 @@ if ($action_forums != 'add') { $name = api_get_person_name($forum['last_poster_firstname'], $forum['last_poster_lastname']); $poster_id = $forum['last_poster_id']; } - echo '';
+ $html .= ' ';
if (!empty($forum['last_post_id'])) {
- echo $forum['last_post_date'].' '.get_lang('By').' '.display_user_link($poster_id, $name);
+ $html .= Display::return_icon(
+ 'post-item.png',
+ null,
+ null,
+ ICON_SIZE_TINY
+ ).' ';
+ $html .= api_convert_and_format_date(
+ $forum['last_post_date']
+ ).' '.get_lang('By').' '.display_user_link($poster_id, $name);
}
- echo ' | ';
- echo '';
+ $html .= '';
+ $html .= ' ';
if (api_is_allowed_to_edit(false, true) && !($forum['session_id'] == 0 && intval(isset($_SESSION['id_session']) ? $_SESSION['id_session'] : null) != 0)) {
- echo ''.Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'';
- echo '".Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'';
- display_visible_invisible_icon('forum', $forum['forum_id'], $forum['visibility'], array('forumcategory' => $_GET['forumcategory']));
- display_lock_unlock_icon('forum', $forum['forum_id'], $forum['locked'], array('forumcategory' => $_GET['forumcategory']));
- display_up_down_icon('forum', $forum['forum_id'], $forums_in_category);
+ $html .= ''.Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'';
+ $html .= '".Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'';
+ $html .= return_visible_invisible_icon('forum', $forum['forum_id'], $forum['visibility'], array('forumcategory' => $_GET['forumcategory']));
+ $html .= return_lock_unlock_icon('forum', $forum['forum_id'], $forum['locked'], array('forumcategory' => $_GET['forumcategory']));
+ $html .= return_up_down_icon('forum', $forum['forum_id'], $forums_in_category);
}
- $iconnotify = 'send_mail.gif';
+ $iconnotify = 'notification_mail_na.png';
if (is_array(isset($_SESSION['forum_notification']['forum']) ? $_SESSION['forum_notification']['forum'] : null)) {
if (in_array($forum['forum_id'],$_SESSION['forum_notification']['forum'])) {
- $iconnotify = 'send_mail_checked.gif';
+ $iconnotify = 'notification_mail.png';
}
}
if (!api_is_anonymous()) {
- echo ''.Display::return_icon($iconnotify, get_lang('NotifyMe')).'';
+ $html .= ''.Display::return_icon($iconnotify, get_lang('NotifyMe')).'';
}
- echo ' |
| '.get_lang('NoForumInThisCategory').' | |||||