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 = '
'; $html .= '
'; @@ -448,48 +449,6 @@ if (is_array($forumCategories)) { } } - - /* - if ($forum['forum_of_group'] !== '0') { - if (is_array( - $mywhatsnew_post_info - ) && !empty($mywhatsnew_post_info) - ) { - $forum_image = Display::return_icon( - 'forumgroupnew.gif' - ); - } else { - $forum_image = Display::return_icon( - 'forum_group.png', - get_lang('GroupForum'), - null, - ICON_SIZE_LARGE - ); - } - } else { - if (is_array( - $mywhatsnew_post_info - ) && !empty($mywhatsnew_post_info) - ) { - $forum_image = Display::return_icon( - 'forum.png', - get_lang('Forum'), - null, - ICON_SIZE_LARGE - ); - } else { - $forum_image = Display::return_icon( - 'forumx.png', - get_lang('Forum'), - null, - ICON_SIZE_LARGE); - } - } - */ - - - - // Validation when belongs to a session $session_img = api_get_session_image( $forum['session_id'], diff --git a/main/forum/viewforumcategory.php b/main/forum/viewforumcategory.php index c9e09401d5..38c700d58d 100755 --- a/main/forum/viewforumcategory.php +++ b/main/forum/viewforumcategory.php @@ -97,16 +97,18 @@ if (!api_is_allowed_to_edit(false,true) AND ($current_forum_category && $current } /* Action Links */ -echo ''; /* ACTIONS */ +echo $html; $action_forums = isset($_GET['action']) ? $_GET['action'] : ''; if (api_is_allowed_to_edit(false, true)) { @@ -154,7 +156,12 @@ if ($action_forums != 'add') { /* Display Forum Categories and the Forums in it */ - echo ''; + $html = ''; + $html .= '
'; + + + + $my_session = isset($_SESSION['id_session']) ? $_SESSION['id_session'] : null; if ((!isset($_SESSION['id_session']) || $_SESSION['id_session'] == 0) && !empty($forum_category['session_name'])) { @@ -163,25 +170,61 @@ if ($action_forums != 'add') { $session_displayed = ''; } $forum_categories_list = ''; - echo '
'; - 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 .= '
'.$descriptionCategory.'
'; } - echo ''; + /* echo ''; echo ''; echo ''; @@ -190,7 +233,12 @@ if ($action_forums != 'add') { echo ''; echo ''; echo ''; + */ + + $html .= ''; + echo $html; + echo '
'; // The forums in this category. $forums_in_category = get_forums_in_category($forum_category['cat_id']); @@ -244,23 +292,29 @@ if ($action_forums != 'add') { $form_count = isset($form_count) ? $form_count : 0; if ($show_forum === true) { $form_count++; - echo '
'; - 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 ''; //$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 .= '
'; + $html .= '
'; + $html .= '
'; + $html .= '
'.$forum_image .'

' . $my_number_posts . ' ' . get_lang('Posts') . '

'; + $html .= '
'; + + $html .= '
'; + $iconForum = Display::return_icon('forum_yellow.png', + get_lang($forumCategory['cat_title']), + null, + ICON_SIZE_MEDIUM + ); + $linkForum = ''; + $linkForum .= Display::tag( + 'a', + $forum['forum_title'].$session_displayed, + array( + 'href' => 'viewforum.php?'.api_get_cidreq().'&gidReq='.$forum['forum_of_group'].'&forum='.$forum['forum_id'].'&origin='.$origin.'&search='.Security::remove_XSS(urlencode(isset($_GET['search']) ? $_GET['search'] : '')), + 'class' => status_visible_invisible($forum['visibility']) + ) + ); + $html .= Display::tag( + 'h3', + $linkForum . ' ' . $forum_title_group_addition, + array( + 'class' => 'title' + ) + ); + $html .= Display::tag( + 'p', + strip_tags($forum['forum_comment']), + array( + 'class' => 'description' + ) + ); + $html .= '
'; + $html .= '
'; + $html .= '
'; + + // The number of topics and posts. + if ($forum['forum_of_group'] !== '0') { + $iconEmpty=''; + $newPost=''; + if (is_array( + $my_whatsnew_post_info + ) && !empty($my_whatsnew_post_info) + ) { + $newPost = ' '.Display::return_icon( + 'alert.png', + get_lang('Forum'), + null, + ICON_SIZE_SMALL + ); + } else { + $newPost = $iconEmpty; + } + } else { + if (is_array( + $my_whatsnew_post_info + ) && !empty($my_whatsnew_post_info) + ) { + $newPost = ' '.Display::return_icon( + 'alert.png', + get_lang('Forum'), + null, + ICON_SIZE_SMALL + ); + } else { + $newPost = $iconEmpty; + } + } + + $html .= '
'; + $html .= '
'.Display::return_icon( + 'post-forum.png', + null, + null, + ICON_SIZE_SMALL + ) . ' ' . $my_number_threads . '
'.$newPost.'
'; - $my_number_posts = isset($forum['number_of_posts']) ? $forum['number_of_posts'] : ''; - echo '
'; - echo ''; // 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 ''; - echo ''; + $html .= ''; + $html .= ''; + + $html .= ''; + $html .= ''; + + $html .= ''; } + echo $html; } } if (count($forum_list) == 0) { - echo ''; + echo '
'.get_lang('NoForumInThisCategory').'
'; } - echo '
'; + $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 '
'; */ + // Step 3: The interim headers (for the forum). + /* echo '
'.get_lang('Forum').''.get_lang('ForumThreads').''.get_lang('Actions').'
'; + + $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 '
'.prepare4display($forum['forum_title']).$session_displayed.''.$forum_title_group_addition.'
'.prepare4display($forum['forum_comment']).'
'.$my_number_threads.''.$my_number_posts.''; + $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 '
'; + $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').'
'; + + echo '
'; } /* FOOTER */