<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>插入 魔法表情</title>
</head>


<body leftmargin="5" rightmargin="0" topmargin="5">
<style>TD {FONT-SIZE: 12px}</style>

<% '向原网页光标所在处写入UBB代码%>
<script language="JavaScript">
function YSQQ(which){
		sel=opener.IframeID.document.selection.createRange();
		sel.pasteHTML(which);
		window.close();
	}
</script>

<body leftmargin="5" rightmargin="0" topmargin="5">
<%
'显示魔法表情列表

function UeYSQQ(Nowpage)
if Maxrow*Nowpage<Total then Max=Maxrow*Nowpage else Max=Total
UEmview=""
Rs.MoveFirst
Rs.Move ( (Nowpage-1)*Maxrow )
for i=(Nowpage-1)*Maxrow+1 to Max
Filename=rs("ID")
Title=rs("Title")
if (i-(Nowpage-1)*Maxrow) mod 8<>0 then '每行显示8个表情
 UEmview=UEmview&"<a title="&Title&"><img onclick=YSQQ('[SxyzMagic"&filename&"]') border=0 height=40 width=40  src=../images/YSQQ/"&filename&".gif style=cursor:hand></a>&nbsp;"
Else 
 UEmview=UEmview&"<a title="&Title&"><img onclick=YSQQ('[SxyzMagic"&filename&"]') border=0 height=40 width=40  src=../images/YSQQ/"&filename&".gif style=cursor:hand></a>"
End if
rs.MoveNext
next
%><table border="1" width="100%" style="border-collapse: collapse" id="table1" bordercolor="#000080">
	<tr>
		<td bgcolor="#9999FF"><b><font color="#000080" size="2">&nbsp;</font><font size="2" color="#FFFFFF">魔法表情： 
		| <a style="color: #FFFFFF" href="ysqq.asp?page=1">全部</a> | <a style="color: #FFFFFF"  href="ysqq.asp?page=1&style=0">动物</a> | 
		<a style="color: #FFFFFF" href="ysqq.asp?page=1&style=1">人物</a> | 
		<a style="color: #FFFFFF" href="ysqq.asp?page=1&style=2">蔬菜</a> | 
		<a style="color: #FFFFFF" href="ysqq.asp?page=1&style=3">包子</a> |</font></b></td> 
	</tr>
	<tr>
		<td align="centre"><div id="Emview" align="centre" style="width:100%;height:223;line-height:150%;overflow:auto">

<% response.write (Uemview) %>
</td> </div>
	</tr>
</table>
<% end function%>

<%
MagicFaceStyle=Request.Querystring("style")
NowPage=int(Request.Querystring("page"))

'设定魔法表情数据库连接
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
datapath="../database/"
datafile="magicface.asp"
Plus_MagicFace_conn="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath(""&datapath&""&datafile&"")
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'查询数据库
if MagicFaceStyle="" then
      Sql="Select ID,Title From magicface where Magictype<>-1 Order by ID Desc"
 Else 
  Sql="Select ID,Title From magicface where Magictype="&MagicFaceStyle&" Order by ID Desc"
 End if
Set rs=Server.CreateObject("adodb.recordset")
Rs.open sql,Plus_MagicFace_conn,1,1
'计算页数
Total=Rs.RecordCount
MaxRow=40 '每行8个，每页5行
If Total mod Maxrow=0 then 
 Maxpage= Total / Maxrow 
Else 
 Maxpage=int(Total / Maxrow) + 1
End if
if Nowpage>Maxpage  then Nowpage=1
if Nowpage<1  then Nowpage=Maxpage
UeYSQQ(Nowpage)
%>
<table border="0" width="100%" id="table2">
	<tr>
		<td width="230">本类魔法表情共<font color="#FF0000"><%=Maxpage%></font>页，现在是第<font color="#FF0000"><%=nowpage%>
		</font>页。</td>
		<td>
		<p align="right">
		<a style="color: #000080" target="_self" href="ysqq.asp?style=<%=MagicFaceStyle%>&page=<%=nowpage-1%>">上一页</a>
		<a style="color: #000080" href="ysqq.asp?style=<%=MagicFaceStyle%>&page=<%=nowpage+1%>">下一页</a></td>
	</tr>
</table>
</body>

</html>