Source for file iframe_thread.php
Documentation is available at iframe_thread.php
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2006 Dokeos S.A.
Copyright (c) 2006 Ghent University (UGent)
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium
==============================================================================
* These files are a complete rework of the forum. The database structure is
* based on phpBB but all the code is rewritten. A lot of new functionalities
* - forum categories and forums can be sorted up or down, locked or made invisible
* - consistent and integrated forum administration
* - forum options: are students allowed to edit their post?
* moderation of posts (approval)
* reply only forums (students cannot create new threads)
* multiple forums per group
* - new view option: nested view
* @Author Patrick Cool <patrick.cool@UGent.be>, Ghent University
* @Copyright Ghent University
* @Copyright Patrick Cool
*************************************************************************
* Please do not change anything is this code yet because there are still
* some significant code that need to happen and I do not have the time to
* merge files and test it all over again. So for the moment, please do not
* -- Patrick Cool <patrick.cool@UGent.be>
*************************************************************************
==============================================================================
==============================================================================
include('../inc/global.inc.php');
/* ------------ ACCESS RIGHTS ------------ */
// notice for unauthorized people.
-----------------------------------------------------------
-----------------------------------------------------------
// name of the language file that needs to be included
$language_file = 'forum';
require ('../inc/global.inc.php');
require_once (api_get_path(LIBRARY_PATH). 'formvalidator/FormValidator.class.php');
include_once (api_get_path(LIBRARY_PATH). 'groupmanager.lib.php');
$fck_attribute['Width'] = '100%';
$fck_attribute['Height'] = '400';
$fck_attribute['ToolbarSet'] = 'Middle';
$fck_attribute['Config']['IMUploadPath'] = 'upload/forum/';
$fck_attribute['Config']['FlashUploadPath'] = 'upload/forum/';
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<style type="text/css" media="screen, projection">
-----------------------------------------------------------
Including necessary files
-----------------------------------------------------------
include('forumconfig.inc.php');
include('forumfunction.inc.php');
==============================================================================
==============================================================================
-----------------------------------------------------------
Retrieving forum and forum categorie information
-----------------------------------------------------------
// we are getting all the information about the current forum and forum category.
// note pcool: I tried to use only one sql statement (and function) for this
// but the problem is that the visibility of the forum AND forum cateogory are stored in the item_property table
$current_thread= get_thread_information($_GET['thread']); // note: this has to be validated that it is an existing thread
$current_forum= get_forum_information($current_thread['forum_id']); // note: this has to be validated that it is an existing forum.
-----------------------------------------------------------
Is the user allowed here?
-----------------------------------------------------------
// if the user is not a course administrator and the forum is hidden
// then the user is not allowed here.
-----------------------------------------------------------
Display Forum Category and the Forum information
-----------------------------------------------------------
// we are getting all the information about the current forum and forum category.
// note pcool: I tried to use only one sql statement (and function) for this
// but the problem is that the visibility of the forum AND forum cateogory are stored in the item_property table
echo "<table width='100%'>\n";
echo "\t<tr class=\"forum_category\">\n\t\t<td colspan=\"6\">";
echo '<a href="index.php" '.class_visible_invisible($current_forum_category['visibility']).'>'.$current_forum_category['cat_title'].'</a><br />';
echo '<span>'.$current_forum_category['cat_comment'].'</span>';
echo "\t<tr class=\"forum_header\">\n";
echo "\t\t<td colspan=\"6\"><a href=\"viewforum.php?forum=".$current_forum['forum_id']."\" ".class_visible_invisible($current_forum['visibility']).">".$current_forum['forum_title']."</a><br />";
echo '<span>'.$current_forum['forum_comment'].'</span>';
$sql= "SELECT * FROM $table_posts posts, $table_users users
WHERE posts.thread_id='". $current_thread['thread_id']. "'
AND posts.poster_id=users.user_id
ORDER BY posts.post_id ASC";
echo "<table width=\"100%\" cellspacing=\"5\" border=\"0\">\n";
echo "\t\t<td rowspan=\"2\" class=\"forum_message_left\">";
if ($row['user_id']== '0')
$name= $row['poster_name'];
$name= $row['firstname']. ' '. $row['lastname'];
echo $row['post_date']. '<br /><br />';
echo "\t\t<td class=\"forum_message_post_title\">". $row['post_title']. "</td>\n";
echo "\t\t<td class=\"forum_message_post_text\">". $row['post_text']. "</td>\n";
|