';
- if (api_is_allowed_to_edit(false,true) && !($forum_category['session_id']==0 && intval($_SESSION['id_session'])!=0)) {
+ if (api_is_allowed_to_edit(false,true) && !($forum_category['session_id']==0 && intval($session_id)!=0)) {
echo "".icon('../img/edit.gif',get_lang('Edit'))."";
echo "".icon('../img/delete.gif',get_lang('Delete'))."";
display_visible_invisible_icon('forumcategory', prepare4display($forum_category['cat_id']), prepare4display($forum_category['visibility']));
@@ -248,15 +250,17 @@ if ($_GET['action']!='add' && $_GET['action']!='edit' ) {
foreach ($forum_list as $key=>$forum) {
// Here we clean the whatnew_post_info array a little bit because to display the icon we
// test if $whatsnew_post_info[$forum['forum_id']] is empty or not.
- if(is_array($whatsnew_post_info[$forum['forum_id']])) {
- foreach ($whatsnew_post_info[$forum['forum_id']] as $key_thread_id => $new_post_array) {
- if (empty($whatsnew_post_info[$forum['forum_id']][$key_thread_id])) {
- unset($whatsnew_post_info[$forum['forum_id']][$key_thread_id]);
- unset($_SESSION['whatsnew_post_info'][$forum['forum_id']][$key_thread_id]);
+ if (!empty($whatsnew_post_info)) {
+ if (is_array($whatsnew_post_info[$forum['forum_id']])) {
+ foreach ($whatsnew_post_info[$forum['forum_id']] as $key_thread_id => $new_post_array) {
+ if (empty($whatsnew_post_info[$forum['forum_id']][$key_thread_id])) {
+ unset($whatsnew_post_info[$forum['forum_id']][$key_thread_id]);
+ unset($_SESSION['whatsnew_post_info'][$forum['forum_id']][$key_thread_id]);
+ }
}
- }
+ }
}
-
+
// note: this can be speeded up if we transform the $forum_list to an array that uses the forum_category as the key.
if (prepare4display($forum['forum_category'])==prepare4display($forum_category['cat_id'])) {
// the forum has to be showed if
@@ -326,10 +330,12 @@ if ($_GET['action']!='add' && $_GET['action']!='edit' ) {
echo icon('../img/forumgroup.gif', get_lang('GroupForum'));
}
} else {
- if (is_array($whatsnew_post_info[$forum['forum_id']]) and !empty($whatsnew_post_info[$forum['forum_id']])) {
- echo icon('../img/forum.gif', get_lang('Forum'));
- } else {
- echo icon('../img/forum.gif');
+ if (!empty($whatsnew_post_info)) {
+ if (is_array($whatsnew_post_info[$forum['forum_id']]) and !empty($whatsnew_post_info[$forum['forum_id']])) {
+ echo icon('../img/forum.gif', get_lang('Forum'));
+ } else {
+ echo icon('../img/forum.gif');
+ }
}
}
echo "\n";
@@ -348,8 +354,10 @@ if ($_GET['action']!='add' && $_GET['action']!='edit' ) {
echo "\t\t
\n";
// the last post in the forum
if ($forum['last_poster_name']<>'') {
$name=$forum['last_poster_name'];
@@ -364,10 +372,8 @@ if ($_GET['action']!='add' && $_GET['action']!='edit' ) {
echo $forum['last_post_date']." ".get_lang('By').' '.display_user_link($poster_id, $name);
}
echo "\n";
-
-
echo "\t\t
";
- if (api_is_allowed_to_edit(false,true) && !($forum['session_id']==0 && intval($_SESSION['id_session'])!=0)) {
+ if (api_is_allowed_to_edit(false,true) && !($forum['session_id']==0 && intval($session_id)!=0)) {
echo "".icon('../img/edit.gif',get_lang('Edit'))."";
echo "".icon('../img/delete.gif',get_lang('Delete'))."";
display_visible_invisible_icon('forum',$forum['forum_id'], $forum['visibility']);
@@ -375,8 +381,9 @@ if ($_GET['action']!='add' && $_GET['action']!='edit' ) {
display_up_down_icon('forum',$forum['forum_id'], $forums_in_category);
}
$iconnotify = 'send_mail.gif';
- if (is_array($_SESSION['forum_notification']['forum'])) {
- if (in_array($forum['forum_id'],$_SESSION['forum_notification']['forum'])) {
+ $session_forum_noti=isset($_SESSION['forum_notification']['forum']) ? $_SESSION['forum_notification']['forum'] : false;
+ if (is_array($session_forum_noti)) {
+ if (in_array($forum['forum_id'],$session_forum_noti)) {
$iconnotify = 'send_mail_checked.gif';
}
}