📄 wish.php
字号:
}
print "<a href=\"wish.php?pageno=1\">First</a>|<A href=\"wish.php?pageno=".$prevpage."\">Prev</a>|<a href=\"wish.php?pageno=".$nextpage."\">Next</a>|<A href=\"wish.php?pageno=".$totalpage."\">Last</a>";
print"</td><td>共".$mcount."笔|每页25笔</td></tr></table>";
if($mcount==0){
echo"<table><tr><td>暂无许愿";
print"</td></tr></table></body></html>";
exit;
}
print<<<eot
<table width="482" align="center" cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="387" valign="middle" align="center">
<table width="376" border="0" align="center" cellpadding="0" cellspacing="0" class="9p">
<tr>
<td colspan="3"><img src="images/club/img/st01.gif" width="376" height="76"></td>
</tr>
<tr>
<td width="41" height="172"><img src="images/club/img/st02.gif" width="41" height="180"></td>
<td width="294" height="172" background="images/club/img/st04.gif" valign="top">
eot;
$i=($pageno-1)*25;
while($i<$mcount&&$i<$pageno*25){
list($time,$name,$sex,$age,$type,$nation,$email,$msg,$hit,$date)=explode("|",$f[$i]);
print<<<eot
<a href="wish.php?action=detail&id=$time"
onmouseover="pop('来自<font color=yellow>$nation</font>今年<font color=yellow>$age</font>岁的<br><font color=yellow>$name</font><font color=red>$sex</font>许了一个愿...<br>有<font color=yellow>$hit</font>人看过','#ececec')" onmouseout=kill()>
eot;
if ($type==1){
$c_img="clove.gif";
}elseif ($type==2){
$c_img="cstudy.gif";
}elseif ($type==3){
$c_img="chealth.gif";
}elseif ($type==4){
$c_img="cfamily.gif";
}elseif ($type==5){
$c_img="cwork.gif";
}elseif ($type==6){
$c_img="cfuture.gif";
}elseif ($type==7){
$c_img="cwealth.gif";
}elseif ($type==8){
$c_img="clife.gif";
}
print"<img src='images/club/img/c/".$c_img."' width=\"48\" height=\"27\" border=\"0\"></a>";
$i++;
if($i%5==0){
echo"<br>";
}
}
print<<<eot
</td>
<td width="41" height="172"><img src="images/club/img/st03.gif" width="41" height="180"></td>
</tr>
</table>
</td>
<td width="95" align="center" valign="middle">
<table width="80" border="0" cellpadding="1" cellspacing="0" class="9p" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid">
<tr align="center">
<td colspan="2" bgcolor="#808080"><font color="#FFFFFF" face="Arial" size="1">KEY</font></td>
</tr>
<tr bgcolor="#ececec">
<td width="29">恋爱</td>
<td width="51"><font size="1" face="Arial">Love</font></td>
</tr>
<tr bgcolor="#ececec">
<td width="29">学业</td>
<td width="51"><font face="Arial" size="1">Study</font></td>
</tr>
<tr bgcolor="#ececec">
<td width="29">健康</td>
<td width="51"><font face="Arial" size="1">Health</font></td>
</tr>
<tr bgcolor="#ececec">
<td width="29">家庭</td>
<td width="51"><font size="1" face="Arial">Family</font></td>
</tr>
<tr bgcolor="#ececec">
<td width="29">事业</td>
<td width="51"><font face="Arial" size="1">Work</font></td>
</tr>
<tr bgcolor="#ececec">
<td width="29">将来</td>
<td width="51"><font face="Arial" size="1">Future</font></td>
</tr>
<tr bgcolor="#ececec">
<td width="29">财富</td>
<td width="51"><font face="Arial" size="1">Wealth</font></td>
</tr>
<tr bgcolor="#ececec">
<td width="29">生活</td>
<td width="51"><font face="Arial" size="1">Life</font></td>
</tr>
</table>
<p> </p></td>
</tr>
</table>
<br>
eot;
}
/*-------------列出愿望--------------*/
function detail(){
global $id;
printhead();
$f=file("data");
$mcount=count($f);
$i=0;
while($i<$mcount){//1
list($time,$name,$sex,$age,$type,$nation,$email,$msg,$hit,$date)=explode("|",$f[$i]);
if($time==$id){//2
if ($type==1){
$b_img="blove.gif";
}elseif ($type==2){
$b_img="bstudy.gif";
}elseif ($type==3){
$b_img="bhealth.gif";
}elseif ($type==4){
$b_img="bfamily.gif";
}elseif ($type==5){
$b_img="bwork.gif";
}elseif ($type==6){
$b_img="bfuture.gif";
}elseif ($type==7){
$b_img="bwealth.gif";
}elseif ($type==8){
$b_img="blife.gif";
}
print<<<eot
<p> </p>
<span style="width:100%;height:23;Filter:Shadow(color=#d9d9d9,direction=125)">
<table width="379" border="0" align="center" cellspacing="0" cellpadding="0" height="205" style="BORDER-RIGHT: #ceb068 1px solid; BORDER-TOP: #ceb068 1px solid; BORDER-LEFT: #ceb068 1px solid; BORDER-BOTTOM: #ceb068 1px solid" class="9p" >
<tr>
<td height="189" background="images/club/img/b/$b_img" valign="top"><font color=#a08034>
eot;
print $msg;
print<<<eot
</font>
</td>
</tr>
<tr>
<td align="right" height="10" background="images/club/img/b/$b_img">
eot;
print"<font color=#a08034>$age岁的 ";
if($email!=""){
print"<a href=\"mailto:".$email."\">".$name."</a>";
}
else print$name;
print<<<eot
$sex,来自$nation,于$date 留下此愿</font></td>
</tr>
</table></body></html>
eot;
}
$i++;}
$old=file("data");
$num=count($old);
$fp=fopen("data","w");
flock($fp,LOCK_EX);
for ($i=0;$i<$num;$i++){
list($time,$name,$sex,$age,$type,$nation,$email,$msg,$hit,$date)=explode("|",$old[$i]);
$hit++;
if($time==$id){ $newline=$time."|".$name."|".$sex."|".$age."|".$type."|".$nation."|".$email."|".$msg."|".$hit."|".$date;
fputs($fp,$newline);
}
else fputs($fp,$old[$i]);
}
fclose($fp);
}
/*------------------版权说明------------------*/
function about(){
printhead();
print<<<eot
<embed src="http://studentunion.w18.net/bbs/images/wish.mp3" hidden="true" autostart="true" loop="0">
<table width="520" border="0" align="center" class="shadow2">
<tr>
<td width="510" height="137" valign="top">
<b>歌曲名: 一千零一个愿望</b>
<br>作 曲 : 潘协庆 作 词 : 徐世珍 演唱 : 4 in love
<br>
<br>明天就像是盒子里的巧克力糖
<br>什么滋味 充满想象
<br>失望是偶尔拨不通的电话号码
<br>多试几次 总会回答
<br>心里有好多的梦想
<br>未来正要开始闪闪发亮
<br>就算天再高 那又怎样
<br>踮起脚尖 就更靠近阳光
<br>许下我第一千零一个愿望
<br>有一天幸福总会听我的话
<br>不怕要多少时间多少代价
<br>青春是我的筹码
<br>Oh~~我只有这一千零一个愿望
<br>有一天幸福总会在我手上
<br>每一颗心都有一双翅膀
<br>要勇往直前的飞翔
<br>没有到不了的地方
<br>
<br>
<a href="http://studentunion.w18.net/bbs/images/wish.mp3">点此处下载MP3</a>
</td>
</tr>
</table>
eot;
}
/*-----------------管理-------------*/
function admin(){
global $username,$manager,$login_status;
if($username!=$manager||$login_status==0){
print<<<eot
<html>
<head><title>出错信息</title>
</head>
<body><br><br>
<center><font style="font-size: 12px">你不是管理员</font> </center>
</body></html>
eot;
exit;
}
printhead();
$f=file("data");
$mcount=count($f);
print<<<eot
<center><br><br>
<table border="0" width="80%" bgcolor="#000000" cellspacing="1" style="font-size: 12px">
<tr>
<td width="17%" bgcolor="#FFCC66">名字</td>
<td width="76%" bgcolor="#FFCC66">许愿</td>
<td width="7%" bgcolor="#FFCC66">删除</td>
</tr>
eot;
$i=0;
while($i<$mcount){//1
list($time,$name,$sex,$age,$type,$nation,$email,$msg,$hit,$date)=explode("|",$f[$i]);
print<<<eot
<tr>
<td width="17%" bgcolor="#FFFFFF">
eot;
print $name;
print<<<eot
</td>
<td width="76%" bgcolor="#FFFFFF">
eot;
print $msg;
print<<<eot
</td>
<td width="7%" bgcolor="#FFFFFF"><A href="wish.php?action=showdel&id=$time">Del</a> </td>
</tr>
eot;
$i++;
}
print"</table></center>
</body></html>";
}
/*-------------删除确认-----------------*/
function showdel(){
global $id;
detail();
print<<<eot
<center>
<table border="0" width="50%"><form method="POST" action="wish.php?action=del">
<tr>
<td width="100%" algin=center>确定删除?<input type="hidden" name="id" value=$id><input type="submit" value="提交" name="B1" style="font-size: 12px"><input type="button" value="返回" name="B2" style="font-size: 12px" onclick="history.go(-1)"></p>
</td>
</tr></form>
</table>
</center></body></html>
eot;
}
function del(){
global $username,$manager,$login_status,$id;
if($username!=$manager||$login_status==0){
echo"你不是管理员;";
exit;
}//通过可以删除
$old=file("data");
$num=count($old);
$fp=fopen("data","w");
flock($fp,LOCK_EX);
for ($i=0;$i<$num;$i++){
list($time,$name,$sex,$age,$type,$nation,$email,$msg,$hit,$date)=explode("|",$old[$i]);
if($time!=$id){ fputs($fp,$old[$i]);}
}
fclose($fp);
printhead();
echo"<br><br><center><font style=\"font-size:12px\">删除完成</font><br><a href=\"wish.php?action=admin\">返回</a></center>\n</body></html>";
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -