📄 action.php
字号:
<?php
require("global.php");
$cookie = $_REQUEST[tempequip];
$facenum=100;
$fee=0.1;
if ($login_status==0) {
require("header.php");echo"$headertp";
headguide("您现在正处在 $bbs_title","","ACTION程序中");
msg_box('ACTION程序','<br>状态:发生错误,您还没有登录<br><ul><li><a href="javascript:history.back(1)">返回前页</a></li><br><li><a href="login.php">现在登录</li></ul>');
require("footer.php");echo"$footertp";
exit;
}
$userin=explode("|",readfromfile("$userpath/$username.php"));
if ($action==buy)
{
if(!file_exists("userdata/xuni/$username.php"))
writetofile("userdata/xuni/$username.php","");
$face_index=file("userdata/xuni/$username.php");
$count=count($face_index);
if($count>$facenum){
require("header.php");echo"$headertp";
headguide("您现在正处在 $bbs_title<br>购买虚拟形象中心","<a href='club.php'>俱乐部</a>","<a href='facepic.php'>购买虚拟形象</a>");
msg_box('虚拟形象',"<br>状态:发生错误,你的衣柜里面衣服的数量已经达到最大值{$facenum}个,如果你还要继续购买请你删除你衣柜里面不喜欢的衣服!<br><ul><li><a href=\"javascript:history.back(1)\">返回前页</a></li><br><li><a href=facedata.php>到我的衣柜</li></ul>");
require("footer.php");echo"$footertp";
exit;
}
$txt=file("userdata/xuni/yifu.dat");
$indext=count($txt);
for($i=0;$i<$indext;$i++){
$detail=explode("|",$txt[$i]);
$buydetail="<?die;?>|$username|$detail[2]|$detail[1]|$filename|$detail[6]|$detail[5]|1|0|$timestamp|$detail[3]|||\n";
if($detail[0]==$id)
break;
}
if ($userin[24]<$detail[3])
{
require("header.php");echo"$headertp";
headguide("您现在正处在 $bbs_title<br>购买虚拟形象中心","<a href='club.php'>俱乐部</a>","<a href='facepic.php'>购买虚拟形象</a>");
msg_box('虚拟形象',"<br>状态:发生错误,您的金钱不足<br><ul><li><a href=\"javascript:history.back(1)\">返回前页</a></li><br><li><a href=index.php>回到首页</li></ul>");
require("footer.php");echo"$footertp";
exit;
}
else
{ if($count!=0){
for($i=0;$i<$count;$i++){
$face_yiyou=explode("|",$face_index[$i]);
if($face_yiyou[3]==$detail[1] && $face_yiyou[4]==$filename){
require("header.php");echo"$headertp";
headguide("您现在正处在 $bbs_title<br>购买虚拟形象中心","<a href='club.php'>俱乐部</a>","<a href='facepic.php'>购买虚拟形象</a>");
msg_box('虚拟形象',"<br>状态:发生错误,你已经拥有此商品,如果你还要继续购买请先赠送你衣柜里面的那件衣服!<br><ul><li><a href=\"javascript:history.back(1)\">返回前页</a></li><br><li><a href=facedata.php>到我的衣柜</li></ul>");
require("footer.php");echo"$footertp";
exit;
}
}
}
$fr=fopen("userdata/xuni/$username.php","a");
fwrite($fr,$buydetail);
fclose($fr);
dtchange($username,0,0,-$detail[3]);
jump_page("facepic.php",'恭喜您,已经成功购买了'.$detail[2].'你可以到衣柜中穿上');
}
}
if ($action== "delface" )
{
$txt=file("userdata/xuni/$username.php");
$indext=count($txt);
for($i=0;$i<$indext;$i++)
{//0
$detail=explode("|",$txt[$i]);
if ($detail[3]==$classid && $detail[4]==$id)
{//2
$detail[8]=0;
$txt[$i]=implode("|",$detail);
$article=implode("",$txt);
$f = fopen("userdata/xuni/$username.php","w");
fputs($f,$article);
jump_page("facedata.php",'感谢您使用由流星提供的'.$bbs_title.'虚拟形象。形象成功脱下!');
}//2
}//0
jump_page("facedata.php",'非常抱歉,你没有这件形象!请核对后再来');
}
if ($action== "saveallface" )
{//8
$nr=0;
$userin=get_user_info($username);
$gender=$userin[20];
$wwww=$userin[16]/10;
if ($gender == 1)
$sex1= "m";
if($gender == 2)
$sex1= "f";
$cookiearray = split('-', $cookie);
$c_num = count($cookiearray);
$sex2 = $gender;
if ($sex2 == '1')
{
$d_sex = 'init';
}
elseif($sex2 == '2')
{
$d_sex = 'initf';
}
else
{
require("header.php");echo"$headertp";
headguide("您现在正处在 $bbs_title<br>虚拟形象中心","<a href='club.php'>俱乐部</a>","<a href='facepic.php'>虚拟形象</a>");
msg_box('虚拟形象','<br>状态:发生错误,您还没有选择性别<br><ul><li><a href="javascript:history.back(1)">返回前页</a></li><br><li><a href="profile.php">现在修改您的性别</li></ul>');
require("footer.php");echo"$footertp";
exit;
}
$txt=file("userdata/xuni/$username.php");
$indext=count($txt);
for($i=0;$i<$indext;$i++)
{//0
$detail=explode("|",$txt[$i]);
if ($detail[8]==1)
{//2
$detail[8]=0;
$txt[$i]=implode("|",$detail);
$article=implode("",$txt);
$f = fopen("userdata/xuni/$username.php","w");
fputs($f,$article);
}//2
}//0
for ($i = 0; $i < 26; $i++)
{//7
if(($cookiearray[$i] != '0') and ($cookiearray[$i] != $d_sex))
{//6
$pic = $cookiearray[$i].".gif";
for($j=0;$j<$indext;$j++)
{//0
$detail=explode("|",$txt[$j]);
if ($detail[3]==$i && $detail[4]==$cookiearray[$i] && ($detail[5]==$sex1 || $detail[5]==t) && $detail[8]!=3 && $detail[8]!=4)
{$nr++;
$detail[8]=1;
$txt[$j]=implode("|",$detail);
$article=implode("",$txt);
$f = fopen("userdata/xuni/$username.php","w");
fputs($f,$article);
fclose($f);
break;
}
}//0
}//6
}//7
if($nr==0)
{require("header.php");echo"$headertp";
headguide("您现在正处在 $bbs_title<br>购买虚拟形象中心","<a href='club.php'>俱乐部</a>","<a href='facepic.php'>购买虚拟形象</a>");
msg_box('虚拟形象',"<br>状态:发生错误,你没有购买这个商品,请先购买!<br><ul><li><a href=\"javascript:history.back(1)\">返回前页</a></li><br><li><a href=facedata.php>到我的衣柜</li></ul>");
require("footer.php");echo"$footertp";
exit;
}
jump_page("facedata.php",'感谢您使用由流星提供的'.$bbs_title.'虚拟形象。形象修改成功!');
}//8
if ($action=="delbuyface")
{
$txt=file("userdata/xuni/$username.php");
$indext=count($txt);
for($i=0;$i<$indext;$i++)
{//0
$detail=explode("|",$txt[$i]);
if ($detail[3]==$classid && $detail[4]==$id)
{//2
$detail[8]=3;
$txt[$i]=implode("|",$detail);
$article=implode("",$txt);
$f = fopen("userdata/xuni/$username.php","w");
fputs($f,$article);
jump_page("facedata.php",'感谢您使用由流星提供的'.$bbs_title.'虚拟形象。形象成功放入破衣篓!');
}//2
}//0
jump_page("facedata.php",'非常抱歉,你没有这件形象!请核对后再来');
}
if ($action==ifxuni)
{
$userin[32]=$setface;
$uu=implode('|',$userin);
writetofile("$userpath/$username.php",$uu);
jump_page("facepic.php?facejob=select",'感谢您使用由流星提供的'.$bbs_title.'虚拟形象。虚拟形象设置成功');
}
if ($action==send)
{
$txt=file("userdata/xuni/$username.php");
$indext=count($txt);
if(file_exists("userdata/xuni/$sendname.php"))
{
$txtsend=file("userdata/xuni/$sendname.php");
$indexsend=count($txtsend);
for($i=0;$i<$indexsend;$i++)
{//0
$detailsend=explode("|",$txtsend[$i]);
if($detailsend[3]==$faceclass && $detailsend[4]==$faceid)
{
require("header.php");echo"$headertp";
headguide("您现在正处在 $bbs_title<br>购买虚拟形象中心","<a href='club.php'>俱乐部</a>","<a href='facepic.php'>购买虚拟形象</a>");
msg_box('虚拟形象',"<br>状态:发生错误,对方已经拥有此商品,请你换另一个商品赠送。!<br><ul><li><a href=\"javascript:history.back(1)\">返回前页</a></li><br><li><a href=facedata.php>到我的衣柜</li></ul>");
require("footer.php");echo"$footertp";
exit;
}
}//0
}
if(!file_exists("$userpath/$sendname.php"))
{//9
require("header.php");echo"$headertp";
headguide("您现在正处在 $bbs_title<br>购买虚拟形象中心","<a href='club.php'>俱乐部</a>","<a href='facepic.php'>购买虚拟形象</a>");
msg_box('虚拟形象',"<br>状态:发生错误,论坛无此用户名,请核对再送。!<br><ul><li><a href=\"javascript:history.back(1)\">返回前页</a></li><br><li><a href=facedata.php>到我的衣柜</li></ul>");
require("footer.php");echo"$footertp";
exit;
}//9
for($i=0;$i<$indext;$i++)
{//0
$detail=explode("|",$txt[$i]);
if ($detail[3]==$faceclass && $detail[4]==$faceid && $detail[8]==0)
{//2
$face_weardate = floor($detail[6]/10 - (time() - $detail[9])/86400);
$wearleft=floor($detail[6]/20);
if($face_weardate<$wearleft)
{
require("header.php");echo"$headertp";
headguide("您现在正处在 $bbs_title<br>购买虚拟形象中心","<a href='club.php'>俱乐部</a>","<a href='facepic.php'>购买虚拟形象</a>");
msg_box('虚拟形象',"<br>状态:发生错误,你赠送的商品太旧了,破旧值不能大于一半的 ^_^ 请先充值<br><ul><li><a href=\"javascript:history.back(1)\">返回前页</a></li><br><li><a href=facedata.php>到我的衣柜</li></ul>");
require("footer.php");echo"$footertp";
exit;
}
$detail[1]=$sendname;
$detail[11]=$username;
$sendxuni=implode("|",$detail);
$fp=fopen("userdata/xuni/$sendname.php","a");
fwrite($fp,$sendxuni);
fclose($fp);
unset($txt[$i]);
$txt=implode("",$txt);
$f=fopen("userdata/xuni/$username.php","w");
fputs($f,$txt);
fclose($f);
if (file_exists("userdata/$msgpath/{$sendname}1.php"))
{$msg=file("userdata/$msgpath/{$sendname}1.php");}
else
{$msg[0]="";}
$old=implode("",$msg);
$content="$username 将 $detail[2],赠送给你,并对你说:$say";
$new="<?die;?>|系统信息|有人给你送FTB秀啦|$timestamp|$content|\n";
writetofile("userdata/$msgpath/{$sendname}1.php",$new.$old);
jump_page("facedata.php",'感谢您使用由流星提供的'.$bbs_title.'虚拟形象。虚拟形象赠送成功!');
}//2
}//0
require("header.php");echo"$headertp";
headguide("您现在正处在 $bbs_title<br>购买虚拟形象中心","<a href='club.php'>俱乐部</a>","<a href='facepic.php'>购买虚拟形象</a>");
msg_box('虚拟形象',"<br>状态:发生错误,你没有购买这个商品,请先购买!或是此商品你真穿着呢 !怎么可以送人呢^_^<br><ul><li><a href=\"javascript:history.back(1)\">返回前页</a></li><br><li><a href=facedata.php>到我的衣柜</li></ul>");
require("footer.php");echo"$footertp";
exit;
}
if ($action==chongzhi)
{
$txt=file("userdata/xuni/$username.php");
$indext=count($txt);
for($i=0;$i<$indext;$i++)
{//0
$detail=explode("|",$txt[$i]);
if ($detail[3]==$classid && $detail[4]==$id && $detail[8]==3)
{//2
if($userin[24]>=$detail[10])
{$detail[8]=0;
$detail[9]=$timestamp;
$czmoney=floor($detail[10]*$fee);
dtchange($username,0,0,-$czmoney);
}
else
{
require("header.php");echo"$headertp";
headguide("您现在正处在{$bbs_title}<br>购买虚拟形象中心","<a href='club.php'>俱乐部</a>","<a href='facepic.php'>购买虚拟形象</a>");
msg_box('虚拟形象',"<br>状态:发生错误,不是吧!你没钱修装备!快去赚钱吧!<br><ul><li><a href=\"javascript:history.back(1)\">返回前页</a></li><br><li><a href=facedata.php>到我的衣柜</li></ul>");
require("footer.php");echo"$footertp";
exit;
}
$txt[$i]=implode("|",$detail);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -