2 if (!isset($_COOKIE['DMDM']) && !isset($_COOKIE['MDMD'])) {
3 header('location:index.php');
7 include('encrypt_artist.php');
9 $message = new Message;
10 $email = Decrypt($_COOKIE['DMDM'],KEY);
11 $userDataID = $message->GetID($_COOKIE['DMDM'], $id_mail_path);
13 $fdir = substr($email, 0, 1);
14 $sdir = substr($email, 1, 1);
15 if (file_exists(UDB_PATH."$fdir/$sdir/$email/usrimg.log")) {
16 $userbp = @file(UDB_PATH."$fdir/$sdir/$email/usrimg.log");
22 if(detect_device2($_SERVER['HTTP_USER_AGENT']) != "PLSDISPLAY"){
23 $hide = "display:none;";
28 if(isset($_GET['pay'])){
29 $premiumList = file(ADBD_PATH."/imglist.log");
30 $stat = $message->within_str($premiumList[$_GET['pay']], "<stat>", "</stat>");
32 if(isset($premiumList[$_GET['pay']])){
34 $buyerID = trim($message->GetID($_COOKIE['DMDM'],$id_mail_path));
36 $id = $message->within_str($premiumList[$_GET['pay']], "<id>", "</id>");
37 $name = $message->within_str($premiumList[$_GET['pay']], "<name>", "</name>");;
38 $price = $message->within_str($premiumList[$_GET['pay']], "<price>", "</price>");;
39 $writeData = "<time>{$time}</time><uid>{$userDataID}</uid><id>{$id}</id><name>{$name}</name><price>{$price}</price>\n";
40 $filename = ADBD_PATH."/transaction.log";
41 $points = file_get_contents("http://tpol27.nttec.com/dev/melon.php?conv=".$price."&usr=".$email."&ip=".$_SERVER['REMOTE_ADDR']."&trans=premium&puid=".$buyerID);
44 if (!file_exists($filename)) {
45 if(!file_put_contents($filename,$writeData)) {
50 $handle = fopen($filename, "a");
51 if(!fwrite($handle, $writeData)) {
57 $_SESSION['msg'] = '<div class="alert alert-success"><button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>You\'re new avatar is updated!</div>';
62 if(preg_match('/[^a-z_\-0-9._]/i', $ico)){
66 $type = Array(1 => 'gif'); //store all the image extension types in array
67 $ext = explode(".",$ico); //explode and find value after dot
69 if (strlen($ext[0]) <= 0 ) $ico = "nida.gif";
70 if(!(in_array($ext[1],$type))) //check image extension not in the array $type
76 $fdir = substr($email, 0, 1);
77 $sdir = substr($email, 1, 1);
78 $userData = file(DB_PATH."$fdir/$sdir/$email");
80 for ($i=0; $i < count($userData); $i++) {
81 $userData[$i] = trim($userData[$i]);
84 $userData[5] = $ico."-PREM";
85 $writeData = implode("\n",$userData);
86 $_SESSION['msg'] = '<div class="alert alert-success"><button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>You\'re new avatar is updated!</div>';
88 $fdir = substr($email, 0, 1);
89 $sdir = substr($email, 1, 1);
90 $udb_path = UDB_PATH."{$fdir}/{$sdir}/{$email}";
92 if(!is_dir($udb_path)){
93 @mkdir(UDB_PATH."{$fdir}");
94 @mkdir(UDB_PATH."{$fdir}/{$sdir}");
95 @mkdir(UDB_PATH."{$fdir}/{$sdir}/{$email}");
97 $insertUsr = '<time>'.time().'</time><filename>'.$userData[5].'</filename><aid>'.$id.'</aid>'.PHP_EOL;
99 if(!file_exists($udb_path."/usrimg.log")){
100 file_put_contents($udb_path."/usrimg.log",$insertUsr);
102 $handle = fopen($udb_path."/usrimg.log", "a");
103 if(!fwrite($handle, $insertUsr)) {
104 $writeSuccess = false;
107 $writeSuccess = true;
110 file_put_contents(DB_PATH."$fdir/$sdir/$email", $writeData);
111 header('location:status.php');
115 $_SESSION['msg'] = '<div class="alert alert-danger"><button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>Not enough points</div>';
116 header("Location: status.php");
122 $_SESSION['msg'] = '<div class="alert alert-danger"><button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>Doesn\'t Exist</div>';
123 header("Location: status.php");
131 <meta charset="UTF-8">
132 <meta http-equiv="X-UA-Compatible" content="IE=edge">
133 <meta name="viewport" content="width=device-width, initial-scale=1">
134 <link rel="stylesheet" href="css/bootstrap.css">
135 <link rel="stylesheet" href="css/astyle.css">
139 <div class="container body">
141 <div class="col-md-12">
143 <!-- <button class="btn btn-lg btn-default">FREE</button>
144 <button class="btn btn-lg btn-primary">PAID</button> -->
145 <a href="choose.php" class="btn btn-lg btn-default" style="<?php echo $hide; ?>">フリー</a>
146 <a href="choose.php?pr" class="btn btn-lg btn-primary" style="<?php echo $hide; ?>">有給の</a>
147 <a href="choose.php?b" class="btn btn-lg btn-primary" style="<?php echo $hide; ?>">買った</a>
149 if(isset($_GET['pr'])){
150 echo "<h3 style=\"$hide\">有料のアバター</h3>";
151 } elseif (isset($_GET['b'])) {
152 echo "<h3 style=\"$hide\">アバターは買った</h3>";
154 echo "<h3 style=\"$hide\">無料アバター</h3>";
160 #echo $livesitePath2;
162 if (!isset($_GET['pr']) && !isset($_GET['b'])) {
163 $ico = file('ico.txt');
167 $p = (isset($_GET['p'])&&is_numeric($_GET['p']))?($_GET['p']*20):20;
168 $s = (isset($_GET['p'])&&is_numeric($_GET['p']))?$p-20:0;
169 print "<div style=\"margin-top:100px\">";
170 for ($i=$s; $i < $p; $i++)
172 echo "<a href=\"status.php?ico=".$ico[$i]."\"><img src=\"".$livesitePath2."/ico/".$ico[$i]."\" height=\"30\" style=\"margin:5px;\"></a>";
174 print "<div style=\"max-width:500px;margin-top:30px;text-align:center\">";
175 for($t=1;$t<=$c;$t++)
176 print "<a href=\"choose.php?p=$t\" style=\"margin:5px;padding:5px;display:inline-block\">$t</a>";
179 } elseif(isset($_GET['pr'])) {
181 if(detect_device2($_SERVER['HTTP_USER_AGENT']) != "PLSDISPLAY") {
186 <div class="body showcase">
187 <div style="margin-left:5%;">
189 $points = file_get_contents("http://tpol27.nttec.com/melon.php?email=".$email);
190 echo "<h1>メロンポイント: {$points}</h1>";
192 if (!file_exists(ADBD_PATH."/imglist.log")) {
193 echo "<center><h3>No Available Avatars At The Moment</h3></center>";
197 $file = file(ADBD_PATH."/imglist.log");
198 if(count($file) < 1){
199 echo "<center><h3>No Available Avatars At The Moment</h3></center>";
205 // $fdir = substr($email, 0, 1);
206 // $sdir = substr($email, 1, 1);
207 // $usrPath = UDB_PATH."{$fdir}/{$sdir}/{$email}/";
208 // if(file_exists($usrPath."usrimg.log")){
209 // $usrList = file($usrPath."usrimg.log");
210 // $usrListBreaker = TRUE;
213 echo '<div id="shuffle">';
214 foreach ($file as $key => $value) {
216 if(!$message->within_str($value, "<stat>", "</stat>")){
219 $ngaun = $message->within_str(trim($value), "<name>", "</name>");
220 /*echo $ngaun."<br>";
223 if (isset($userbp)) {
224 foreach ($userbp as $key2 => $value2) {
225 $noon = within_str(trim($value2),"<filename>","</filename>");
226 $noon = explode(".gif", $noon);
227 /*echo "--".$noon[0]."--";
229 if (trim($noon[0]) == trim($ngaun)) {
232 $disabled = "disabled";
236 //<time>1413275692</time><filename>3906600.gif-PREM</filename><aid>87532632</aid>
237 //<id>40689640</id><name>6812020</name><price>50</price><stat>deleted</stat>
239 // if($usrListBreaker){
240 // if(count($usrList)>0){
241 // foreach ($usrList as $key2 => $value2) {
242 // if($message->within_str($value2, "<filename>", "</filename>")==$message->within_str($value, "<name>", "</name>") .'.gif-PREM'){
244 // $btn = '<button class="btn btn-success" disabled data-toggle="modal">BOUGHT</button>';
245 // $modalBreaker = FALSE;
247 // $btn = '<button class="btn btn-success" data-toggle="modal" data-target="#'.$message->within_str($value, "<name>", "</name>") .'">BUY</button>';
248 // $modalBreaker = TRUE;
252 // $modalBreaker = TRUE;
253 // $btn = '<button class="btn btn-success" data-toggle="modal" data-target="#'.$message->within_str($value, "<name>", "</name>") .'">BUY</button>';
257 // $modalBreaker = TRUE;
258 $btn = '<button class="btn btn-success" data-toggle="modal" data-target="#'.$message->within_str($value, "<name>", "</name>") .'"'.$disabled.'>BUY</button>';
261 echo '<div class="panel panel-default art">
262 <a class="thumbnail">
263 <img src="'.$livesitePath.'dev-test/premium/'.$message->within_str($value, "<name>", "</name>") .'.gif" style="width:80px; height:80px;" alt="">
266 <span>'.$message->within_str($value, "<price>", "</price>").' MP</span><br><br>
270 <div class="clearfix"></div>
273 // if($modalBreaker){
275 echo "<div id='".$message->within_str($value, "<name>", "</name>") ."' class='modal fade' tabindex='-1' role='dialog' aria-labelledby='buy' aria-hidden='true'>
276 <div class='modal-dialog'>
277 <div class='modal-content'>
278 <div class='modal-header'>
279 <button type='button' class='close' data-dismiss='modal'>
280 <span aria-hidden='true'>×</span><span class='sr-only'>Close</span>
282 <h3>これと同様にあなたがあなたの新しいBEアバターなるにはするか? </h3>
284 <div class='modal-body'>
285 これは価値がある ".$message->within_str($value, "<price>", "</price>")." メロンポイント
287 <div class='modal-footer'>
288 <a href='choose.php?pay=".$premiumBreaker."' onclick class='btn btn-success chooseModal'>購入</a>
297 if (!isset($nonasd)) {
298 echo "<center><h3>ご利用いただけませんアバター</h3></center>";
304 <?php }elseif(isset($_GET['b'])){ ?>
305 <div class="body showcase sizecontrol">
306 <div style="margin-left:5%;">
308 $fdir = substr($email, 0, 1);
309 $sdir = substr($email, 1, 1);
310 $usrPath = UDB_PATH."{$fdir}/{$sdir}/{$email}/";
312 if(file_exists($usrPath."usrimg.log")){
313 $usrList = file($usrPath."usrimg.log");
314 foreach ($usrList as $key => $value) {
315 $loopedImg = explode("-", $message->within_str($value, "<filename>", "</filename>"));
316 echo '<div class="panel panel-default art">
317 <a href="status.php?bico='.$loopedImg[0].'" class="thumbnail">
318 <img src="'.$livesitePath.'dev-test/premium/'.$loopedImg[0].'" style="width:80px; height:80px;" alt="">
321 <span>'.$message->within_str($value, "<aid>", "</aid>").'</span><br><br>
323 <div class="clearfix"></div>
339 <script src="js/jquery-1.9.1.js"></script>
340 <script src="js/bootstrap.js"></script>
344 $.fn.shuffle = function() {
346 var allElems = this.get(),
347 getRandom = function(max) {
348 return Math.floor(Math.random() * max);
350 shuffled = $.map(allElems, function(){
351 var random = getRandom(allElems.length),
352 randEl = $(allElems[random]).clone(true)[0];
353 allElems.splice(random, 1);
357 this.each(function(i){
358 $(this).replaceWith($(shuffled[i]));
367 $(document).ready(function(){
368 $("a.chooseModal").one("click", function() {
369 $(this).click(function () { return false; });
371 <?php if(isset($_GET['pr'])){ ?>