-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpm_slist.php
executable file
·108 lines (77 loc) · 2.93 KB
/
pm_slist.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
<?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/pm_lib.php");
if(!isset($_SESSION))
{
session_start();
}
logged();
$start_pag=0;
if (isset($_REQUEST['p']) && $_REQUEST['p']>0){
$start_pag=$_REQUEST['p']*($pm_per_pag);
}
$ref_id=$_SESSION['id'];
if ($bind_pm_char)
$ref_id=$_SESSION['char_id'];
//0=messaggi in arrivo 1=cestino -1=inviati
if (isset($_REQUEST['f']) && $_REQUEST['f']=='1'){ //trash
$pm_list=new PrivateMessageList($ref_id,1,$ref_id);
$page_q=$pm_list->count();
}elseif (isset($_REQUEST['f']) && $_REQUEST['f']=='-1'){ //outbox ->mostro destinatario
$pm_list=new PrivateMessageList($ref_id,0,$ref_id);
$page_q=$pm_list->count();
}elseif(!empty($_REQUEST['s'])){
//nel search posso cercare solo i messaggi che posso vedere
$searchV=trim($_REQUEST['s']);
$pm_list=new PrivateMessageList(null,0,$ref_id,$searchV);
$page_q=$pm_list->count();
}else{ //inbox
$pm_list=new PrivateMessageList($ref_id,0,$ref_id);
$page_q=$pm_list->count();
}
if (count($pm_list->PMList())>0){
echo "<div id=\"pm_pag_c\">";
$i=0;
foreach ($pm_list->PMList() as $key => $value) {
$subject=$value->getSubject();
if ($subject=="")
$subject="Nessun Oggetto";
if($value->getReplyCount()>1)
$subject.= " — {$value->getReplyCount()} messaggi";
$unread="";
if ($value->getRecipient()==$ref_id && $value->getViewed()==0 && $deleter!="0")
$unread=" boldy";
if($value->getRecipient()==$value->getSender()){
$prefix="Annotazione";
}
elseif($value->getRecipient()!=$ref_id){
$prefix="A: {$value->getRecipientNameLink()}";
}else{
$prefix="Da: {$value->getSenderNameLink()}";
}
$class= ((($i++)%2)==0)? 'even':'odd';
echo "
<div class=\"personal_message $class\" id=\"".$value->getId()."\">
<div class=\"pm_sender\">".$prefix."</div>
<div class=\"pm_subject$unread\"><a title=\"$subject\" href=\"pm_newUW.php?rply=$deleter".$value->getId()."\" target=\"imessage\">".$subject."</a></div>
<div class=\"pm_sent\">".itaTime($value->getSentDate())."</div>
<div class=\"pm_delete\"><a title=\"Cancella\" href=\"pm_newUW.php?del=".$value->getId()."\" class=\"deletePm\"><img src=\"images/icons/delete.png\" border=\"0\" /></a></div>
</div>
";
}
echo "</div><span style=\"display:none\" id=\"pm_countH\">(".pm_countNew($ref_id).")</span>";
}else{
echo "Nessun {$GLOBALS['missive']}.";
}
?>
<script type="text/javascript">
$(function() {
$("#pm_pag_c").quickPager({pageSize:"<? echo $pm_per_pag; ?>"});
});
</script>