-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathadmin_pm.php
executable file
·131 lines (99 loc) · 3.62 KB
/
admin_pm.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?php
/* I codici qui inseriti sono proprietà di
* Francesco Stasi, pertanto ne è vietata la
* vendita e la cessione a terzi senza previa
* autorizzazione dell' autore.
*/
require_once("config.php");
require_once("libs/common.php");
require_once("libs/character_lib.php");
require_once("libs/pm_lib.php");
if(!isset($_SESSION))
{
session_start();
}
logged();
$MyChar_obj=new Character(null,$_SESSION['char_name']);
$MyChar_obj->parseFromDb();
if(!($MyChar_obj->exists())){
echo "Personaggio inesistente.";
exit();
}
$_SESSION['modlevel']=$MyChar_obj->Account()->getModLevel();
if ($admin_view_pm_required>$_SESSION['modlevel']){
echo "Accesso negato, permessi insufficienti.";
exit();
}
$sender=null;
$recipient=null;
if(isset($_REQUEST['sender']) && $_REQUEST['sender']!=''){
$tmpC=new Character(null,$_REQUEST['sender']);
$tmpC->checkExistance();
$sender=$tmpC->getCharId();
}
if(isset($_REQUEST['recipient']) && $_REQUEST['recipient']!=''){
$tmpC=new Character(null,$_REQUEST['recipient']);
$tmpC->checkExistance();
$recipient=$tmpC->getCharId();
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="author" content="Francesco Stasi"/>
<title><?php echo $nome_land;?></title>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<script>
$(function() {
$( "#search_field" ).autocomplete({
source: "char_list.php",
minLength: 2,
delay: 200
});
});
</script>
<body>
<h2>Visione dei Messaggi Privati</h2>
<form method="get" action="admin_pm.php" id="search" autocomplete="off">
<input id="search_field" name="recipient" type="text" size="40" value="<? echo $_REQUEST['recipient']; ?>" placeholder="Utente da spiare..." />
</form>
<div class="result" style="margin: 0 auto; margin-top: 20px; width: 90%;">
<?php
$strp=0;
$pmList= new PrivateMessageList($recipient,null);
foreach ($pmList->PMList() as $key => $PM_obj) {
//$PM_obj=new PrivateMessage();
$pm_arr_rply=explode(',',$PM_obj->getReplyTo());
echo "<div class=\"dark_bg center centertxt clearborder\" style=\"margin: 10px; padding-top:10px;\">
<div class=\"panel_bg center centertxt roundcorner clearborder pm_cronologia\">Cronologia della discussione <strong>{$PM_obj->getSubject()}</strong></div>
<div style=\"padding:15px;\">";
for($i=0;$i<count($pm_arr_rply);$i++){
if ($pm_arr_rply[$i]==0)
continue;
$PM_subobj=new PrivateMessage(null,$pm_arr_rply[$i]);
$PM_subobj->pm_superread();
if($PM_obj->getSender()==$PM_subobj->getSender()){
$asw="answerBox2";
}else {$asw="answerBox1";}
echo '<div class="panel_bg roundcorner clearborder answerBox clearboth '.$asw.'">
<div class="answerBoxDate">'.itaTime($PM_subobj->getSentDate()).'</div>
<div class="answerBoxAuth">'.$PM_subobj->getSenderNameLink().' -> '.$PM_subobj->getRecipientNameLink().'</div>
<div class="answerBoxMsg">'.acapo($PM_subobj->getMessage()).'</div>
</div>';
}
echo '<div class="panel_bg roundcorner clearborder answerBox clearboth answerBox2">
<div class="answerBoxDate">'.itaTime($PM_obj->getSentDate()).'</div>
<div class="answerBoxAuth">'.$PM_obj->getSenderNameLink().' -> '.$PM_obj->getRecipientNameLink().'</div>
<div class="answerBoxMsg">'.acapo($PM_obj->getMessage()).'</div>
</div>';
echo " </div>
</div>";
}
?>
</div>
</body>
</html>