کد PHP:
?><?php
/**
 * Class AdminRegUserIndex - Admin area
 *
 * LICENSE: CREATIVE COMMONS PUBLIC LICENSE  "Namensnennung — Nicht-kommerziell 2.0"
 *
 * @copyright  2009 <SEDesign />
 * @license    http://creativecommons.org/licenses/by-nc/2.0/de/
 * @version    $3.0.7$
 * @link       http://www.sedesign.de/de_produkte_chat-v3.html
 * @since      File available since Alpha 1.0
 */

class Adminlistpayam extends EtChatConfig
{

    
/**
    * Constructor
    *
    * @uses LangXml object creation
    * @uses LangXml::getLang() parser method
    * @uses ConnectDB::sqlSet()    
    * @uses ConnectDB::sqlGet()    
    * @uses ConnectDB::close()    
    * @return void
    */
    
public function __construct (){ 
        
        
// call parent Constructor from class DbConectionMaker
        
parent::__construct(); 

        
session_start();

        
header('Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0');
        
// Sets charset and content-type for index.php
        
header('content-type: text/html; charset=utf-8');
      

        if (
$_SESSION['etchat_'.$this->_prefix.'user_priv']=="admin"){
        

            
// initialize template
//            $this->initTemplate($lang);
    
        
        


if (ereg(","$_GET['userid']))
{
    
// handle error 
echo '<meta http-equiv="refresh" content="3; url=http://www.xco.ir/"><div class="style1"><font   face="Tahoma" size="-1">ERROR !</font></div>';
exit;
}

if (
ereg(","$_POST['userid']))
{
    
// handle error 
echo '<meta http-equiv="refresh" content="3; url=http://www.xco.ir/"><div class="style1"><font   face="Tahoma" size="-1">ERROR !</font></div>';
exit;
}

include 
'db_connect.php';


mysql_query"SET NAMES 'latin1'" );


if (
$_POST['limit'])
{
$limit $_POST['limit'];
}
else
{
$limit ="100";
}
if (
$_GET['userid'])
{
$userid =$_GET['userid'];
$SQL 'SELECT * FROM `db1_etchat_messages` where etchat_user_fid = '.$userid.' order by etchat_timestamp  desc Limit 0, '.$limit.''
}
else {
$SQL 'SELECT * FROM `db1_etchat_messages`  order by etchat_timestamp  desc Limit 0, '.$limit.''
}
$result mysql_query($SQL);




print 
'


<head>
<style type="text/css">
body
{
background-image:url(\'img/bg.jpg\');
background-repeat:repeat-x;
background-attachment:fixed;
}
.auto-style1 {
    font-family: Tahoma;
    font-size: x-small;
}
</style>
</head>

<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>سيستم خواندن خصوصي ... طراحي و اجرا گروه طراحي آرتان وب ... www.xco.ir</title>

<style>
body{
font-family:tahoma;
font-size:8pt;
background-color:#DBF2FF;

}

td{
font-family:tahoma;
font-size:8pt;
border:1px solid #e7e7e7;
padding:5px;
text-align:center;
height:30px;
color:#006699;
background-color:#FFFFFF;
-moz-border-radius:6px;
-webkit-border-radius:6px;
direction:rtl;
-moz-box-shadow:3px 3px 4px #000;
margin:5px;
-webkit-box-shadow:3px 3px 4px #000
}


</style>











<form style="display: inline;" action=""  method="post">
<select name="limit" size="3" id="Combobox1" style="position:absolute;left:0px;top:0px;width:200;height:60;border-width:0px;background-color:#E6E6FA;font-family:Tahoma;font-size:13px;">
<option value="100">از بين 100 پيام آخر</option>
<option value="200">از بين 200 پيام آخر</option>
<option value="500">از بين 500 پيام آخر</option>
<option value="1000">از بين 1000 پيام آخر</option>
<option value="2000">از بين 2000 پيام آخر</option>
<option value="100000">همه پيام ها</option>
</select>
<input type="submit" id="Button1" name="" value="نمايش بده!" style="position:absolute;left:200px;top:0px;width:96px;height:25px;font-family:Tahoma,Arial;font-size:13px;z-index:2">
</form>

<form style="display: inline;" action=""  method="GET">
<input type="hidden" name="Adminlistpayam" id="Adminlistpayam" value="" />
<select type=hidden name="userid" size="3" style="position:absolute;right:0px;top:0px;width:0;height:0;border-width:0px;background-color:#E6E6FA;font-family:Tahoma;font-size:13px;">


<option type=hidden selected value="0">0</option>

</select>
<input type="submit" id="Button1" name="" value="نمايش همه" style="position:absolute;right:20px;top:0px;width:96px;height:25px;font-family:Tahoma,Arial;font-size:13px;z-index:2">
</form>

<br><br><br><br><br> 
<div align="center" style="position:absolute;right:120px;top:30px;width:96px;height:20px;border:1px #C0C0C0 solid;z-index:3">
'
$userid .'
</div>

<div align="center" style="position:absolute;right:120px;top:0px;width:120px;height:20px;border:1px #C0C0C0 solid;z-index:3">
<a href="./?AdminIndex"><<< برگشت به مديريت</a>
</div>
<div align="center" style="position:absolute;right:20px;top:30px;width:96px;height:20px;border:0px #C0C0C0 solid;z-index:3">
<FORM>
<INPUT TYPE="button" onClick="history.go(0)" VALUE="Refresh">
</FORM>
</div>
'
;


print 
'<table width="98%" cellspacing="0" cellpadding="5" border="0" style="border: 1px solid black;"><tbody><tr class="kopf">    <td style="padding: 2px;"><b>فرستده</b></td>
        <td style="padding: 2px;"><b>نام فرستنده</b></td>
        <td style="padding: 2px;"><b>متن</b></td>
        <td style="padding: 2px;"><b>گيرنده</b></td>
        <td style="padding: 2px;"><b>نام گيرنده</b></td>
        <td style="padding: 2px;"><b>تاريخ ارسال</b></td>
        </tr>'
;

while (
$db_field mysql_fetch_assoc($result)) {


if (
substr($db_field['etchat_text'],0,8)== "/window:"){

$db_field['etchat_text'] = "<img src=\"./img/privat_win.png\"  alt=\"".$db_field['etchat_user_ip'] ."\" title=\"".$db_field['etchat_user_ip'] ."\"/> ".substr($db_field['etchat_text'],8,strlen($db_field['etchat_text']));










$private_at "SELECT etchat_username from db1_etchat_user where etchat_user_id = ".$db_field['etchat_user_fid'];

$result2 mysql_query($private_at);
while (
$row mysql_fetch_array($result2)) { 
$us $row[0];
}



$private_atx "SELECT etchat_username from db1_etchat_user where etchat_user_id = ".$db_field['etchat_privat'];

$resultx mysql_query($private_atx);
while (
$row mysql_fetch_array($resultx)) { 
$usa $row[0];
}



print 
'<tr id="tr2921277" class="privat_nach"><td style="padding: 2px;"><a href="./?Adminlistpayam&userid=' $db_field['etchat_user_fid']  . "\">".  $db_field['etchat_user_fid'] ."</a></td>";
print 
'<td style="padding: 2px;">' $us "</td>";
print 
'<td style="padding: 2px; text-align:right;">' $db_field['etchat_text'] . "</td>";
print 
'<td style="padding: 2px;"><a href="./?Adminlistpayam&userid=' $db_field['etchat_privat'] . "\">"$db_field['etchat_privat'] ."</a></td>";
print 
'<td style="padding: 2px;">' $usa "</td>";
print 
'<td style="padding: 2px;">' .date("d.m.Y (H:i)",$db_field['etchat_timestamp']). "</td></tr>";
}



}

print 
'</tbody></table> <br><center><strong><div xmlns="http://www.w3.org/1999/xhtml" id="kode_page_copyright">طراحي و پشتيباني توسط : <a href="http://www.xco.ir/">آرتان وب</a></div></strong>
'
;


        
        
        
        
        
        
        
        
        
    }
    
    
    else{
            
header("Location: ./");
        }
    
}
    
    private function 
initTemplate($lang$print_user_list){
        
// Include Template
        //include_once("styles/admin_tpl/indexRegUser.tpl.html");
    
}
}