<?php
/****************************************************************************************/
/* ACollab */
/****************************************************************************************/
/* Copyright (c) 2002-2004 Adaptive Technology Resource Centre / University of Toronto */
/* */
/* http://atutor.ca/acollab */
/* */
/* This program is free software. You may 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. */
/* */
/* This program is distributed in the hope that it will be useful, but */
/* WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */
/* See the GNU General Public License for more details. */
/* */
/* You may access the GNU General Public License at: */
/* http://www.opensource.org/licenses/gpl-license.php */
/* */
/* You may contact the Adaptive Technology Resource Centre at */
/* Robarts Library, University of Toronto */
/* 130 St. George Street, Toronto, Ontario, Canada M5S 1A5 */
/* Further contact information is available at http://www.utoronto.ca/atrc/ */
/****************************************************************************************/
/* Programmer: */
/* Joel Kronenberg - ATRC */
/****************************************************************************************/
// $Id: index.php 421 2005-03-04 21:19:31Z shozubq $
define('AC_INCLUDE_PATH', '../include/');
require(AC_INCLUDE_PATH.'vitals.inc.php');
authenticate(USER_CLIENT, USER_GROUP_ADMIN, USER_ADMIN);
$_SECTION[0][0] = _AC('home');
$_SECTION[0][1] = 'home.php';
$_SECTION[1][0] = _AC('forums');
$_SECTION[1][1] = 'forums/';
require(AC_INCLUDE_PATH.'header.inc.php');
if (isset($_GET['f'])) {
print_feedback(intval($_GET['f']));
}
$sql = "SELECT * FROM ".TABLE_PREFIX."forums WHERE group_id=$_SESSION[group_id] ORDER BY title";
$result = mysql_query($sql, $db);
if ($row = mysql_fetch_array($result)) {
if (authenticate(USER_GROUP_ADMIN, USER_RETURN_CHECK)) {
print_popup_help('help_forums');
}
echo '<br /><table cellspacing="0" cellpadding="2" border="0" bgcolor="white" width="99%" align="center" summary="" class="box2">';
echo '<tr>';
echo '<th scope="col" class="box" align="left"><small>'._AC('forum').'</small> ';
echo '</th>';
echo '<th scope="col" class="box" align="left"><small>'._AC('topics').'</small></th>';
echo '<th scope="col" class="box" align="left"><small>'._AC('posts').'</small></th>';
echo '<th scope="col" class="box" align="right"><small>'._AC('last_post').'</small></th>';
echo '</tr>';
$counter = 0;
do {
$counter++;
$col = (($counter-1)%2);
echo '<tr>';
echo '<td class="row'.$col.'"><small><a href="forums/forum.php?fid='.$row['forum_id'].'" onfocus="this.className=\'highlight\'" onblur="this.className=\'\'"><b>'.$row['title'].'</b></a></small>';
$sql = "SELECT 1 AS constant FROM ".TABLE_PREFIX."forums_subscriptions WHERE forum_id=$row[forum_id] AND member_id=$_SESSION[member_id]";
$result1 = mysql_query($sql, $db);
echo ' <small>[ ';
if ($row1 = mysql_fetch_row($result1)) {
echo '<a href="forums/forum_subscribe.php?fid='.$row['forum_id'].SEP.'us=1">'._AC('unsubscribe').'</a>';
} else {
echo '<a href="forums/forum_subscribe.php?fid='.$row['forum_id'].'">'._AC('subscribe').'</a>';
}
echo ' ]</small>';
echo '<p><small>'.$row['description'].'</small></p></td>';
echo '<td class="row'.$col.'" align="center"><small>'.$row['num_topics'].'</small></td>';
echo '<td class="row'.$col.'" align="center"><small>'.$row['num_posts'].'</small></td>';
echo '<td class="row'.$col.'" align="right"><small>';
if ($row['last_post'] == '0000-00-00 00:00:00') {
echo ' ';
} else {
echo AT_date(_AC('forum_date_format'), $row['last_post'], AT_DATE_MYSQL_DATETIME);
}
echo '</small></td>';
echo '</tr>';
} while ($row = mysql_fetch_array($result));
echo '</table>';
} else {
echo '<p><i>'._AC('no_forums').'</i></p>';
}
require(AC_INCLUDE_PATH.'footer.inc.php');
?>