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/');
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');
19 $myPrefs = getPrefs($_SESSION['username']);
20 writePrefs($myPrefs, $_SESSION['username']);
23 $topMsgNum = $bottomMsgNum = 0;
24 howManyMessages($topMsgNum, $bottomMsgNum);
26 $hisTopNum = $_GET['hisTopNum'];
28 if ($hisTopNum > $topMsgNum) {
29 $hisTopNum = $topMsgNum;
32 $hisTopNum = $topMsgNum;
35 $hisBottomNum = getLower20Bound($hisTopNum, $bottomMsgNum);
37 if ($hisBottomNum == 0) {
40 $totalNum = $topMsgNum - $bottomMsgNum + 1;
42 $hisTopNumUserPerspective = $hisTopNum - $bottomMsgNum + 1;
43 $hisBottomNumUserPerspective = $hisBottomNum - $bottomMsgNum + 1;
45 if ($hisBottomNumUserPerspective < 1) {
46 $hisBottomNumUserPerspective = 1;
49 $prevNumT = $hisBottomNum - 1;
50 $nextNumT = $hisTopNum + 20;
52 require('include/html/chat_header.inc.php');
55 if ($hisTopNum < $topMsgNum && $hisBottomNum > $bottomMsgNum) {
57 <table width="100%" border="0" cellpadding="5" cellspacing="0">
59 <td align="right"><a href="history.php?hisTopNum=<?php echo $prevNumT; ?>" target="_top" onFocus="this.className='highlight'" onBlur="this.className=''"><?php echo _AT('previous'); ?></a> | <a href="history.php?hisTopNum=<?php echo $nextNumT; ?>" target="_top" onFocus="this.className='highlight'" onBlur="this.className=''"><?php echo _AT('next'); ?></a> | <a href="chat.php" target="_top" onFocus="this.className='highlight'" onBlur="this.className=''"><?php echo _AT('chat_return'); ?></a></td>
63 } else if ($hisBottomNum > $bottomMsgNum) {
65 <table width="100%" border="0" cellpadding="5" cellspacing="0">
67 <td align="right"><a href="history.php?hisTopNum=<?php echo $prevNumT; ?>" target="_top" onFocus="this.className='highlight'" onBlur="this.className=''"><?php echo _AT('previous'); ?></a> | <a href="chat.php" target="_top" onFocus="this.className='highlight'" onBlur="this.className=''"><?php echo _AT('chat_return'); ?></a></td>
73 <table width="100%" border="0" cellpadding="5" cellspacing="0">
75 <td align="right"><a href="history.php?hisTopNum=<?php echo $nextNumT; ?>" target="_top" onFocus="this.className='highlight'" onBlur="this.className=''"><?php echo _AT('next'); ?></a> | <a href="chat.php" target="_top" onFocus="this.className='highlight'" onBlur="this.className=''"><?php echo _AT('chat_return'); ?></a></td>
81 <table width="100%" border="0" cellpadding="5" cellspacing="0">
83 <th align="left" class="box"><?php echo _AT('chat_history_messages', $hisBottomNumUserPerspective, $hisTopNumUserPerspective, $totalNum); ?></th>
87 echo '<p><table border="0" cellpadding="2" cellspacing="0" width="90%" class="box2">';
89 if ($myPrefs['newestFirstFlag'] > 0) {
90 for ($i = $hisTopNum; $i >= $hisBottomNum; $i--) {
91 showMessage($i, $myPrefs);
94 for ($i = $hisBottomNum; $i <= $hisTopNum ; $i++) {
95 showMessage($i, $myPrefs);
100 if ($hisTopNum < $topMsgNum && $hisBottomNum > $bottomMsgNum) {
102 <table width="100%" border="0" cellpadding="5" cellspacing="0">
104 <td align="right"><a href="history.php?hisTopNum=<?php echo $prevNumT; ?>" target="_top" onFocus="this.className='highlight'" onBlur="this.className=''">Previous</a> | <a href="history.php?hisTopNum=<?php echo $nextNumT; ?>" target="_top" onFocus="this.className='highlight'" onBlur="this.className=''">Next</a> | <a href="chat.php" target="_top" onFocus="this.className='highlight'" onBlur="this.className=''">Return to Chat</a></td>
109 } else if ($hisBottomNum > $bottomMsgNum) {
111 <table width="100%" border="0" cellpadding="5" cellspacing="0">
113 <td align="right"><a href="history.php?hisTopNum=<?php echo $prevNumT; ?>" target="_top" onFocus="this.className='highlight'" onBlur="this.className=''">Previous</a> | <a href="chat.php" target="_top" onFocus="this.className='highlight'" onBlur="this.className=''">Return to Chat</a></td>
119 <table width="100%" border="0" cellpadding="5" cellspacing="0">
121 <td align="right"><a href="history.php?hisTopNum=<?php echo $nextNumT; ?>" target="_top" onFocus="this.className='highlight'" onBlur="this.className=''">Next</a> | <a href="chat.php" target="_top" onFocus="this.className='highlight'" onBlur="this.className=''">Return to Chat</a></td>
127 require('include/html/chat_footer.inc.php');