<!--#include file="conn/conn.asp"-->
<!--#include file="conn/nosql.asp"-->
<!--#include file="conn/page.asp"-->
<link href="/css.css" REL="stylesheet" TYPE="text/css">
<%
act=nosql(request("act"))
if act="use" then
id=nosql(request("id"))
bbsid=nosql(request("bbsid"))
bbsok=nosql(request("bbsok"))
if session("id")="" then
			   response.write "<script language='javascript'>"
                    response.write "alert('对不起，请登录后再访问本页！');"
                    response.write"javascript:history.go(-1)</SCRIPT>"
			        response.End()
end if
Set daoju= Server.CreateObject("ADODB.Recordset") 
daoju.open "select * from snsn_huadj where id="&id&" and userid="&session("id")&" and djnum>0" ,conn,1,3		
if not daoju.eof then
if (daoju("djname")="唯我独尊" or daoju("djname")="一本万利" or daoju("djname")="醒目红灯") and bbsok<>"ok"  then
Set hua= Server.CreateObject("ADODB.Recordset") 
hua.open "select  * from snsn_bbs where username='"&session("user")&"' and replyid=0 order by id desc",conn,1,3
if hua.eof then
response.write "<script language='javascript'>"
response.write "alert('您尚未发贴等发贴后再使用此道具！');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.End()
else
%>
<form name="form1" method="post" action="?act=use&bbsok=ok&id=<%=id%>">
<div align="center" ><br>
请选择此道具应用于那篇贴子？<br><br>
  <select name="bbsid"> 
  <%do while not hua.eof%>
    <option value="<%=hua("id")%>"><%=left(hua("title"),80)%></option>
	<%hua.movenext
	loop%>
  </select><br><br>
  <input type="Submit" name="Submit" value="选定" class="go-wenbenkuang">&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" name="button1" value="取消" class="go-wenbenkuang" onclick="javascript:location.href='daoju.asp'">
</div></form>
<%
response.end
end if
end if
if bbsid<>"" then
Set bbs= Server.CreateObject("ADODB.Recordset") 
bbs.open "select * from snsn_bbs where username='"&session("user")&"' and id="&bbsid,conn,1,3
end if

'疯狂肥料
if daoju("djname")="疯狂肥料" then
Set hua= Server.CreateObject("ADODB.Recordset") 
hua.open "select * from snsn_hua where userid="&session("id"),conn,1,3
Randomize 
daojua1=int(Rnd*8+1)
hua("yg")=hua("yg")+daojua1
Randomize 
daojua2=int(Rnd*8+1)
hua("yy")=hua("yy")+daojua2
Randomize 
daojua3=int(Rnd*8+1)
hua("ax")=hua("ax")+daojua3
Randomize 
daojua4=int(Rnd*8+1)
hua("yl")=hua("yl")+daojua4
hua.update
dhs="daojua"
end if					
'end 疯狂肥料


'唯我独尊
if daoju("djname")="唯我独尊" then
if bbs.eof then
response.write "<script language='javascript'>"
response.write "alert('您尚未发贴等发贴后再使用此道具！');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.End()
else
if bbs("gd")=1 then
response.write "<script language='javascript'>"
response.write "alert('出错!!!\n您发的["&bbs("title")&"]正在置顶！');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.End()
end if
bbs("gd")=1
bbs("gddate")=now()
bbs.update
dhs="daojub"
end if
end if					
'end 唯我独尊

'一本万利
if daoju("djname")="一本万利" then
if bbs.eof then
response.write "<script language='javascript'>"
response.write "alert('您尚未发贴等发贴后再使用此道具！');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.End()
else
if isnull(bbs("gm")) or len(bbs("gm"))=0 then
tempgma="0|0"
else
tempgma=bbs("gm")
end if
tempgm=split(tempgma,"|") 
if tempgm(0)="1"  then
response.write "<script language='javascript'>"
response.write "alert('使用失败!!!\n您发的贴子已经被设为购买查看了！');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.End()
end if
tempgm(0)="1"
tempgmb=""
for i=0 to ubound(tempgm) 
tempgmb=tempgmb&tempgm(i)
if i<ubound(tempgm) then
tempgmb=tempgmb&"|"
end if
next
bbs("gm")=tempgmb
bbs.update
dhs="daojuc"
end if
end if					
'end 一本万利


'醒目红灯
if daoju("djname")="醒目红灯" then
if bbs.eof then
response.write "<script language='javascript'>"
response.write "alert('您尚未发贴等发贴后再使用此道具！');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.End()
else
if len(bbs("title"))>65 or instr(bbs("title"),"<font color=red>")>0then
response.write "<script language='javascript'>"
response.write "alert('使用失败-原因：\n1您发的贴子已经使用了[醒目红灯]！\n2您发的贴子标题过长,请不要大于65个字符');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.End()
end if
temptitle=bbs("title")
bbs("title")="<font color=red>"&bbs("title")&"</font>"
bbs.update
dhs="daojud"
end if
end if					
'end 醒目红灯

'结婚戒指
if daoju("djname")="结婚戒指" then
Set hua= Server.CreateObject("ADODB.Recordset") 
hua.open "select * from snsn_user where id="&session("id"),conn,1,3
if isnull(hua("jhjiezhi")) or hua("jhjiezhi")="" then
hua("jhjiezhi")=1
else
hua("jhjiezhi")=hua("jhjiezhi")+1
end if
hua.update
dhs="daojue"
end if					
'end 结婚戒指

if len(dhs)>0 then
daoju("djnum")=daoju("djnum")-1
daoju.update
if daoju("djnum")=0 then
daoju.delete
end if
end if

					response.write "<script language='javascript'>"
					if dhs="daojua" then
					response.write "alert('使用疯狂肥料成功!!!\n您的花藤:阳光+"&daojua1&",爱心+"&daojua3&",雨露+"&daojua4&",营养+"&daojua2&"!!!');"
					elseif dhs="daojub"  then
					response.write "alert('您的贴子被置顶了!!!\n名称："&bbs("title")&"');"		
					elseif dhs="daojuc"  then
					response.write "alert('您的贴子内容被隐藏并设成购买查看!!!\n标题："&bbs("title")&"');"
					elseif dhs="daojud"  then
					response.write "alert('您的贴子的标题变成了红色!!!\n标题："&temptitle&"');"
					elseif dhs="daojue"  then
					response.write "alert('您的获得了一枚结婚戒指，可以向心爱的人求婚了');"
					else
					response.write "alert('使用成功！');"
					end if
	                response.write"location.href='daoju.asp'</SCRIPT>"
			        response.End()			
					else
					response.write "<script language='javascript'>"
                    response.write "alert('此物品的使用次数已经用完，请返回！');"
                    response.write"javascript:history.go(-1)</SCRIPT>"
			        response.End()
				    end if					
					
					end if

%>


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>我的道具</title>

<style type="text/css">
<!--
.helptext{
	COLOR: #9E0B0E;
	font-weight: bold;
}
.style1 {
	color:#ff6600;
	
}
.tm {
	filter: Alpha(Opacity=95, FinishOpacity=50, Style=1, StartX=75, StartY=35, FinishX=150, FinishY=100);
}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head>

<body>

<%
if session("id")="" then
			   response.write "<script language='javascript'>"
                    response.write "alert('对不起，请登录后再访问本页！');"
                    response.write"javascript:history.go(-1)</SCRIPT>"
			        response.End()
end if
Set tempgz= Server.CreateObject("ADODB.Recordset") 
tempgz.open "select * from snsn_hua where userid="&session("id"),conn,1,3
if not tempgz.eof then
tempgzok=split(tempgz("guoziok"),"|")
else
tempgzok=split("0|0|0|0|0","|")
end if
%><table width="643"  border="0" cellpadding="0" cellspacing="0" background="/web/1/img/i_t_m.gif">
    </tr>
	  <tr bgcolor="#FFFFFF" ><td height=27 colspan="2" background="/web/1/img/i_t_t.gif"><font color="#BD3952">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>我的道具</b></font></td>
  </tr>
      <tr>
        <td width="23%" align="center" valign="middle"><table width="100%"  border="0" cellspacing="0" cellpadding="0" height=5>
  <tr>
    <td></td>
  </tr>
</table>

<table width="111" height="160"  border="0" cellpadding="0" cellspacing="0" background="/web/1/img/i_t_0.gif">
            <tr>
              <td height="24" align="center" valign="bottom"><img src="/web/1/img/i_icon.gif" width="13" height="15">我的人参果
              </td>
            </tr>
            <tr><td height="1" background="/web/1/img/line.gif"></td></tr>
		    <tr>
              <td height="25" align="left" valign="middle">&nbsp;<img src="/web/1/img/sguo_01.gif" width="24" height="24" align="absmiddle"> 一级 ： <span class="style1"><%=tempgzok(0)%></span></td>
            </tr>
		       <tr><td height="1" background="/web/1/img/line.gif"></td></tr>
            <tr>
              <td height="25" align="left" valign="middle">&nbsp;<img src="/web/1/img/sguo_02.gif" width="24" height="24" align="absmiddle"> 二级 ： <span class="style1"><%=tempgzok(1)%></span></td>
            </tr>
		       <tr><td height="1" background="/web/1/img/line.gif"></td></tr>
            <tr>
              <td height="25" align="left" valign="middle">&nbsp;<img src="/web/1/img/sguo_03.gif" width="24" height="24" align="absmiddle"> 三级 ： <span class="style1"><%=tempgzok(2)%></span></td>
            </tr>
		       <tr><td height="1" background="/web/1/img/line.gif"></td></tr>
            <tr>
              <td height="25" align="left" valign="middle">&nbsp;<img src="/web/1/img/sguo_04.gif" width="24" height="24" align="absmiddle"> 四级 ：  <span class="style1"><%=tempgzok(3)%></span></td>
            </tr>
		       <tr><td height="1" background="/web/1/img/line.gif"></td></tr>
            <tr>
              <td align="left" valign="middle">&nbsp;<img src="/web/1/img/sguo_05.gif" width="24" height="24" align="absmiddle"> 五级 ： <span class="style1"><%=tempgzok(4)%></span></td>
            </tr>
		      <tr><td height="6" ></td></tr>
          </table>
          <table width="100%" height="10"  border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td></td>
  </tr>
</table>

            <table width="111" height="170"  border="0" cellpadding="0" cellspacing="7" background="/web/1/img/i_t_1.gif">
        <tr>
          <td height="20"><img src="/web/1/img/i_icon.gif" width="13" height="15" hspace="5" vspace="3" align="absmiddle"> 兑换规则</td>
        </tr>
        <tr>
          <td valign="top" style="text-indent: -12px;padding-left: 12px;">1.拥有人参果方可兑换道具<br>
              <hr align="center" width="100%" size="0" noshade style="border-bottom-width: 1px;border-bottom-style: dashed;border-bottom-color: #FF9933;">
              2.一个人参果只能兑换一个同级别道具!</td>
        </tr>
    </table>
      <table width="100%" height="20"  border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td></td>
  </tr>
</table>
    
               <a href="javascript:;" onClick="window.open('/minishow/gmhua.asp?l=6','daoju1')"><img src="/web/1/img/i_bt_02.gif" width="111" height="25" border="0"></a>            </td>
        <td width="77%" align="center" valign="top">
<table width="100%"  border="0" cellpadding="0" cellspacing="0">
          <tr align="center">
            <td height="25"><a href="?l=1"><img src="/web/1/img/icon_i1.gif" width="18" height="18" border="0" >一级道具</a></td>
            <td><a href="?l=2"><img src="/web/1/img/icon_i2.gif" width="18" height="18" border="0">二级道具</a></td>
            <td><a href="?l=3"><img src="/web/1/img/icon_i3.gif" width="18" height="18" border="0">三级道具</a></td>
            <td><a href="?l=4"><img src="/web/1/img/icon_i4.gif" width="18" height="18" border="0">四级道具</a></td>
            <td><a href="?l=5"><img src="/web/1/img/icon_i5.gif" width="18" height="18" border="0">五级道具</a></td>
          </tr>
          <tr align="center" valign="top">
            <td height="353" colspan="5">
	
	          <table height="165" border="0" cellpadding="0" cellspacing="1">
      <tr>
        <%
		l1=nosql(request("l"))
		if not isnumeric(l1) then
		l1=1
		elseif l1<>1 and  l1<>2 and  l1<>3 and  l1<>4 and  l1<>5  then
		l1=1
		end if
  set rs=server.CreateObject("adodb.recordset")
rs.open"select * from snsn_huadj where userid="&session("id")&" and  djclass="&l1,conn,1,1
              

if rs.eof then
          response.Write"<div align='center' ><br><br><br><br><br>暂无此物。。。。。。</div>"
           else
 
        rs.PageSize =6 '每页记录条数
		iCount=rs.RecordCount '记录总数
		iPageSize=rs.PageSize
    	maxpage=rs.PageCount 
    	page=request("page")
    	per_page=rs.PageSize
    
    if Not IsNumeric(page) or page="" then
        page=1
    else
        page=cint(page)
    end if
    
    if page<1 then
        page=1
    elseif  page>maxpage then
        page=maxpage
    end if
    
    rs.AbsolutePage=Page

	if page=maxpage then
		x=iCount-(maxpage-1)*iPageSize
	else
		x=iPageSize
	end if
	For i=0 To x-1

 if i mod 3=0 then
 response.Write("</tr><tr>")
 end if
  %>
        <td align="center"><table width="136" height="158" border="0" cellpadding="0" cellspacing="1" >
            <tr>
              <td width="142" align="center"><img src="/web/1/img/<%=rs("djurl")%>.gif" onMouseOver="showmenuie5('<%=rs("djclass")%>','<%=rs("djname")%>','<%=rs("djjs")%>')" onMouseOut="hidemenuie5()" align="absmiddle"></td>
            </tr>
            <tr>
              <td align="center"><%=rs("djname")%>&nbsp;<a href="javascript:;"><img src="/web/1/img/hua/bt_help.gif" width="8" height="11" border="0" align="absmiddle" title="单击查看道具说明" onClick="showmenuie5('<%=rs("djclass")%>','<%=rs("djname")%>','<%=rs("djjs")%>')" ></a><br>
              (使用次数：<%=rs("djnum")%>次)</td>
            </tr>
            <tr>
              <td height="21" align="center"><a href="?act=use&id=<%=rs("id")%>"><img src="/web/1/img/use.gif" width="35" height="17" border="0"></a>&nbsp;</td>
            </tr>
        </table></td>
        <%

RS.MoveNext
                  next
end if
%>
      </tr>
    </table></td>
  </tr>
          <tr align="center" valign="middle">
            <td colspan="5"><%
					call PageControl(iCount,maxpage,page,"border=0 align=center","<p align=center>",per_page)
				  %></td>
          </tr>
</table>
</td>
      </tr>
	  <tr bgcolor="#FFFFFF" ><td  width=643 height=12 colspan="2" background="/web/1/img/i_t_d.gif"></td>
  </tr>
</table>


<div id="ie5menu" style="position:absolute; left:500px; top:0px; width:150px; height:100px; z-index:1">
  <table width="150" height="100"  border="0" cellpadding="2" cellspacing="1" bgcolor="73D1E9" class="tm">
    <tr>
      <td align="left" valign="top" bgcolor="#E1F5FB"><font id=pq1></font></td>
    </tr>    
  </table>
  <script>
  document.all.ie5menu.style.visibility="hidden"
  </script>
</div>


<script language="javascript">

function showmenuie5(dhs1,dhs2,dhs3) {

pq1.innerHTML=dhs1+"级道具:<font class=\"helptext\" >"+dhs2+"</font><br>"+dhs3
var rightedge = document.body.clientWidth-event.clientX;
var bottomedge = document.body.clientHeight-event.clientY;
if (rightedge < ie5menu.offsetWidth)
ie5menu.style.left = document.body.scrollLeft + event.clientX - ie5menu.offsetWidth;
else
ie5menu.style.left = document.body.scrollLeft + event.clientX;
if (bottomedge < ie5menu.offsetHeight)
ie5menu.style.top = document.body.scrollTop + event.clientY - ie5menu.offsetHeight;
else
ie5menu.style.top = document.body.scrollTop + event.clientY;
ie5menu.style.visibility = "visible";
window.event.cancelBubble=true
return false
}
function hidemenuie5() {
ie5menu.style.visibility = "hidden";
} 
document.body.onclick = hidemenuie5;


</script>

</body>
</html>
