2 /****************************************************************/
4 /****************************************************************/
5 /* Copyright (c) 2002-2010 */
6 /* Inclusive Design Institute */
9 /* This program is free software. You can redistribute it and/or*/
10 /* modify it under the terms of the GNU General Public License */
11 /* as published by the Free Software Foundation. */
12 /****************************************************************/
14 define('AT_INCLUDE_PATH', '../../../../include/');
16 require (AT_INCLUDE_PATH.'vitals.inc.php');
18 require(AT_INCLUDE_PATH.'../mods/_standard/forums/lib/forums.inc.php');
19 require (AT_INCLUDE_PATH.'header.inc.php');
21 <table class="data static" summary="" rules="rows">
24 <th scope="col"><?php echo _AT('forum'); ?></th>
25 <th scope="col"><?php echo _AT('num_threads'); ?></th>
26 <th scope="col"><?php echo _AT('num_posts'); ?></th>
27 <th scope="col"><?php echo _AT('last_post'); ?></th>
33 $all_forums = get_forums($_SESSION['course_id']);
34 //output course forums
35 $num_shared = count($all_forums['shared']);
36 $num_nonshared = count($all_forums['nonshared']);
37 $num_groups = count($all_forums['group']);
39 if ($num_shared || $num_nonshared || $num_groups) {
40 foreach ($all_forums as $shared => $forums) {
41 if (($num_shared && $num_nonshared) || ($num_nonshared && $num_groups)) {
42 if ($num_nonshared && ($shared == 'nonshared')) {
44 echo '<th colspan="4">' . _AT('course_forums') . '</th>';
46 } else if ($num_shared && ($shared == 'shared')) {
47 echo '</tbody><tbody><tr>';
48 echo '<th colspan="4">' . _AT('shared_forums') . '</th>';
50 } else if ($num_groups && ($shared == 'group')) {
51 echo '</tbody><tbody><tr>';
52 echo '<th colspan="4">' . _AT('group_forums') . '</th>';
57 foreach ($forums as $row) : ?>
59 <td><a href="<?php echo url_rewrite('mods/_standard/forums/forum/index.php?fid='.$row['forum_id']); ?>"><?php echo AT_print($row['title'], 'forums.title'); ?></a> <?php
60 // patch has added the two icons below
61 if ($_SESSION['enroll']) {
62 $sql = "SELECT 1 AS constant FROM ".TABLE_PREFIX."forums_subscriptions WHERE forum_id=$row[forum_id] AND member_id=$_SESSION[member_id]";
63 $result1 = mysql_query($sql, $db);
65 if ($row1 = mysql_fetch_row($result1)) {
66 echo '<a href="mods/_standard/forums/forum/subscribe_forum.php?fid='.$row['forum_id'].SEP.'us=1">
67 <br /><img border="0" src="'.AT_BASE_HREF.'images/unsubscribe-envelope.png" alt="" /> '._AT('unsubscribe1').'</a>';
69 echo '<a href="mods/_standard/forums/forum/subscribe_forum.php?fid='.$row['forum_id'].'">
70 <br /><img border="0" src="'.AT_BASE_HREF.'images/subscribe-envelope.png" alt="" /> '._AT('subscribe1').'</a>';
73 <p><?php echo AT_print($row['description'], 'forums.description'); ?></p>
75 <td align="center" valign="top"><?php echo $row['num_topics']; ?></td>
76 <td align="center" valign="top"><?php echo $row['num_posts']; ?></td>
77 <td align="right" valign="top"><?php
79 if ($row['last_post'] == '0000-00-00 00:00:00') {
80 echo '<strong>'._AT('na').'</strong>';
82 echo AT_DATE(_AT('server_date_format'), $row['last_post'], AT_DATE_MYSQL_DATETIME);
90 echo '<tr><td class="row1" colspan="4"><strong>'._AT('no_forums').'</strong></td></tr>';
94 require (AT_INCLUDE_PATH.'footer.inc.php');