<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>

<!--#Include File="inc/conn.asp"-->
<!--#include file="inc/Conn_User.asp"-->
<!--#include file="inc/function.asp"-->
<!--#include file="inc/admin_code_lb.asp"-->
<!--#Include File="mv/Inc/function.asp"-->
<body style="overflow-y:hidden"> 
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="css/Mpage_main.css" rel="stylesheet" type="text/css">
<link href="css/Mpage_photo.css" rel="stylesheet" type="text/css">

</head>

<body>
	<div id="video_title"><img src="page_style/icon/bullet_03.gif"> 所有相片列表</DIV>
<%
userid=request("userid")
set rs=server.createobject("adodb.recordset")
sql="select * from [user] where userid="&userid&" order by userid desc"
rs.open sql,Conn_User,1,1
username=rs("username")

rs.close
set rs=nothing

dim CurPage,p
CurPage=request.querystring("CurPage")
if not isnumeric(CurPage) or CurPage="" then
	CurPage=1
elseif CurPage<1 then
	CurPage=1
else
	CurPage=int(CurPage)
end if
%>




<style type="text/css">
/* ******************** vshow theme start ******************** */

.video_pager_1 li {border:1px solid #2287D1;background:#D3E7F6}							/*分页*/
.video_disp_info h2 {color:#008643}/*字体*/
/* ******************** vshow theme ends ******************** */
/* video's stylesheet */
#prdVideo{width:560px;}

.video_pager_1 li {font:bold 10px tahoma;float:left;width:10px;height:5px;padding:3px;margin:4px}
.video_pager_1 li a {font:bold 10px tahoma;text-decoration:none}
</style>



<table border="0" align="center" cellpadding="0" cellspacing="0">
<%
dim PAGESIZE,PARTSIZE
set rs=server.CreateObject("adodb.recordset")
	sql="select * from mtv_Photo where username='" & username &"'"
rs.open sql,conn,1,1
if not(rs.bof and rs.eof) then
PAGESIZE = 9  '每页显示几个
PARTSIZE = 8  '显示超链接数
dim TotalPages,Totalcount,StartPageNum,EndPageNum,ii
RS.PageSize=PAGESIZE
TotalPages = RS.PageCount
Totalcount =INT(RS.recordcount)
  If CurPage>RS.Pagecount Then                
    CurPage=RS.Pagecount                
  end if    
 RS.AbsolutePage=CurPage                
 rs.CacheSize = RS.PageSize             
do while (Not RS.Eof) and (II<RS.PageSize)
%>
<DIV id=neirong>
<DIV id=video_sig>  <a href="Photo_Show.asp?id=<%=rs("id")%>" title="MTV相册:<%=rs("title")%>">
		<img src="<%=rs("s_images")%>"  height="90" width="120" border="0"/></A> 
<LI><a href="Photo_Show.asp?id=<%=rs("id")%>" style="font-weight:bold" title="MTV相册:<%=rs("title")%>"><%=rs("title")%></a> 
</LI>
</DIV></DIV> 




<%
	rs.movenext
II=II+1            
loop            
StartPageNum=1            
do while StartPageNum+PARTSIZE<=CurPage
	StartPageNum=StartPageNum+PARTSIZE
loop
EndPageNum=StartPageNum+(PARTSIZE-1)
If EndPageNum>RS.Pagecount then EndPageNum=RS.Pagecount
end if
%>

<!-- 视频内容 -->
		<div style="margin-top:5px">
			
			<ul class="video_pager_1 fright">
				<% fangye()%>
			</ul>
			<div class="fclear"></div>
		</div>
	</div>
</div>
<script language=javascript>
function del()
{
  if(!confirm('删除将不可恢复,确定要删除吗？')) return false;
}
</script>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing

function fangye()
dim fa_ye,i
fa_ye="?userid="&userid&"&p="&p&"&"
          if CurPage>PARTSIZE then
             response.write"<li class=""now""><a class=menu1 href="&fa_ye&"CurPage="&StartPageNum-1&"><<</a></li>"
          else
             response.write"<li class=""now""><<</li>"
          end if
          For I=StartPageNum to EndPageNum
          if I<>CurPage then
		  response.write"<li class=""now""><a class=menu1 href="&fa_ye&"CurPage="&I&">"&I&"</a></li>"
		  else
		  response.write"<li class=""now"">"&I&"</li>"
		  end if
		  Next
		  if EndPageNum<RS.Pagecount then
		     response.write"<li class=""now""><a class=menu1 href="&fa_ye&"CurPage="&EndPageNum+1&">>></a></li>"
          else
             response.write"<li class=""now"">>></li>"
          end if
end function
%>













<DIV id=pagenum>
<DIV id=allnum> <%rsc.close
set rsc=nothing
rsuser.close
set rsuser=nothing%>
  <center><%call listpages(mycondition)%></center> </SPAN> </DIV>
                 </DIV></DIV>


  <%sub listpages(mycondition)
	response.write "<table height=2  border=0 cellpadding=0 cellspacing=0><Tr><td><table width='100%' border=0 cellspacing=0 cellpadding=0><tr><td height=3></td></tr></table>"
	if pages<1 then
		exit sub
	end if
	
	
	if p>0 then
		response.write	"<a href="&request.ServerVariables("script_name")&"?userid="&userid&"&currentpage=10&p="&p-1&mycondition&"><img src=user/prepre.gif alt=前十页 border=0></a>&nbsp;&nbsp;&nbsp;"
    else
	response.write	"<img src=user/prepre.gif alt=前十页 border=0>&nbsp;&nbsp;&nbsp;"
    end if
	'-------------------下面写出当前十个页码
	response.write "</td><td><img src=user/lined.gif border=0><img src=user/k.gif border=0 width=5>"
	for i=1 to 10
		if (p*10+i)>pages then exit for
		if currentpage=i then
		
			response.write "<b><a style='color:ff6600'"
		else
			response.write "<a"
		end if 
		response.write " href="&request.ServerVariables("script_name")&"?userid="&userid&"&currentpage="&i&"&p="&p&mycondition&"><font class=no >"&(p*10+i)&"</font></a></b>&nbsp;&nbsp;<img src=user/lined.gif border=0><img src=user/k.gif width=5 border=0>"	
     next
	 response.write "</td><td><table width='100%' border=0 cellspacing=0 cellpadding=0><tr><td height=3></td></tr></table>"
	 '--------------------察看下十页的连接
    if (p*10+10)<pages then
		response.write "<img src=user/k.gif border=0><a href="&request.ServerVariables("script_name")&"?userid="&userid&"&currentpage=1&p="&p+1&mycondition&"><img src=user/nextnext.gif alt=后十页 border=0></a>&nbsp;&nbsp;" 
		else
		response.write "<img src=user/k.gif border=0><img src=user/nextnext.gif alt=后十页 border=0>&nbsp;&nbsp;"
	end if
	'-----------------------------------------------上下页导航
	response.write "&nbsp;</td>"
	

	  response.write "</tr></table>"
end sub

sub myPages(myRS,mysize)  '------mysize为内部变量（主页面没有定义），myRS为主页面传递过来的RS对象（地址传递）
	if myRS.eof and myRS.bof then str="没有纪录"
	if str="" then
		if mysize="" or NOT IsNumeric(mysize) then
			mysize=15
		end if
		myRS.PageSize=mysize
		pages=myRS.pagecount
		records=myRS.recordcount
		On Error Resume Next '取得数字
		currentPage=request("currentPage")
		if currentPage="" then
			currentPage=1
		end if
		currentPage=CInt(currentPage)
		if Err.Number <> 0 Then
			currentPage=1
			Err.Clear
		end if
		if currentPage<1 then
			currentPage=1
		elseIf currentPage>10 then
			currentPage=10
		end if
		'----------------处理p
		p=request("p")
		if p="" then
			p=0
		end if
		p=CLng(p)
		if Err.Number <> 0 Then
			p=0
			Err.Clear
		end if
		if p<0 then
			p=0
		end if
		'--判断是否出了页数范围
		nowPage=p*10+currentPage
		if nowPage>pages then
			p=(pages-1)\10
			currentPage=((pages-1) mod 10)+1
		end if
		myRS.absolutepage=p*10+currentPage
	else
	   currentPage=1
	   records=0
	   pages=1
	end if
end sub

%>
















<iframe name="add_favorite" id="add_favorite" src="http://127.0.0.1/mv/domain.html" marginWidth="0" marginHeight="0" frameBorder="0" width="0" scrolling="0" height="0"></iframe>
</body>
</html>