2 include('encrypt.php');
3 require 'include/inbox.class.php';
4 require 'include/header.php';
6 if (!isset($_COOKIE['DMDM']) && !isset($_COOKIE['MDMD'])) {
7 header('location:index.php');
11 /*********************************************
12 function GetImgTrip($mail) {
14 $fdir = substr($mail, 0, 1);
15 $sdir = substr($mail, 1, 1);
16 $impo = file_get_contents(DB_PATH."$fdir/$sdir/$mail");
20 //*********************************************/
21 // $init = new Message;
23 $uid = $init->GetID($_COOKIE['DMDM'],$id_mail_path);
25 if(isset($_POST['delete'])){
26 if(!file_exists($_SESSION['sLoggedDir'].'del')){
27 chdir($_SESSION['sLoggedDir']);
31 if(is_dir($_SESSION['sLoggedDir'].'del')){
32 $delete = $_POST['delete'].".dat";
33 if(file_exists($_SESSION['sLoggedDir'].$delete)){
34 rename($_SESSION['sLoggedDir'].$delete, $_SESSION['sLoggedDir'].'del/'.$delete);
35 $_SESSION['msg'] = "<div class=¥"alert alert
-success¥
">メッセージが正常に削除されました。</div>";
36 header('Location: '.$livesitePath.'inbox.php');
39 $_SESSION['msg'] = "<div class=¥"alert alert
-danger¥
">Doesn't Exists</div>";
40 header('Location: '.$livesitePath.'inbox.php');
46 if(isset($_POST['msgSubmit'])){
48 $id = strip_tags(addslashes(trim($_POST['zxcvbnm'])));
49 $id = (filter_var($id, FILTER_VALIDATE_INT
)) ?
$id : FALSE;
50 $subj = trim($_POST['subj']);
51 $inf = trim($_POST['msg']);
53 $message = new Message
;
55 $subj = $message->BeSanitize($subj);
56 $sanitize = $message->BeSanitize($inf);
58 if ($sanitize<>false) {
59 $user = $message->FindUser($id,$id_mail_path);
60 $sender = $message->GetID($_COOKIE['DMDM'],$id_mail_path);
61 if($message->CheckBanMessaging()) {
62 echo "メッセージを送信することはできません、低すぎるの点BE";
65 $ckp = $message->CheckPostLimit($sender,$plimit_path,TRUE);
66 if (($ckp >= 60) && ($ckp != false)) {
67 echo "到達した後の制限は、次の分お待ちください";
70 $ckp = $message->CheckPostLimit($sender,$plimit_hpath,FALSE);
71 if (($ckp >= 600) && ($ckp != false)) {
72 echo "到達した後の制限は、次の1時間お待ちください";
75 $write = $message->WriteMDB($user,$sanitize,$sender,$subj,$id);
78 $message->AddPostLimit($sender,$plimit_path,TRUE);
79 $message->AddPostLimit($sender,$plimit_hpath,FALSE);
80 $_SESSION['msg'] = "<div class=¥"alert alert
-success¥
">正常に送信されたメッセー</div>";
82 $_SESSION['msg'] = "<div class=¥"alert alert
-danger¥
">メッセージは送信されませんでした</div>";
89 $_SESSION['msg'] = "<div class=¥"alert alert
-danger¥
">メッセージは送信されませんでした</div>";
94 'amazed' => '::amazed::',
97 'treasure' => '::treasure::',
98 'angry' => '::angry::',
99 'gangster' => '::gangster::',
100 'shame' => '::shame::',
101 'wink' => '::wink::',
102 'annoyed' => '::annoyed::',
103 'laugh' => '::laugh::',
104 'sick' => '::sick::',
105 'blush' => '::blush::',
106 'sing' => '::sing::',
107 'chocked' => '::chocked::',
108 'smile' => '::smile::',
109 'confused' => '::confused::',
110 'ninja' => '::ninja::',
111 'tongue' => '::tongue::',
112 'lawyer' => '::lawyer::',
113 'guru' => '::guru::',
116 $ultravariable = array();
117 foreach ($emoticon as $key => $value) {
118 $ultravariable[] = "<li class=¥"lialign¥
"><img src='{$livesitePath}images/{$key}.gif' data-alt='{$value}'></li>";
120 $sEmote = implode("", $ultravariable);
126 <div
class="modal fade" id
="myModal" tabindex
="-1" role
="dialog" aria
-labelledby
="myModalLabel" aria
-hidden
="true">
127 <div
class="modal-dialog">
128 <div
class="modal-content">
129 <div
class="modal-header">
130 <button type
="button" class="close" data
-dismiss
="modal" aria
-hidden
="true">×
;</button
>
131 <h4
class="modal-title" id
="myModalLabel">メッセージを送る
</h4
>
133 <form
class="form" method
="post" id
="sendMessage">
134 <div
class="modal-body">
135 <div
class="form-group">
136 <div
class="input-group">
137 <span
class="input-group-addon">受信者
:</span
>
138 <input type
="text" class="form-control" name
="zxcvbnm" required
>
139 <div
class="clearfix"></div
>
142 <div
class="form-group">
143 <div
class="input-group">
144 <span
class="input-group-addon">件名
:</span
>
145 <input type
="text" class="form-control" name
="subj" required
>
146 <div
class="clearfix"></div
>
149 <!--input type
="hidden" value
="" name
="rec"/> <!--receiver
-->
150 <div
class="form-group">
151 <textarea rows
="4" class="form-control top" id
='messageBox' name
="msg" maxlength
="250" id
="msg"></textarea
>
153 <div
class="clearfix"></div
>
155 <div
class="modal-footer">
156 <button type
="button" class="btn btn-default dropdown-toggle" data
-toggle
="dropdown">絵文字
</button
>
157 <ul
class="dropdown-menu dropdown-menu-right" role
="menu" id
="emoji">
158 <?php
echo $sEmote ?
>
160 <button type
="submit" class="btn btn-primary" name
="msgSubmit">送る
</button
>
168 <div
class="well well-sm pad3">
170 <?php
require 'include/nav.php' ?
>
173 <!-- <div
class="pad panel panel-default sp fxmrgn b "> -->
174 <!--Showing messages
-->
177 $inbox = new inboxRead();
178 $files = $inbox->getInbox();
181 echo " <!-- List of messages -->
182 <div class=¥"btn
-group¥
">
183 <button type=¥"button¥
" class=¥"btn btn
-default¥
" id=¥"btnMsg¥
" data-toggle=¥"modal¥
" data-target=¥"#myModal¥">
184 <span
class=¥
"glyphicon glyphicon-envelope¥"></span
>
187 echo "<div
class=¥
"alert alert-danger¥" id
=¥
"delmsg¥" style
=¥
"display:none;¥">
188 あなたが会話を削除してもよろしいですか?
<input type
=¥
"submit¥" class=¥
"btn btn-default btn-sm¥" id
=¥
"deleteM¥" value
=¥
"削除¥"name
=¥
"block¥">
189 <input type
=¥
"button¥" class=¥
"btn btn-default btn-sm¥" value
=¥
"キャンセル¥" name
=¥
"cancel¥" onclick
=¥
"document.getElementById('delmsg').style.display='none';¥">
194 if(!empty($_SESSION['msg'])){
195 echo $_SESSION['msg'];
196 $_SESSION['msg'] = '';
200 <div id="page
" class="pagination2
" >
203 <div class="clearfix
"></div>
205 <ul class="list-group
" id="list">
208 foreach($files as $filename){
209 $value = $init->getContent($filename);
210 $from = $init->within_str($value[0], "<from
>", "</from
>");
211 $to = $init->within_str($value[0], "<to
>", "</to
>");
212 $id = $init->within_str(max($value), "<id
>", "</id
>");
213 $subj = $init->within_str($value[0], "<subj
>", "</subj
>");
214 $read = $init->within_str($value[0], "<read
>", "</read
>");
215 $msg = $init->within_str($value[0], "<msg
>", "</msg
>");
217 $array[$filename] = array("id
" => $id, "subj
" =>$subj, "read
"=>$read, "msg
"=>$msg ,"from
" => $from, "to
" => $to, );
222 // sort associative array
223 $array = $init->array_sort($array, 'id', SORT_DESC);
228 foreach ($array as $key => $value) {
229 if (trim(urldecode($value["from
"])) == trim($uid)) {
230 $ucode = urldecode($value["to
"]);
232 $ucode = urldecode($value["from
"]);
234 $ucode = $init->FindUser($ucode,$id_mail_path);
235 $ucode = trim($init->GetImgTrip($ucode));
236 $ucode = explode("¥n
", $ucode);
237 $uimg = trim($ucode[5]);
238 if (isset($ucode[7]) && ($ucode[7] != NULL || $ucode[7] != "")) {
243 $url = substr($key, 0,-4);
244 $ff = urldecode($value["subj
"]);
246 if($init->countMessage($key) > 0 ){
247 $unreadMessage = "<span
class='badge pull-right'>{$init->countMessage($key)}</span
>";
253 // $unreadCounter = ($init->within_str(max($value), "<read
>", "</read
>")==1) ? 'read' : 'unread' ;
255 echo "<li
class='list-group-item ".$class."' style
=¥
"overflow:auto !important;¥">
256 <div
class='media panel6'>
259 <div
class=¥
"dropdown pull-right¥">
260 <a data
-toggle
=¥
"dropdown¥" href
=¥
"#¥"><span
class=¥
"caret¥"></span
></a
>
262 <ul
class=¥
"dropdown-menu dropdown-menu-right cuzdropdown-menu¥" role
=¥
"menu¥" aria
-labelledby
=¥
"dLabel¥">
264 <form method
=¥
"POST¥" class='deleteForm'>
265 <input type
='hidden' name
='delete' value
='{$url}'>
266 <small
><a href
='#' class='destroy'>削除
</a
></small
>
270 </ul
><div
class=¥
"clearfix¥"></div
>
280 <a
class='pull-left' href
='#'>
282 <img
class='pic2' src
=¥
"".$livesitePath2."/ico/{$uimg}¥" >
285 <div
class='media-body'>
287 <a href
='message.php?d={$url}' class='pull-left'>
288 <h5
class='media-heading'>{$utrip}</h5
>
289 <div
class='limit'>{$ff}</div
>
293 </div
><!--media
-body
-->
303 </div><!--hide/"" pagination-->
304 </div><!--pad panel panel-default-->
305 </div><!--well well-lg-->
308 require 'include/footer.php';