Initial commit
[2ch-be.git] / dev-test / status.php
blob388b499333b3182dfc31816cb7123e5a845e98e1
1 <?php
2 //DMDM = email
3 //MDMD = password
4 include('encrypt.php');
5 // isset if login or not
6 if (!isset($_COOKIE['DMDM']) && !isset($_COOKIE['MDMD'])) {
7 header('location:index.php');
8 exit;
11 $message = new Message;
12 $icoimg="";
14 $email = Decrypt($_COOKIE['DMDM'],KEY);
15 $email = strtolower(filter_var($email, FILTER_SANITIZE_EMAIL));
16 // echo $email;
17 if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
18 exit;
21 include('inf.php');
23 $fdir = substr($email, 0, 1);
24 $sdir = substr($email, 1, 1);
25 $data = @file(DB_PATH."$fdir/$sdir/$email");
26 if(count($data)<3) {
27 foreach($_COOKIE as $ky => $vl)
28 setcookie($ky,"",time()-3600);
29 header('location:index.php');
30 exit;
33 for ($i=0; $i < count($data); $i++) {
34 $data[$i] = trim($data[$i]);
36 if(count($data)>5){
37 $mystatus = '';
38 if($data[6]!=FORGOT){
39 $mystatus = urldecode($data[6]);
40 $mystatus = str_replace("<br>","\n",$mystatus);
44 $e_ = (isset($_GET['e_'])) ? strip_tags(addslashes(filter_var($_GET['e_'], FILTER_SANITIZE_STRING))):'';
45 if($e_=='1'){
46 $isforedit =true;
49 if (isset($_GET['ico'])) {
50 $ico = $_GET['ico'];
51 $ico = trim($ico);
52 // die("/home/auth/public_html/ico/".$ico);
53 if(!file_exists("/home/auth/public_html/ico/".$ico)){
54 header('location:status.php');
55 exit;
58 if(preg_match('/[^a-z_\-0-9._]/i', $ico)){
59 $ico = "";
62 $type = Array(1 => 'gif'); //store all the image extension types in array
63 $ext = explode(".",$ico); //explode and find value after dot
64 if (strlen($ext[0]) <= 0 ) $ico = "nida.gif";
65 if(!(in_array($ext[1],$type))) //check image extension not in the array $type
67 echo "412";
68 exit;
71 $icoimg = "<img src=\"".$livesitePath2."/ico/".$ico."\" class='pic'/>";
72 $data[5] =$ico;
73 $writeData = implode("\n",$data);
74 file_put_contents(DB_PATH."$fdir/$sdir/$email", $writeData);
75 header('location:status.php');
79 if(isset($_GET['bico'])){
80 $ico = $_GET['bico'];
81 $ico = trim($ico);
82 $fdir = substr($email, 0, 1);
83 $sdir = substr($email, 1, 1);
84 $usrPath = UDB_PATH."{$fdir}/{$sdir}/{$email}/";
85 if(file_exists($usrPath."usrimg.log")){
86 $usrList = file($usrPath."usrimg.log");
87 foreach ($usrList as $key => $value) {
88 $loopedImg = explode("-", $message->within_str($value, "<filename>", "</filename>"));
89 if($loopedImg[0]==$ico){
90 $usrBought = TRUE;
92 // echo $value;
94 // echo "test";
95 // die;
96 if($usrBought){
97 $ico = trim($ico);
98 if(preg_match('/[^a-z_\-0-9._]/i', $ico)){
99 $ico = "";
102 $type = Array(1 => 'gif'); //store all the image extension types in array
103 $ext = explode(".",$ico); //explode and find value after dot
104 if (strlen($ext[0]) <= 0 ) $ico = "nida.gif";
105 if(!(in_array($ext[1],$type))) //check image extension not in the array $type
107 echo "412";
108 exit;
110 $data[5] = $ico."-PREM";
111 $writeData = implode("\n",$data);
112 file_put_contents(DB_PATH."$fdir/$sdir/$email", $writeData);
113 header('location:status.php');
114 exit;
115 }else{
116 header('location:status.php');
117 exit;
125 // if (isset($_GET['premium'])) {
126 // $ico = $_GET['premium'];
127 // $ico=trim($ico);
128 // if(preg_match('/[^a-z_\-0-9._]/i', $ico)){
129 // $ico ="";
130 // }
132 // $type =Array(1 => 'gif'); //store all the image extension types in array
133 // $ext = explode(".",$ico); //explode and find value after dot
134 // if (strlen($ext[0]) <= 0 ) $ico = "nida.gif";
135 // if(!(in_array($ext[1],$type))) //check image extension not in the array $type
136 // {
137 // echo "412";
138 // exit;
139 // }
141 // $icoimg = "<img src=\"".$livesitePath2."/premium/".$ico."\" class='pic'/>";
142 // $data[5] =$ico."-PREM";
143 // $writeData = implode("\n",$data);
144 // file_put_contents(DB_PATH."$fdir/$sdir/$email", $writeData);
145 // $_SESSION['msg'] = '<div class="alert alert-success">You\'re new avatar is updated.</div>';
146 // header('location:status.php');
147 // exit;
148 // }
150 if (isset($data[5]) && !empty($data[5])) {
151 $ico=trim($data[5]);
152 if(preg_match('/[^a-z_\-0-9._]/i', $ico))
154 $ico ="";
156 if (strpos($ico, "-PREM")) {
157 $ico = explode("-PREM", $ico);
158 $icoimg = "<img src=\"".$livesitePath2."/premium/".$ico[0]."\" class='pic'/>";
159 } else {
160 $icoimg = "<img src=\"".$livesitePath2."/ico/".$ico."\" class='pic'/>";
164 include "include/header.php";
166 $inbox = new Message;
167 $uid = $inbox->GetID($_COOKIE['DMDM'],$id_mail_path);
171 <body>
172 <div class="well well-sm pad3">
174 <!-- navigation-->
175 <?php require 'include/nav.php'; ?>
176 <!-- end navigation-->
177 <?php
179 if(isset($_SESSION['msg'])){
180 echo $_SESSION['msg'];
181 $_SESSION['msg'] = '';
184 <!--<h3 class="form-signin-heading">Xe[^Xy[W</h3>-->
186 <a href="choose.php"><div class="ic panel panel-default pull-left"><?php echo $icoimg; ?></div></a><!-- ACR“NbNX -->
188 <!-- start tripcode -->
189 <div class="panel2 panel panel-default ">
190 <h5><strong>トリップ:</strong></h5>
191 <!-- tripcode -->
192 <div class="tripc input-group">
193 <span class="input-group-addon"><strong>#</strong></span>
194 <input type="text" class="form-control" name="trip" id="trip_c" value="<?php print $data[7];?>" />
195 <!-- <input type="text" class="form-control" value="B1VjUMK0na7D"/> -->
196 <span class="input-group-btn">
197 <button class="btn btn-default" type="submit" value="vZ" id="caltrip" />
198 <span class="glyphicon glyphicon-random"></span>
199 </button>
200 </span>
201 </div>
203 </div>
204 <!-- end tripcode!! -->
205 <div class="clearfix"></div>
206 <!-- start status -->
207 <div class="panel4 panel panel-default b ">
208 <strong>紹介文</strong>
209 <?php if(!$isforedit){
210 $hide="";
211 } else {
212 $hide="hide";
214 <form method="post">
215 <?php if(isset($echo)) echo "<span style=\"color:green\">$echo</span>"; ?>
216 <button name="isca" class="bottom btn btn-default pull-right btn-sm">
217 <span class="glyphicon glyphicon-remove"></span>
218 </button>
219 <button name="isub" class="bottom btn btn-default pull-right btn-sm">
220 <span class="glyphicon glyphicon-ok"></span>
221 </button>
222 <div class="clearfix"></div>
223 <textarea rows="4" id="input" name="info" class="textpanel form-control " maxlength="250"><?php echo $mystatus; ?></textarea>
224 </form>
226 <?php
230 <a href="<?php echo $_SERVER['PHP_SELF'] . '?e_=1'; ?>" class="<?php echo $hide; ?> bottom btn btn-default pull-right btn-sm">
231 <span class="glyphicon glyphicon-edit"></span>
232 </a>
233 <div class="clearfix"></div>
234 <div class="<?php echo (detect_device2($_SERVER['HTTP_USER_AGENT'])!="PLSDISPLAY") ? "unclick" : ""; ?> wordwrap_ panel panel-default scroll <?php echo $hide; ?>" > <?php echo $mystatus; ?></div>
236 </div>
237 <!-- end status -->
239 <div class="clearfix"></div>
241 <div class="panel3 panel panel-default txt ">
242 <?php
243 $points = file_get_contents("http://tpol27.nttec.com/melon.php?email=".$email);
244 // $points = file_get_contents("http://tpol27.nttec.com/melon.php?email=".strtolower("MiBgestalt@gmail.com"));
245 echo
246 "<h5><strong>Eメール:</strong> ".$data[1]."</h5>
247 <h5><strong>Beポイント:</strong><span class='badge'> ".$data[3]."</span></h5>
248 <h5><strong>メロンポイント:</strong><span class='badge'> ".$points."</span>
251 echo "&nbsp;&nbsp;&nbsp;<a href=\"convert.php\" target=\"_blank\">変換</a>";
252 if(detect_device2($_SERVER['HTTP_USER_AGENT']) == "PLSDISPLAY"){
253 echo "
254 &nbsp;&nbsp;&nbsp;<a href=\"transfer.php\" target=\"_blank\">送る</a>
255 &nbsp;&nbsp;&nbsp;<a href=\"http://alice-shop.myshopify.com/\" target=\"_blank\">買う</a>
256 &nbsp;&nbsp;&nbsp;<a href=\"http://alice-shop.myshopify.com/pages/melon-shop-guide\" target=\"_blank\">ガイド</a></h5>
257 <br><a href=\"http://alice-shop.myshopify.com/\">メロンショップ</a><br><br>
262 <h5>メロンポイントご利用履歴:</h5>
263 <div style="padding:5px;" class="<?php echo (detect_device2($_SERVER['HTTP_USER_AGENT'])!="PLSDISPLAY") ? "logs" : ""; ?> panel panel-default scroll ">
264 <?php
265 $u_log = file_get_contents("http://tpol27.nttec.com/z/user_log.php?usr=".$email);
266 echo trim($u_log);
268 </div>
269 <h4 class="text pull-right"> <a href="logout.php"><span class="label label-danger">ログアウト</span></a> </h4>
270 <h4 class="text pull-right"> <a href="change_pass.php"><span class="label label-primary">パスワード変更</span></a> </h4>
271 <div class="clearfix"></div>
272 </div>
274 </div>
276 <?php
277 require 'include/footer.php';