<%@ codepage ="65001" %>
<%charset="utf-8"%>
<!--#include file="mycartconn/conn.asp" -->
<!--#include file="mycartconn/Function.asp"-->
<!--#include file="mycartconn/ubbcode.asp"-->
<!--#include file="mycartconn/page.asp"-->
<!--#include file="mycartconn/md5.asp"-->
<!--#include file="mycartconn/ubb.asp"-->
<!--#include file="mycartconn/je.asp"-->
<%
sub page_ping(id)
  if rs.recordcount>=1 then
	if page-1 mod 5=0 then
	p=(page-1) \ 5
	else
	p=(page-1) \ 5
	end if
	response.write "共&nbsp;"& rs.pagecount &"&nbsp;页&nbsp;"
	if page<2 then
		response.write "<span>第一页</span>&nbsp;<span>上一页</span>" 
	Else
		response.write "<a href=""javascript:et.molihe_slide_ping('"&id&"','1');"">第一页</a>&nbsp; <a href=""javascript:et.molihe_slide_ping('"&id&"','"&page-1&"');"">上一页</a>"
	end if

	uming_i=1
	for ii=p*5+1 to P*5+5
	if ii=page then
	response.write "<font color=#ff0000>"+Cstr(ii)+"</font> "
	else
	response.write "<a href=""javascript:et.molihe_slide_ping('"&id&"','"&ii&"');"">"+Cstr(ii)+"</a> "
	end if
	if ii=rs.pagecount then exit for
	uming_i=uming_i+1
	next

	if page>=rs.pagecount then 
		response.write "<FONT color=silver>下一页&nbsp;最后页&nbsp;</FONT>" 
	else 
		response.write "<a href=""javascript:et.molihe_slide_ping('"&id&"','"&page+1&"');"">" 
		response.write "下一页</a>&nbsp;<a href=""javascript:et.molihe_slide_ping('"&id&"','"&rs.pagecount&"');"">最末页</a>&nbsp;" 
	end if 

  end if
end Sub

dim action
action=server.htmlencode(request("action"))
If action="molihe_slidelist" Then  '用户盒子列表
	userid=Trim(request("userid"))
	cate=clng(request("cate"))
	If cate="" Then cate=0
	If userid<>"" then
		sql="select top 20 id,defpic,name,hits,views,photoNum from A_slide where flag=1 and share_set=1 and userid="&Replace(userid,"'","")&" order by newid()"
	End If
	If cate>0 then
		sql="select top 20 id,defpic,name,hits,views,photoNum from A_slide where flag=1 and share_set=1 and cate="&clng(cate)&" order by newid()"
	End If
	If userid="" And cate=0 Then 
		response.end
	End If
	Set rs= Server.CreateObject("ADODB.Recordset")
	rs.open sql,conn,1,1
	rs.CacheSize = 20
	i=1
	If Not(rs.bof And rs.eof) then
	while not rs.eof and i<=20%>

	<div class="xiu_49 margin_bottom">
	<a href="mofahe.asp?moliheid=<%=rs("id")%>"><img border="0" src="<%=rs("defpic")%>" width="120px" height="90px" alt="<%=rs("name")%>" /></a>
	<ul>
		<li>名称：<a href="mofahe.asp?moliheid=<%=rs("id")%>"><%=rs("name")%></a></li>
			<li>浏览：<%=rs("hits")+rs("views")%>人</li>
		<li>图片：<%=rs("photoNum")%>张</li>
	</ul>
	<div class="clear"></div>
	</div>
	  <%
		rs.MoveNext
		i=i+1
		Wend
	End if
	rs.close
	Set rs=Nothing
End If

If action="molihe_slide_ping" Then  '用户盒子评论
	moliheid=FilterJs(request("moliheid"))
	page=request("page")
	haveFlag=True
	If moliheid<>"" then
		sql="select top 20 userid,name,datetime,content from A_ping where Aid="&Replace(moliheid,"'","")&" order by datetime desc"
		Set rs= Server.CreateObject("ADODB.Recordset")
		rs.open sql,conn,1,1
		rs.CacheSize = 20
		page1("20")
		i=1
		ii=rs.recordcount-(page-1)*20
		If Not(rs.bof And rs.eof) Then
			response.write "<table width='540' border='0' cellpadding='8' cellspacing='1' bgcolor='#CCCCCC'>"
			while not rs.eof and i<=20
				mynickname=conn.execute("select nickname from huiyuan where userid="&CLng(rs("userid")))(0)
			%>
			  <tr>
				<td bgcolor="#F1F1F1" class="Gray">[<span id="myDataList_ctl00_Label15"><%=ii%></span>楼]　<%If CInt(rs("userid"))<>0 then%><a href='user.asp?huiyuan=<%=rs("userid")%>'><%=mynickname%></a><%Else 
				response.write rs("name") 
				End if%>　<%=rs("datetime")%> </td>
			  </tr>
			  <tr>
				<td width="100%" align=center bgcolor="#FFFFFF" style="padding-bottom:5px;">
				<table width="98%" border="0" cellspacing="0" cellpadding="0" style="WORD-WRAP: break-word; TABLE-LAYOUT: fixed; word-break:break-all;">
				  <tr>
					<td align=left><%=Replace(mofahe_ubb(rs("content")),vbcrlf,"<BR>")%></td>
				  </tr>
				</table>
				</td>
			  </tr>
			  <%
			  rs.MoveNext
			  i=i+1
			  ii=ii-1
			Wend
			response.write "</table>"
			response.write "<table width='540' border='0' cellspacing='0' cellpadding='0'>"
			response.write "<tr>"
			response.write "<td width='100%' height='45'>"&page_ping(moliheid)&"</td>"
			response.write "</tr>"
			response.write "</table>"
		Else
			haveFlag=False
		End if
		rs.close
		Set rs=Nothing
	Else
		haveFlag=False
	End If
	
	If haveFlag=False then
		response.write "<table width='540px' border='0' cellspacing='1' cellpadding='1' bgcolor='#CCCCCC' class='xiu_46'><tr><td>暂时还没有评论……</td></tr></table>"
	End if
End If



If action="friendlist_slide" then   '显示订阅的盒子
	userid=FilterJs(request("userid"))
	username=FilterJs(request("username"))
	%>
	<div class="padding_5 padding_0_left fweight border_06 margin_bottom">"<%=username%>"的最新作品 <a href="user.asp?huiyuan=<%=userid%>" target="_blank">查看"<%=username%>"的全部作品</a></div>
	<div class="xiu_31">
		<%
		sql="select top 9 id,defpic from A_slide where flag=1 and share_set=1 and userid="&CLng(userid)&" order by datetime desc"
		Set rs= Server.CreateObject("ADODB.Recordset")
		rs.open sql,conn,1,1
		rs.CacheSize = 9
		i=1
		while not rs.eof and i<=9%>
			<a href="mofahe.asp?moliheid=<%=rs("id")%>" target="_blank"><img border="0" src="<%=rs("defpic")%>" width="120px" height="90px" class="border_07" /></a>
		  <%
			rs.MoveNext
			i=i+1
			Wend
		rs.close
		Set rs=Nothing
		%>

	<div class="clear"></div>
	</div>
	<%
End if


If action="myalbum_photo" then   '我的相册图片
	sql="select slide_images from A_slide where id="&CLng(request("moliheid"))&""
	Set rs= Server.CreateObject("ADODB.Recordset")
	rs.open sql,conn,1,1
	If Not(rs.bof And rs.eof) Then
%>
	<div class="xiu_15">
	  <script language="javascript" src="/js/upload_menu_js.asp?index=4"></script>	
	  <div class="xiu_19">		
	    <form name="p" style="margin:0px;">		
		<div style="padding-left:10px; padding-top:10px; overflow: auto; height:250px;">			
			<input type="checkbox" name="url" value="" style="display:none;" />
		<%
		slide_tmp_images = rs("slide_images")
		splitStr="{p}1"
		If InStr(slide_tmp_images,"{p}2")>0 Then splitStr="{p}2"
		If InStr(slide_tmp_images,"{p}3")>0 Then splitStr="{p}3"
		If InStr(slide_tmp_images,"{p}4")>0 Then splitStr="{p}4"
		Arrimgs=Split(slide_tmp_images,splitStr)
		For i=0 To UBound(Arrimgs)-1
			If InStr(Arrimgs(i),"{p}")>0 Then%>
				<div class="xiu_20" style="height:120px;">			
				  <img style="cursor:pointer;" onClick="check(this);"  src="<%=Split(Arrimgs(i),"{p}")(1)%>" width="96px" height="80px" /><br />			
				  <input type="checkbox" name="url" value="<%=Replace(Split(Arrimgs(i),"{p}")(0),"{img}","")%>|<%=Split(Arrimgs(i),"{p}")(1)%>|1"><%=Replace(Split(Arrimgs(i),"{p}")(0),"{img}","")%>			
				</div>
			<%
			Else%>
				<div class="xiu_20" style="height:120px;">			
				  <img style="cursor:pointer;" onClick="check(this);"  src="<%=Arrimgs(i)%>" width="96px" height="80px" /><br />			
				  <input type="checkbox" name="url" value="图片说明|<%=Arrimgs(i)%>|1">图片说明			
				</div>
			<%
			End if
		next
		%>
			<div class="clear"></div>		
		</div>		
		</form>		
		<div class="margin_top align_center">			<input type="checkbox" name="ca" value="" onClick="sal(this.checked);">全选 <a href="javascript:getp2();"><img src="images/x_11.gif" width="79px" height="29px" /></a>		</div>	
	  </div>
	</div>
<%	End if
	rs.close
	Set rs=nothing
End if

conn.close
Set conn=Nothing
%>
