suppressing recent chat history messages in admin panel
PostPosted: 10 Feb 2011, 07:18
In the overview page of the admin part of arrowchat, there is a list showing the recent private chat messages of other users. As I mentioned in another post, it seems to me like looking at this is an invasion of privacy unless you make it clear to everyone that you may be monitoring their conversations. If anyone else feels uncomfortable with this, here's what you can do.
1. If you want to keep the list of people who have recently chatted but you want to get rid of the actual messages, you can do this:
2. If you want to get rid of the entire Recent Chat segment of the admin overview page, you can do this:
Jason, I know you have your hands full but you may want to add an otion to turn off this list in some future version.
[edit: changed the first option to avoid showing the names as links since clicking those links gives the user's recent messages]
[second edit: I changed the first option again to put thos names back in as links but get rid of the actual message text when you go to manage a user]
1. If you want to keep the list of people who have recently chatted but you want to get rid of the actual messages, you can do this:
- Code: Select all
OPEN
arrowchat/admin/index.php
FIND AND DELETE
<td style="width: 305px;" class="row2">Message</td>
FIND AND DELETE
<td class="row1"><div style="overflow: hidden; width: 300px;"><?php echo $row['message']; ?></div></td>
OPEN
arrowchat/admin/users.php
FIND
<div style="padding:5px 10px 5px 0px; float: left; background-color: #f3f3f3; width: 523px;"><a href="users.php?do=logs&id=<?php echo $_REQUEST['w']; ?>"><b><?php echo $row2[DB_USERTABLE_NAME]; ?></b></a>: <?php echo $row['message']; ?></div><div style="padding:5px 0px; float: right; background-color: #f3f3f3; width: 150px;"><?php echo date('M j, Y g:i a', $row['sent']); ?></div><div class="clear"></div>
<?php
} else {
?>
<div style="padding:5px 0px; float: left"><a href="users.php?do=logs&id=<?php echo $_REQUEST['id']; ?>"><b><?php echo $row3[DB_USERTABLE_NAME]; ?></b></a>: <?php echo $row['message']; ?></div><div style="float: right; width: 150px;"><?php echo date('M j, Y g:i a', $row['sent']); ?></div><div class="clear"></div>
REPLACE WITH
<div style="padding:5px 10px 5px 0px; float: left; background-color: #f3f3f3; width: 523px;"><a href="users.php?do=logs&id=<?php echo $_REQUEST['w']; ?>"><b><?php echo $row2[DB_USERTABLE_NAME]; ?></b></a></div><div style="padding:5px 0px; float: right; background-color: #f3f3f3; width: 150px;"><?php echo date('M j, Y g:i a', $row['sent']); ?></div><div class="clear"></div>
<?php
} else {
?>
<div style="padding:5px 0px; float: left"><a href="users.php?do=logs&id=<?php echo $_REQUEST['id']; ?>"><b><?php echo $row3[DB_USERTABLE_NAME]; ?></b></a></div><div style="float: right; width: 150px;"><?php echo date('M j, Y g:i a', $row['sent']); ?></div><div class="clear"></div>
FIND AND DELETE
<td style="width: 525px;" class="row2">Message</td>
FIND AND DELETE
<td class="row1"><?php echo $row['message']; ?></td>
2. If you want to get rid of the entire Recent Chat segment of the admin overview page, you can do this:
- Code: Select all
OPEN
arrowchat/admin/index.php
FIND AND DELETE
<div class="title_bg">
<div class="title">Recent Chat</div>
<div class="module_content">
<?php
$query = "SELECT COUNT(id) AS numrows FROM arrowchat";
$result = mysql_query($query);
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$numrows = $row['numrows'];
$pagenum = 1;
$self = $_SERVER['PHP_SELF'];
$nav = 'Page ';
$maxpage = 10;
$total_pages = ceil($numrows / $maxpage);
if(isset($_GET['page'])) {
$pagenum = $_GET['page'];
}
for ($i=1; $i<=$total_pages; $i++) {
if ($i == $pagenum) {
$nav .= " $i ";
} else if ($i <= 5) {
$nav .= " <a href=\"$self?page=$i\">".floor($i)."</a> ";
}
}
$offset = ($pagenum - 1) * $maxpage;
$sql = " SELECT * FROM arrowchat ORDER BY id DESC LIMIT $offset, $maxpage";
$result = mysql_query($sql);
if ($result && mysql_num_rows($result) > 0) {
?>
<table cellspacing="0" cellpadding="0">
<tr style="height: 25px;">
<td style="width: 125px;" class="row2">From</td>
<td style="width: 125px;" class="row2">To</td>
<td style="width: 305px;" class="row2">Message</td>
<td style="width: 50px;" class="row2">Read</td>
<td style="width: 125px;" class="row2">Sent</td>
</tr>
<?php
while ($row = mysql_fetch_array($result)) {
$sql = "SELECT ".DB_USERTABLE_NAME.",".DB_USERTABLE_USERID." FROM ".TABLE_PREFIX.DB_USERTABLE." WHERE ".DB_USERTABLE_USERID."='".$row['from']."'";
$result2 = mysql_query($sql);
$from_username = mysql_fetch_row($result2);
$sql = "SELECT ".DB_USERTABLE_NAME.",".DB_USERTABLE_USERID." FROM ".TABLE_PREFIX.DB_USERTABLE." WHERE ".DB_USERTABLE_USERID."='".$row['to']."'";
$result2 = mysql_query($sql);
$to_username = mysql_fetch_row($result2);
?>
<tr style="height: 25px;">
<td class="row1"><a href="users.php?do=logs&id=<?php echo $from_username[1]; ?>"><?php echo $from_username[0]; ?></a></td>
<td class="row1"><a href="users.php?do=logs&id=<?php echo $to_username[1]; ?>"><?php echo $to_username[0]; ?></a></td>
<td class="row1"><div style="overflow: hidden; width: 300px;"><?php echo $row['message']; ?></div></td>
<?php
if($row['user_read'] == 1) {
echo '<td class="row1">Yes</td>';
} else {
echo '<td class="row1">No</td>';
}
?>
<td class="row1"><?php echo date("M j, Y",$row['sent']); ?><br><?php echo date("g:i a",$row['sent']); ?></td>
</tr>
<?php
}
?>
<tr>
<td colspan="5">
<div style="margin-top: 10px; float: left;">
<?php echo $nav; ?>
</div>
</td>
</tr>
</table>
<?php
} else {
?>
No one has ever chatted!
<?php
}
?>
</div>
</div>
Jason, I know you have your hands full but you may want to add an otion to turn off this list in some future version.
[edit: changed the first option to avoid showing the names as links since clicking those links gives the user's recent messages]
[second edit: I changed the first option again to put thos names back in as links but get rid of the actual message text when you go to manage a user]