|
@@ -3,7 +3,7 @@
|
|
==============================================================================
|
|
==============================================================================
|
|
Dokeos - elearning and course management software
|
|
Dokeos - elearning and course management software
|
|
|
|
|
|
- Copyright (c) 2006 Dokeos S.A.
|
|
|
|
|
|
+ Copyright (c) 2006 Dokeos SPRL
|
|
Copyright (c) 2006 Ghent University (UGent)
|
|
Copyright (c) 2006 Ghent University (UGent)
|
|
|
|
|
|
For a full list of contributors, see "credits.txt".
|
|
For a full list of contributors, see "credits.txt".
|
|
@@ -16,7 +16,7 @@
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
- Contact address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium
|
|
|
|
|
|
+ Contact address: Dokeos, 108, rue du Corbeau, B-1030 Brussels, Belgium
|
|
Mail: info@dokeos.com
|
|
Mail: info@dokeos.com
|
|
==============================================================================
|
|
==============================================================================
|
|
*/
|
|
*/
|
|
@@ -46,8 +46,12 @@
|
|
$language_file = 'forum';
|
|
$language_file = 'forum';
|
|
|
|
|
|
// including the global dokeos file
|
|
// including the global dokeos file
|
|
-require ('../inc/global.inc.php');
|
|
|
|
-
|
|
|
|
|
|
+require '../inc/global.inc.php';
|
|
|
|
+$htmlHeadXtra[] = '<script type="text/javascript" src="'.api_get_path(WEB_CODE_PATH).'inc/lib/javascript/jquery.js" ></script>';
|
|
|
|
+$htmlHeadXtra[] = '<script language="javascript">
|
|
|
|
+ $(document).ready(function(){ $(\'.hide-me\').slideUp() });
|
|
|
|
+ function hidecontent(content){ $(content).slideToggle(\'normal\'); }
|
|
|
|
+ </script>';
|
|
// the section (tabs)
|
|
// the section (tabs)
|
|
$this_section=SECTION_COURSES;
|
|
$this_section=SECTION_COURSES;
|
|
|
|
|
|
@@ -56,7 +60,7 @@ api_protect_course_script(true);
|
|
|
|
|
|
// including additional library scripts
|
|
// including additional library scripts
|
|
require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
|
|
require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
|
|
-include_once (api_get_path(LIBRARY_PATH).'groupmanager.lib.php');
|
|
|
|
|
|
+require_once (api_get_path(LIBRARY_PATH).'groupmanager.lib.php');
|
|
$nameTools=get_lang('Forum');
|
|
$nameTools=get_lang('Forum');
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -64,8 +68,8 @@ $nameTools=get_lang('Forum');
|
|
Including necessary files
|
|
Including necessary files
|
|
-----------------------------------------------------------
|
|
-----------------------------------------------------------
|
|
*/
|
|
*/
|
|
-include('forumconfig.inc.php');
|
|
|
|
-include('forumfunction.inc.php');
|
|
|
|
|
|
+require 'forumconfig.inc.php';
|
|
|
|
+require_once 'forumfunction.inc.php';
|
|
|
|
|
|
$fck_attribute['Width'] = '100%';
|
|
$fck_attribute['Width'] = '100%';
|
|
$fck_attribute['Height'] = '175';
|
|
$fck_attribute['Height'] = '175';
|
|
@@ -75,9 +79,10 @@ $fck_attribute['Config']['FlashUploadPath'] = 'upload/forum/';
|
|
$fck_attribute['Config']['InDocument'] = false;
|
|
$fck_attribute['Config']['InDocument'] = false;
|
|
$fck_attribute['Config']['CreateDocumentDir'] = '../../courses/'.api_get_course_path().'/document/';
|
|
$fck_attribute['Config']['CreateDocumentDir'] = '../../courses/'.api_get_course_path().'/document/';
|
|
|
|
|
|
-if(!api_is_allowed_to_edit(false,true)) $fck_attribute['Config']['UserStatus'] = 'student';
|
|
|
|
|
|
+if(!api_is_allowed_to_edit(false,true)) {
|
|
|
|
+ $fck_attribute['Config']['UserStatus'] = 'student';
|
|
|
|
+}
|
|
|
|
|
|
-//error_reporting(E_ALL);
|
|
|
|
/*
|
|
/*
|
|
==============================================================================
|
|
==============================================================================
|
|
MAIN DISPLAY SECTION
|
|
MAIN DISPLAY SECTION
|
|
@@ -92,10 +97,10 @@ $interbreadcrumb[]=array("url" => "index.php?search=".Security::remove_XSS($_GET
|
|
|
|
|
|
if ($_GET['action']=='add' ) {
|
|
if ($_GET['action']=='add' ) {
|
|
|
|
|
|
- switch ($_GET['content']){
|
|
|
|
|
|
+ switch ($_GET['content']) {
|
|
case 'forum': $interbreadcrumb[] = array ("url" => api_get_self().'?'.api_get_cidreq().'&action=add&content=forum', 'name' => get_lang('AddForum')); break;
|
|
case 'forum': $interbreadcrumb[] = array ("url" => api_get_self().'?'.api_get_cidreq().'&action=add&content=forum', 'name' => get_lang('AddForum')); break;
|
|
case 'forumcategory':$interbreadcrumb[] = array ("url" => api_get_self().'?'.api_get_cidreq().'&action=add&content=forumcategory', 'name' => get_lang('AddForumCategory'));break;
|
|
case 'forumcategory':$interbreadcrumb[] = array ("url" => api_get_self().'?'.api_get_cidreq().'&action=add&content=forumcategory', 'name' => get_lang('AddForumCategory'));break;
|
|
- default: break;
|
|
|
|
|
|
+ default: break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -112,21 +117,18 @@ Display::display_introduction_section(TOOL_FORUM);
|
|
ACTIONS
|
|
ACTIONS
|
|
------------------------------------------------------------------------------------------------------
|
|
------------------------------------------------------------------------------------------------------
|
|
*/
|
|
*/
|
|
-if (api_is_allowed_to_edit(false,true))
|
|
|
|
-{
|
|
|
|
|
|
+if (api_is_allowed_to_edit(false,true)) {
|
|
$fck_attribute['ToolbarSet'] = 'ForumLight';
|
|
$fck_attribute['ToolbarSet'] = 'ForumLight';
|
|
handle_forum_and_forumcategories();
|
|
handle_forum_and_forumcategories();
|
|
}
|
|
}
|
|
|
|
|
|
// notification
|
|
// notification
|
|
-if ($_GET['action'] == 'notify' AND isset($_GET['content']) AND isset($_GET['id']))
|
|
|
|
-{
|
|
|
|
|
|
+if ($_GET['action'] == 'notify' AND isset($_GET['content']) AND isset($_GET['id'])) {
|
|
$return_message = set_notification($_GET['content'],$_GET['id']);
|
|
$return_message = set_notification($_GET['content'],$_GET['id']);
|
|
Display :: display_confirmation_message($return_message,false);
|
|
Display :: display_confirmation_message($return_message,false);
|
|
}
|
|
}
|
|
|
|
|
|
-if ($_GET['action']!='add' && $_GET['action']!='edit' )
|
|
|
|
-{
|
|
|
|
|
|
+if ($_GET['action']!='add' && $_GET['action']!='edit' ) {
|
|
get_whats_new();
|
|
get_whats_new();
|
|
$whatsnew_post_info = array();
|
|
$whatsnew_post_info = array();
|
|
$whatsnew_post_info = $_SESSION['whatsnew_post_info'];
|
|
$whatsnew_post_info = $_SESSION['whatsnew_post_info'];
|
|
@@ -166,10 +168,8 @@ if ($_GET['action']!='add' && $_GET['action']!='edit' )
|
|
$groups_of_user=GroupManager::get_group_ids($_course['dbName'], $_user['user_id']);
|
|
$groups_of_user=GroupManager::get_group_ids($_course['dbName'], $_user['user_id']);
|
|
// all groups in the course (and sorting them as the id of the group = the key of the array
|
|
// all groups in the course (and sorting them as the id of the group = the key of the array
|
|
$all_groups=GroupManager::get_group_list();
|
|
$all_groups=GroupManager::get_group_list();
|
|
- if(is_array($all_groups))
|
|
|
|
- {
|
|
|
|
- foreach ($all_groups as $group)
|
|
|
|
- {
|
|
|
|
|
|
+ if(is_array($all_groups)) {
|
|
|
|
+ foreach ($all_groups as $group) {
|
|
$all_groups[$group['id']]=$group;
|
|
$all_groups[$group['id']]=$group;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -181,11 +181,9 @@ if ($_GET['action']!='add' && $_GET['action']!='edit' )
|
|
*/
|
|
*/
|
|
//if (api_is_allowed_to_edit() and !$_GET['action'])
|
|
//if (api_is_allowed_to_edit() and !$_GET['action'])
|
|
echo '<span style="float:right;">'.search_link().'</span>';
|
|
echo '<span style="float:right;">'.search_link().'</span>';
|
|
- if (api_is_allowed_to_edit(false,true))
|
|
|
|
- {
|
|
|
|
|
|
+ if (api_is_allowed_to_edit(false,true)) {
|
|
echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=add&content=forumcategory"> '.Display::return_icon('forum_category_new.gif').' '.get_lang('AddForumCategory').'</a> ';
|
|
echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=add&content=forumcategory"> '.Display::return_icon('forum_category_new.gif').' '.get_lang('AddForumCategory').'</a> ';
|
|
- if (is_array($forum_categories_list))
|
|
|
|
- {
|
|
|
|
|
|
+ if (is_array($forum_categories_list)) {
|
|
echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=add&content=forum"> '.Display::return_icon('forum_new.gif').' '.get_lang('AddForum').'</a>';
|
|
echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=add&content=forum"> '.Display::return_icon('forum_new.gif').' '.get_lang('AddForum').'</a>';
|
|
}
|
|
}
|
|
//echo ' | <a href="forum_migration.php">'.get_lang('MigrateForum').'</a>';
|
|
//echo ' | <a href="forum_migration.php">'.get_lang('MigrateForum').'</a>';
|
|
@@ -198,30 +196,24 @@ if ($_GET['action']!='add' && $_GET['action']!='edit' )
|
|
*/
|
|
*/
|
|
echo '<table class="data_table" width="100%">'."\n";
|
|
echo '<table class="data_table" width="100%">'."\n";
|
|
// Step 3: we display the forum_categories first
|
|
// Step 3: we display the forum_categories first
|
|
- if(is_array($forum_categories_list))
|
|
|
|
- {
|
|
|
|
- foreach ($forum_categories_list as $forum_category_key => $forum_category)
|
|
|
|
- {
|
|
|
|
- if((!isset($_SESSION['id_session']) || $_SESSION['id_session']==0) && !empty($forum_category['session_name']))
|
|
|
|
- {
|
|
|
|
|
|
+ if(is_array($forum_categories_list)) {
|
|
|
|
+ foreach ($forum_categories_list as $forum_category_key => $forum_category) {
|
|
|
|
+ if((!isset($_SESSION['id_session']) || $_SESSION['id_session']==0) && !empty($forum_category['session_name'])) {
|
|
$session_displayed = ' ('.$forum_category['session_name'].')';
|
|
$session_displayed = ' ('.$forum_category['session_name'].')';
|
|
- }
|
|
|
|
- else
|
|
|
|
|
|
+ } else {
|
|
$session_displayed = '';
|
|
$session_displayed = '';
|
|
|
|
+ }
|
|
|
|
|
|
echo "\t<tr>\n\t\t<th style=\"padding-left:5px;\" align=\"left\" colspan=\"6\">";
|
|
echo "\t<tr>\n\t\t<th style=\"padding-left:5px;\" align=\"left\" colspan=\"6\">";
|
|
echo '<a href="viewforumcategory.php?'.api_get_cidreq().'&forumcategory='.prepare4display($forum_category['cat_id']).'" '.class_visible_invisible(prepare4display($forum_category['visibility'])).'>'.prepare4display($forum_category['cat_title']).$session_displayed.'</a><br />';
|
|
echo '<a href="viewforumcategory.php?'.api_get_cidreq().'&forumcategory='.prepare4display($forum_category['cat_id']).'" '.class_visible_invisible(prepare4display($forum_category['visibility'])).'>'.prepare4display($forum_category['cat_title']).$session_displayed.'</a><br />';
|
|
|
|
|
|
- if ($forum_category['cat_comment']<>'' AND trim($forum_category['cat_comment'])<>' ')
|
|
|
|
- {
|
|
|
|
|
|
+ if ($forum_category['cat_comment']<>'' AND trim($forum_category['cat_comment'])<>' ') {
|
|
echo '<span class="forum_description">'.prepare4display($forum_category['cat_comment']).'</span>';
|
|
echo '<span class="forum_description">'.prepare4display($forum_category['cat_comment']).'</span>';
|
|
}
|
|
}
|
|
echo "</th>\n";
|
|
echo "</th>\n";
|
|
|
|
|
|
echo '<th style="padding: 5px; vertical-align: top;" align="center" >';
|
|
echo '<th style="padding: 5px; vertical-align: top;" align="center" >';
|
|
- 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_session'])!=0)) {
|
|
echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&action=edit&content=forumcategory&id=".prepare4display($forum_category['cat_id'])."\">".icon('../img/edit.gif',get_lang('Edit'))."</a>";
|
|
echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&action=edit&content=forumcategory&id=".prepare4display($forum_category['cat_id'])."\">".icon('../img/edit.gif',get_lang('Edit'))."</a>";
|
|
echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&action=delete&content=forumcategory&id=".prepare4display($forum_category['cat_id'])."\" onclick=\"javascript:if(!confirm('".addslashes(htmlentities(get_lang("DeleteForumCategory"),ENT_QUOTES,$charset))."')) return false;\">".icon('../img/delete.gif',get_lang('Delete'))."</a>";
|
|
echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&action=delete&content=forumcategory&id=".prepare4display($forum_category['cat_id'])."\" onclick=\"javascript:if(!confirm('".addslashes(htmlentities(get_lang("DeleteForumCategory"),ENT_QUOTES,$charset))."')) return false;\">".icon('../img/delete.gif',get_lang('Delete'))."</a>";
|
|
display_visible_invisible_icon('forumcategory', prepare4display($forum_category['cat_id']), prepare4display($forum_category['visibility']));
|
|
display_visible_invisible_icon('forumcategory', prepare4display($forum_category['cat_id']), prepare4display($forum_category['visibility']));
|
|
@@ -233,12 +225,11 @@ if ($_GET['action']!='add' && $_GET['action']!='edit' )
|
|
|
|
|
|
// step 4: the interim headers (for the forum)
|
|
// step 4: the interim headers (for the forum)
|
|
echo "\t<tr class=\"forum_header\">\n";
|
|
echo "\t<tr class=\"forum_header\">\n";
|
|
-
|
|
|
|
- echo "\t\t<td colspan='3'>".get_lang('Forum')."</td>\n";
|
|
|
|
|
|
+ echo "\t\t<td colspan=\"3\">".get_lang('Forum')."</td>\n";
|
|
echo "\t\t<td>".get_lang('Topics')."</td>\n";
|
|
echo "\t\t<td>".get_lang('Topics')."</td>\n";
|
|
echo "\t\t<td>".get_lang('Posts')."</td>\n";
|
|
echo "\t\t<td>".get_lang('Posts')."</td>\n";
|
|
echo "\t\t<td>".get_lang('LastPosts')."</td>\n";
|
|
echo "\t\t<td>".get_lang('LastPosts')."</td>\n";
|
|
- echo "\t\t<td>".get_lang('Actions')."</td>\n";
|
|
|
|
|
|
+ echo "\t\t<td>".get_lang('Actions')."</td>\n";
|
|
echo "\t</tr>\n";
|
|
echo "\t</tr>\n";
|
|
|
|
|
|
// the forums in this category
|
|
// the forums in this category
|
|
@@ -247,16 +238,12 @@ if ($_GET['action']!='add' && $_GET['action']!='edit' )
|
|
// step 5: we display all the forums in this category.
|
|
// step 5: we display all the forums in this category.
|
|
$forum_count=0;
|
|
$forum_count=0;
|
|
|
|
|
|
- foreach ($forum_list as $key=>$forum)
|
|
|
|
- {
|
|
|
|
|
|
+ foreach ($forum_list as $key=>$forum) {
|
|
// Here we clean the whatnew_post_info array a little bit because to display the icon we
|
|
// 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.
|
|
// 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]))
|
|
|
|
- {
|
|
|
|
|
|
+ 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($whatsnew_post_info[$forum['forum_id']][$key_thread_id]);
|
|
unset($_SESSION['whatsnew_post_info'][$forum['forum_id']][$key_thread_id]);
|
|
unset($_SESSION['whatsnew_post_info'][$forum['forum_id']][$key_thread_id]);
|
|
}
|
|
}
|
|
@@ -264,8 +251,7 @@ if ($_GET['action']!='add' && $_GET['action']!='edit' )
|
|
}
|
|
}
|
|
|
|
|
|
// note: this can be speeded up if we transform the $forum_list to an array that uses the forum_category as the key.
|
|
// 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']))
|
|
|
|
- {
|
|
|
|
|
|
+ if (prepare4display($forum['forum_category'])==prepare4display($forum_category['cat_id'])) {
|
|
// the forum has to be showed if
|
|
// the forum has to be showed if
|
|
// 1.v it is a not a group forum (teacher and student)
|
|
// 1.v it is a not a group forum (teacher and student)
|
|
// 2.v it is a group forum and it is public (teacher and student)
|
|
// 2.v it is a group forum and it is public (teacher and student)
|
|
@@ -278,43 +264,30 @@ if ($_GET['action']!='add' && $_GET['action']!='edit' )
|
|
// SHOULD WE SHOW THIS PARTICULAR FORUM
|
|
// SHOULD WE SHOW THIS PARTICULAR FORUM
|
|
// you are teacher => show forum
|
|
// you are teacher => show forum
|
|
|
|
|
|
- if (api_is_allowed_to_edit(false,true))
|
|
|
|
- {
|
|
|
|
|
|
+ if (api_is_allowed_to_edit(false,true)) {
|
|
//echo 'teacher';
|
|
//echo 'teacher';
|
|
$show_forum=true;
|
|
$show_forum=true;
|
|
- }
|
|
|
|
- // you are not a teacher
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
|
|
+ } else {// you are not a teacher
|
|
//echo 'student';
|
|
//echo 'student';
|
|
// it is not a group forum => show forum (invisible forums are already left out see get_forums function)
|
|
// it is not a group forum => show forum (invisible forums are already left out see get_forums function)
|
|
- if ($forum['forum_of_group']=='0')
|
|
|
|
- {
|
|
|
|
|
|
+ if ($forum['forum_of_group']=='0') {
|
|
//echo '-gewoon forum';
|
|
//echo '-gewoon forum';
|
|
$show_forum=true;
|
|
$show_forum=true;
|
|
- }
|
|
|
|
- // it is a group forum
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
|
|
+ } else {
|
|
|
|
+ // it is a group forum
|
|
//echo '-groepsforum';
|
|
//echo '-groepsforum';
|
|
// it is a group forum but it is public => show
|
|
// it is a group forum but it is public => show
|
|
- if ($forum['forum_group_public_private']=='public')
|
|
|
|
- {
|
|
|
|
|
|
+ if ($forum['forum_group_public_private']=='public') {
|
|
$show_forum=true;
|
|
$show_forum=true;
|
|
//echo '-publiek';
|
|
//echo '-publiek';
|
|
- }
|
|
|
|
- // it is a group forum and it is private
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
|
|
+ } else {
|
|
|
|
+ // it is a group forum and it is private
|
|
//echo '-prive';
|
|
//echo '-prive';
|
|
// it is a group forum and it is private but the user is member of the group
|
|
// it is a group forum and it is private but the user is member of the group
|
|
- if (in_array($forum['forum_of_group'],$groups_of_user))
|
|
|
|
- {
|
|
|
|
|
|
+ if (in_array($forum['forum_of_group'],$groups_of_user)) {
|
|
//echo '-is lid';
|
|
//echo '-is lid';
|
|
$show_forum=true;
|
|
$show_forum=true;
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
|
|
+ } else {
|
|
//echo '-is GEEN lid';
|
|
//echo '-is GEEN lid';
|
|
$show_forum=false;
|
|
$show_forum=false;
|
|
}
|
|
}
|
|
@@ -326,11 +299,7 @@ if ($_GET['action']!='add' && $_GET['action']!='edit' )
|
|
|
|
|
|
//echo '<hr>';
|
|
//echo '<hr>';
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- if ($show_forum)
|
|
|
|
- {
|
|
|
|
|
|
+ if ($show_forum) {
|
|
$form_count++;
|
|
$form_count++;
|
|
echo "\t<tr class=\"forum\">\n";
|
|
echo "\t<tr class=\"forum\">\n";
|
|
|
|
|
|
@@ -341,92 +310,64 @@ if ($_GET['action']!='add' && $_GET['action']!='edit' )
|
|
|
|
|
|
|
|
|
|
echo "\t\t<td width=\"20\">";
|
|
echo "\t\t<td width=\"20\">";
|
|
-
|
|
|
|
-
|
|
|
|
- if ($forum['forum_of_group']!=='0')
|
|
|
|
- {
|
|
|
|
- if (is_array($whatsnew_post_info[$forum['forum_id']]) and !empty($whatsnew_post_info[$forum['forum_id']]))
|
|
|
|
- {
|
|
|
|
|
|
+ if ($forum['forum_of_group']!=='0') {
|
|
|
|
+ if (is_array($whatsnew_post_info[$forum['forum_id']]) and !empty($whatsnew_post_info[$forum['forum_id']])) {
|
|
echo icon('../img/forumgroupnew.gif');
|
|
echo icon('../img/forumgroupnew.gif');
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
|
|
+ } else {
|
|
echo icon('../img/forumgroup.gif');
|
|
echo icon('../img/forumgroup.gif');
|
|
}
|
|
}
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
-
|
|
|
|
- if (is_array($whatsnew_post_info[$forum['forum_id']]) and !empty($whatsnew_post_info[$forum['forum_id']]))
|
|
|
|
- {
|
|
|
|
|
|
+ } else {
|
|
|
|
+ if (is_array($whatsnew_post_info[$forum['forum_id']]) and !empty($whatsnew_post_info[$forum['forum_id']])) {
|
|
echo icon('../img/forum.gif');
|
|
echo icon('../img/forum.gif');
|
|
-
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
|
|
+ } else {
|
|
echo icon('../img/forum.gif');
|
|
echo icon('../img/forum.gif');
|
|
-
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
echo "</td>\n";
|
|
echo "</td>\n";
|
|
- if ($forum['forum_of_group']<>'0')
|
|
|
|
- {
|
|
|
|
|
|
+ if ($forum['forum_of_group']<>'0') {
|
|
$group_title=substr($all_groups[$forum['forum_of_group']]['name'],0,30);
|
|
$group_title=substr($all_groups[$forum['forum_of_group']]['name'],0,30);
|
|
$forum_title_group_addition=' (<a href="../group/group_space.php?'.api_get_cidreq().'&gidReq='.$all_groups[$forum['forum_of_group']]['id'].'" class="forum_group_link">'.$group_title.'</a>)';
|
|
$forum_title_group_addition=' (<a href="../group/group_space.php?'.api_get_cidreq().'&gidReq='.$all_groups[$forum['forum_of_group']]['id'].'" class="forum_group_link">'.$group_title.'</a>)';
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
|
|
+ } else {
|
|
$forum_title_group_addition='';
|
|
$forum_title_group_addition='';
|
|
}
|
|
}
|
|
|
|
|
|
- if((!isset($_SESSION['id_session']) || $_SESSION['id_session']==0) && !empty($forum['session_name']))
|
|
|
|
- {
|
|
|
|
|
|
+ if((!isset($_SESSION['id_session']) || $_SESSION['id_session']==0) && !empty($forum['session_name'])) {
|
|
$session_displayed = ' ('.$forum['session_name'].')';
|
|
$session_displayed = ' ('.$forum['session_name'].')';
|
|
- }
|
|
|
|
- else
|
|
|
|
|
|
+ } else {
|
|
$session_displayed = '';
|
|
$session_displayed = '';
|
|
-
|
|
|
|
|
|
+ }
|
|
echo "\t\t<td><a href=\"viewforum.php?".api_get_cidreq()."&forum=".prepare4display($forum['forum_id'])."\" ".class_visible_invisible(prepare4display($forum['visibility'])).">".prepare4display($forum['forum_title']).$session_displayed.'</a>'.$forum_title_group_addition.'<br />'.prepare4display($forum['forum_comment'])."</td>\n";
|
|
echo "\t\t<td><a href=\"viewforum.php?".api_get_cidreq()."&forum=".prepare4display($forum['forum_id'])."\" ".class_visible_invisible(prepare4display($forum['visibility'])).">".prepare4display($forum['forum_title']).$session_displayed.'</a>'.$forum_title_group_addition.'<br />'.prepare4display($forum['forum_comment'])."</td>\n";
|
|
//$number_forum_topics_and_posts=get_post_topics_of_forum($forum['forum_id']); // deprecated
|
|
//$number_forum_topics_and_posts=get_post_topics_of_forum($forum['forum_id']); // deprecated
|
|
// the number of topics and posts
|
|
// the number of topics and posts
|
|
echo "\t\t<td>".$forum['number_of_threads']."</td>\n";
|
|
echo "\t\t<td>".$forum['number_of_threads']."</td>\n";
|
|
echo "\t\t<td>".$forum['number_of_posts']."</td>\n";
|
|
echo "\t\t<td>".$forum['number_of_posts']."</td>\n";
|
|
// the last post in the forum
|
|
// the last post in the forum
|
|
- if ($forum['last_poster_name']<>'')
|
|
|
|
- {
|
|
|
|
|
|
+ if ($forum['last_poster_name']<>'') {
|
|
$name=$forum['last_poster_name'];
|
|
$name=$forum['last_poster_name'];
|
|
$poster_id=0;
|
|
$poster_id=0;
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
|
|
+ } else {
|
|
$name=$forum['last_poster_firstname'].' '.$forum['last_poster_lastname'];
|
|
$name=$forum['last_poster_firstname'].' '.$forum['last_poster_lastname'];
|
|
$poster_id=$forum['last_poster_id'];
|
|
$poster_id=$forum['last_poster_id'];
|
|
}
|
|
}
|
|
echo "\t\t<td NOWRAP>";
|
|
echo "\t\t<td NOWRAP>";
|
|
|
|
|
|
- if (!empty($forum['last_post_id']))
|
|
|
|
- {
|
|
|
|
|
|
+ if (!empty($forum['last_post_id'])) {
|
|
echo $forum['last_post_date']."<br /> ".get_lang('By').' '.display_user_link($poster_id, $name);
|
|
echo $forum['last_post_date']."<br /> ".get_lang('By').' '.display_user_link($poster_id, $name);
|
|
}
|
|
}
|
|
echo "</td>\n";
|
|
echo "</td>\n";
|
|
|
|
|
|
|
|
|
|
echo "\t\t<td NOWRAP align='center'>";
|
|
echo "\t\t<td NOWRAP align='center'>";
|
|
- 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_session'])!=0)) {
|
|
echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&action=edit&content=forum&id=".$forum['forum_id']."\">".icon('../img/edit.gif',get_lang('Edit'))."</a>";
|
|
echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&action=edit&content=forum&id=".$forum['forum_id']."\">".icon('../img/edit.gif',get_lang('Edit'))."</a>";
|
|
echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&action=delete&content=forum&id=".$forum['forum_id']."\" onclick=\"javascript:if(!confirm('".addslashes(htmlentities(get_lang("DeleteForum"),ENT_QUOTES,$charset))."')) return false;\">".icon('../img/delete.gif',get_lang('Delete'))."</a>";
|
|
echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&action=delete&content=forum&id=".$forum['forum_id']."\" onclick=\"javascript:if(!confirm('".addslashes(htmlentities(get_lang("DeleteForum"),ENT_QUOTES,$charset))."')) return false;\">".icon('../img/delete.gif',get_lang('Delete'))."</a>";
|
|
display_visible_invisible_icon('forum',$forum['forum_id'], $forum['visibility']);
|
|
display_visible_invisible_icon('forum',$forum['forum_id'], $forum['visibility']);
|
|
display_lock_unlock_icon('forum',$forum['forum_id'], $forum['locked']);
|
|
display_lock_unlock_icon('forum',$forum['forum_id'], $forum['locked']);
|
|
display_up_down_icon('forum',$forum['forum_id'], $forums_in_category);
|
|
display_up_down_icon('forum',$forum['forum_id'], $forums_in_category);
|
|
-
|
|
|
|
}
|
|
}
|
|
$iconnotify = 'send_mail.gif';
|
|
$iconnotify = 'send_mail.gif';
|
|
- if (is_array($_SESSION['forum_notification']['forum']))
|
|
|
|
- {
|
|
|
|
- if (in_array($forum['forum_id'],$_SESSION['forum_notification']['forum']))
|
|
|
|
- {
|
|
|
|
|
|
+ if (is_array($_SESSION['forum_notification']['forum'])) {
|
|
|
|
+ if (in_array($forum['forum_id'],$_SESSION['forum_notification']['forum'])) {
|
|
$iconnotify = 'send_mail_checked.gif';
|
|
$iconnotify = 'send_mail_checked.gif';
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -437,8 +378,7 @@ if ($_GET['action']!='add' && $_GET['action']!='edit' )
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- if (count($forum_list)==0)
|
|
|
|
- {
|
|
|
|
|
|
+ if (count($forum_list)==0) {
|
|
echo "\t<tr><td>".get_lang('NoForumInThisCategory')."</td>".(api_is_allowed_to_edit(false,true)?'<td colspan="5"></td>':'<td colspan="4"></td>')."</tr>\n";
|
|
echo "\t<tr><td>".get_lang('NoForumInThisCategory')."</td>".(api_is_allowed_to_edit(false,true)?'<td colspan="5"></td>':'<td colspan="4"></td>')."</tr>\n";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -450,9 +390,4 @@ if ($_GET['action']!='add' && $_GET['action']!='edit' )
|
|
FOOTER
|
|
FOOTER
|
|
==============================================================================
|
|
==============================================================================
|
|
*/
|
|
*/
|
|
-
|
|
|
|
-Display :: display_footer();
|
|
|
|
-?>
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+Display :: display_footer();
|