3ab34ddc0bd8a57f704db9b2774514885418f081
[atutor.git] / docs / mods / _standard / chat / filterHistory.php
1 <?php
2 /****************************************************************/
3 /* ATutor                                                                                                               */
4 /****************************************************************/
5 /* Copyright (c) 2002-2010                                      */
6 /* Inclusive Design Institute                                   */
7 /* http://atutor.ca                                                                                             */
8 /*                                                              */
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 /****************************************************************/
13
14 define('AT_INCLUDE_PATH', '../../../include/');
15 require(AT_INCLUDE_PATH.'vitals.inc.php');
16 //authenticate(USER_CLIENT, USER_ADMIN);
17 require(AT_INCLUDE_PATH.'../mods/_standard/chat/lib/chat.inc.php');
18
19         $myPrefs = getPrefs($_SESSION['username']);
20         writePrefs($myPrefs, $_SESSION['username']);
21
22         cleanUp();
23         $topMsgNum = $bottomMsgNum = 0;
24     howManyMessages($topMsgNum, $bottomMsgNum);
25
26     $filterChatID = $_GET['filterChatID'];
27
28 require('include/html/chat_header.inc.php');
29 ?>
30 <table width="100%" border="0" cellpadding="5" cellspacing="0">
31 <tr>
32         <td align="right"><a href="chat.php" target="_top" onFocus="this.className='highlight'" onBlur="this.className=''"><?php echo _AT('chat_return'); ?></a></td>
33 </tr>
34 </table>
35
36 <table width="100%" border="0" cellpadding="5" cellspacing="0">
37 <tr>
38         <th align="left" class="box"><?php echo _AT('history'); ?></th>
39 </tr>
40 </table>
41 <p><table border="0" cellpadding="2" cellspacing="0" width="90%" class="box2">
42 <?php
43     if ($myPrefs['newestFirstFlag'] > 0) {
44         for ($i = $topMsgNum; $i >= 1; $i--) {
45             showMessageFiltered($i, $myPrefs, $filterChatID);
46         }
47     } else {
48         for ($i = 1; $i <= $topMsgNum ; $i++) {
49             showMessageFiltered($i, $myPrefs, $filterChatID);
50         }    
51     }
52 ?>
53 </table></p>
54 <br />
55
56 <table width="100%" border="0" cellpadding="5" cellspacing="0">
57 <tr>
58         <td align="right"><a href="chat.php" target="_top" onFocus="this.className='highlight'" onBlur="this.className=''"><?php echo _AT('chat_return'); ?></a></td>
59 </tr>
60 </table>
61 <?php require('include/html/chat_footer.inc.php'); ?>