Help
Discuss or request ArrowChat modifications
User avatar
asinsh
Customer
 
Posts: 55
Joined: 02 Apr 2010, 08:22

 

by asinsh 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:

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]
Last edited by asinsh on 11 Feb 2011, 04:48, edited 1 time in total.
User avatar
asinsh
Customer
 
Posts: 55
Joined: 02 Apr 2010, 08:22

 

by asinsh 10 Feb 2011, 16:33

Opps, I see that if I use the first option (the one that shows the names of people who have chatted recently but doesn't show messages), the names are shown as links and clicking the links shows the user's recent messages. I just edited the code in the above post so that the names are now no longer links.
User avatar
Jason
Customer
 
Posts: 2336
Joined: 12 Dec 2009, 16:06

 

by Jason 10 Feb 2011, 18:17

You can still click on "manage users" and view logs. In fact, you could look at the database too so there is no way to have complete privacy.
User avatar
asinsh
Customer
 
Posts: 55
Joined: 02 Apr 2010, 08:22

 

by asinsh 11 Feb 2011, 04:29

RIght, I know I can always look in the db but I'm just trying to keep this hidden from casual view where it may be too tempting. I had forgotten (actually, I hadn't realized) that you cold get to the users message via manage users. If I have time over the next few days, I'll post revised code that (a) puts back in the user link that I took out in alternative 1 (since all that link does is to bring you to manage users for that user) and (b) gets rid of the message when you actually go to manage users.

Thanks for the reminder, Jason.
User avatar
asinsh
Customer
 
Posts: 55
Joined: 02 Apr 2010, 08:22

 

by asinsh 11 Feb 2011, 04:50

Ok, I just re-edited the first post so that for the first alternative the user links remain in the overview page but the message text does not get displayed in the logs page. Thanks again for the help, Jason.
User avatar
Staff Bot
ArrowChat Team
 
Posts: 8996
Joined: 07 Nov 2012, 13:41

 

by Staff Bot 07 Nov 2012, 12:40

This thread has been locked because the last post is greater than six months old. There is a good chance that the information in this thread is outdated. Please open a new topic if you wish to discuss this further.