<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="conn.asp" -->
<!--#include file="function.asp" -->
<%
set rstotalwish = Server.CreateObject("ADODB.Recordset")
rstotalwish.ActiveConnection = MM_wish_STRING
rstotalwish.Source = "SELECT wish_id FROM Qy_Wish"
rstotalwish.CursorType = 1
rstotalwish.CursorLocation = 2
rstotalwish.LockType = 3
rstotalwish.Open()
rstotalwish_numRows = 0
%>
<%
set rscount = Server.CreateObject("ADODB.Recordset")
rscount.ActiveConnection = MM_wish_STRING
rscount.Source = "SELECT SUM(wish_count) as totalcount  FROM Qy_Wish"
rscount.CursorType = 1
rscount.CursorLocation = 2
rscount.LockType = 3
rscount.Open()
rscount_numRows = 0
%>
<%
set rstotalrep = Server.CreateObject("ADODB.Recordset")
rstotalrep.ActiveConnection = MM_wish_STRING
rstotalrep.Source = "SELECT reply_id FROM Qy_reply"
rstotalrep.CursorType = 1
rstotalrep.CursorLocation = 2
rstotalrep.LockType = 3
rstotalrep.Open()
rstotalrep_numRows = 0
%>
<%
set rswishes = Server.CreateObject("ADODB.Recordset")
rswishes.ActiveConnection = MM_wish_STRING
rswishes.Source = "SELECT wish_count, wish_date, wish_id, wish_poster, wish_postersex, wish_type,wish_content FROM Qy_Wish ORDER BY wish_date DESC"
rswishes.CursorType = 1
rswishes.CursorLocation = 2
rswishes.LockType = 3
rswishes.Open()
rswishes_numRows = 0
%>
<%
Dim HLooper1__numRows
HLooper1__numRows = 9'定义每页几条记录
Dim HLooper1__index
HLooper1__index = 0
rswishes_numRows = rswishes_numRows + HLooper1__numRows
%>
<%
' 哪个鸟蛋用英语做注释,bs下

' set the record count 
rstotalwish_total = rstotalwish.RecordCount

' set the number of rows displayed on this page
If (rstotalwish_numRows < 0) Then
  rstotalwish_numRows = rstotalwish_total
Elseif (rstotalwish_numRows = 0) Then
  rstotalwish_numRows = 1
End If

' set the first and last displayed record
rstotalwish_first = 1
rstotalwish_last  = rstotalwish_first + rstotalwish_numRows - 1

' if we have the correct record count, check the other stats
If (rstotalwish_total <> -1) Then
  If (rstotalwish_first > rstotalwish_total) Then rstotalwish_first = rstotalwish_total
  If (rstotalwish_last > rstotalwish_total) Then rstotalwish_last = rstotalwish_total
  If (rstotalwish_numRows > rstotalwish_total) Then rstotalwish_numRows = rstotalwish_total
End If
%>
<%
' set the record count
rstotalrep_total = rstotalrep.RecordCount

' set the number of rows displayed on this page
If (rstotalrep_numRows < 0) Then
  rstotalrep_numRows = rstotalrep_total
Elseif (rstotalrep_numRows = 0) Then
  rstotalrep_numRows = 1
End If

' set the first and last displayed record
rstotalrep_first = 1
rstotalrep_last  = rstotalrep_first + rstotalrep_numRows - 1

' if we have the correct record count, check the other stats
If (rstotalrep_total <> -1) Then
  If (rstotalrep_first > rstotalrep_total) Then rstotalrep_first = rstotalrep_total
  If (rstotalrep_last > rstotalrep_total) Then rstotalrep_last = rstotalrep_total
  If (rstotalrep_numRows > rstotalrep_total) Then rstotalrep_numRows = rstotalrep_total
End If
%>
<%
'  *** Recordset Stats, Move To Record, and Go To Record: declare stats variables

' set the record count
rswishes_total = rswishes.RecordCount

' set the number of rows displayed on this page
If (rswishes_numRows < 0) Then
  rswishes_numRows = rswishes_total
Elseif (rswishes_numRows = 0) Then
  rswishes_numRows = 1
End If

' set the first and last displayed record
rswishes_first = 1
rswishes_last  = rswishes_first + rswishes_numRows - 1

' if we have the correct record count, check the other stats
If (rswishes_total <> -1) Then
  If (rswishes_first > rswishes_total) Then rswishes_first = rswishes_total
  If (rswishes_last > rswishes_total) Then rswishes_last = rswishes_total
  If (rswishes_numRows > rswishes_total) Then rswishes_numRows = rswishes_total
End If
%>
<%
If (rstotalwish_total = -1) Then

  ' count the total records by iterating through the recordset
  rstotalwish_total=0
  While (Not rstotalwish.EOF)
    rstotalwish_total = rstotalwish_total + 1
    rstotalwish.MoveNext
  Wend

  ' reset the cursor to the beginning
  If (rstotalwish.CursorType > 0) Then
    rstotalwish.MoveFirst
  Else
    rstotalwish.Requery
  End If

  ' set the number of rows displayed on this page
  If (rstotalwish_numRows < 0 Or rstotalwish_numRows > rstotalwish_total) Then
    rstotalwish_numRows = rstotalwish_total
  End If

  ' set the first and last displayed record
  rstotalwish_first = 1
  rstotalwish_last = rstotalwish_first + rstotalwish_numRows - 1
  If (rstotalwish_first > rstotalwish_total) Then rstotalwish_first = rstotalwish_total
  If (rstotalwish_last > rstotalwish_total) Then rstotalwish_last = rstotalwish_total

End If
%>
<%
If (rstotalrep_total = -1) Then

  ' count the total records by iterating through the recordset
  rstotalrep_total=0
  While (Not rstotalrep.EOF)
    rstotalrep_total = rstotalrep_total + 1
    rstotalrep.MoveNext
  Wend

  ' reset the cursor to the beginning
  If (rstotalrep.CursorType > 0) Then
    rstotalrep.MoveFirst
  Else
    rstotalrep.Requery
  End If

  ' set the number of rows displayed on this page
  If (rstotalrep_numRows < 0 Or rstotalrep_numRows > rstotalrep_total) Then
    rstotalrep_numRows = rstotalrep_total
  End If

  ' set the first and last displayed record
  rstotalrep_first = 1
  rstotalrep_last = rstotalrep_first + rstotalrep_numRows - 1
  If (rstotalrep_first > rstotalrep_total) Then rstotalrep_first = rstotalrep_total
  If (rstotalrep_last > rstotalrep_total) Then rstotalrep_last = rstotalrep_total

End If
%>
<%
' *** Move To Record and Go To Record: declare variables

Set MM_rs    = rswishes
MM_rsCount   = rswishes_total
MM_size      = rswishes_numRows
MM_uniqueCol = ""
MM_paramName = ""
MM_offset = 0
MM_atTotal = false
MM_paramIsDefined = false
If (MM_paramName <> "") Then
  MM_paramIsDefined = (Request.QueryString(MM_paramName) <> "")
End If
%>
<%
' *** Move To Record: handle 'index' or 'offset' parameter

if (Not MM_paramIsDefined And MM_rsCount <> 0) then

  ' use index parameter if defined, otherwise use offset parameter
  r = Request.QueryString("index")
  If r = "" Then r = Request.QueryString("offset")
  If r <> "" Then MM_offset = Int(r)

  ' if we have a record count, check if we are past the end of the recordset
  If (MM_rsCount <> -1) Then
    If (MM_offset >= MM_rsCount Or MM_offset = -1) Then  ' past end or move last
      If ((MM_rsCount Mod MM_size) > 0) Then         ' last page not a full repeat region
        MM_offset = MM_rsCount - (MM_rsCount Mod MM_size)
      Else
        MM_offset = MM_rsCount - MM_size
      End If
    End If
  End If

  ' move the cursor to the selected record
  i = 0
  While ((Not MM_rs.EOF) And (i < MM_offset Or MM_offset = -1))
    MM_rs.MoveNext
    i = i + 1
  Wend
  If (MM_rs.EOF) Then MM_offset = i  ' set MM_offset to the last possible record

End If
%>
<%
' *** Move To Record: if we dont know the record count, check the display range

If (MM_rsCount = -1) Then

  ' walk to the end of the display range for this page
  i = MM_offset
  While (Not MM_rs.EOF And (MM_size < 0 Or i < MM_offset + MM_size))
    MM_rs.MoveNext
    i = i + 1
  Wend

  ' if we walked off the end of the recordset, set MM_rsCount and MM_size
  If (MM_rs.EOF) Then
    MM_rsCount = i
    If (MM_size < 0 Or MM_size > MM_rsCount) Then MM_size = MM_rsCount
  End If

  ' if we walked off the end, set the offset based on page size
  If (MM_rs.EOF And Not MM_paramIsDefined) Then
    If (MM_offset > MM_rsCount - MM_size Or MM_offset = -1) Then
      If ((MM_rsCount Mod MM_size) > 0) Then
        MM_offset = MM_rsCount - (MM_rsCount Mod MM_size)
      Else
        MM_offset = MM_rsCount - MM_size
      End If
    End If
  End If

  ' reset the cursor to the beginning
  If (MM_rs.CursorType > 0) Then
    MM_rs.MoveFirst
  Else
    MM_rs.Requery
  End If

  ' move the cursor to the selected record
  i = 0
  While (Not MM_rs.EOF And i < MM_offset)
    MM_rs.MoveNext
    i = i + 1
  Wend
End If
%>
<%
' *** Move To Record: update recordset stats

' set the first and last displayed record
rswishes_first = MM_offset + 1
rswishes_last  = MM_offset + MM_size
If (MM_rsCount <> -1) Then
  If (rswishes_first > MM_rsCount) Then rswishes_first = MM_rsCount
  If (rswishes_last > MM_rsCount) Then rswishes_last = MM_rsCount
End If

' set the boolean used by hide region to check if we are on the last record
MM_atTotal = (MM_rsCount <> -1 And MM_offset + MM_size >= MM_rsCount)
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters

' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" & MM_paramName & "="
MM_keepURL="":MM_keepForm="":MM_keepBoth="":MM_keepNone=""

' add the URL parameters to the MM_keepURL string
For Each Item In Request.QueryString
  NextItem = "&" & Item & "="
  If (InStr(1,MM_removeList,NextItem,1) = 0) Then
    MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.QueryString(Item))
  End If
Next

' add the Form variables to the MM_keepForm string
For Each Item In Request.Form
  NextItem = "&" & Item & "="
  If (InStr(1,MM_removeList,NextItem,1) = 0) Then
    MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.Form(Item))
  End If
Next

' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
if (MM_keepBoth <> "") Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
if (MM_keepURL <> "")  Then MM_keepURL  = Right(MM_keepURL, Len(MM_keepURL) - 1)
if (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)

' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
  If (firstItem <> "") Then
    MM_joinChar = "&"
  Else
    MM_joinChar = ""
  End If
End Function
%>
<%
' *** Move To Record: set the strings for the first, last, next, and previous links

MM_keepMove = MM_keepBoth
MM_moveParam = "index"

' if the page has a repeated region, remove 'offset' from the maintained parameters
If (MM_size > 0) Then
  MM_moveParam = "offset"
  If (MM_keepMove <> "") Then
    params = Split(MM_keepMove, "&")
    MM_keepMove = ""
    For i = 0 To UBound(params)
      nextItem = Left(params(i), InStr(params(i),"=") - 1)
      If (StrComp(nextItem,MM_moveParam,1) <> 0) Then
        MM_keepMove = MM_keepMove & "&" & params(i)
      End If
    Next
    If (MM_keepMove <> "") Then
      MM_keepMove = Right(MM_keepMove, Len(MM_keepMove) - 1)
    End If
  End If
End If

' set the strings for the move to links
If (MM_keepMove <> "") Then MM_keepMove = MM_keepMove & "&"
urlStr = Request.ServerVariables("URL") & "?" & MM_keepMove & MM_moveParam & "="
MM_moveFirst = urlStr & "0"
MM_moveLast  = urlStr & "-1"
MM_moveNext  = urlStr & Cstr(MM_offset + MM_size)
prev = MM_offset - MM_size
If (prev < 0) Then prev = 0
MM_movePrev  = urlStr & Cstr(prev)
%>
<html>
<head>
<title>祈愿板,祈愿树,祝福树,祈愿,祝福</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="refresh" content="120">
<meta name="description" content="新重庆，祈愿板,祈愿树,祈愿墙,祝福树,祈愿,祝福">
<meta name="keywords" content="新重庆，祈愿板,祈愿树,祈愿墙,祝福树,祈愿,祝福">
<style type="text/css">
<!--
BODY{
	scrollbar-face-color: #d4d0c8;
	scrollbar-highlight-color:#D4D0C8;
	scrollbar-shadow-color:#d6d6d6;
	scrollbar-3dlight-color:#e6e6e6;
	scrollbar-arrow-color:#006699;
	scrollbar-track-color:#dfdfdf;
	scrollbar-darkshadow-color: #808080;
	background-color: #EFF8FE;
}
#tipBox {
width: 160;BACKGROUND: #ffffff; BORDER-BOTTOM: black 1pt solid; BORDER-LEFT: black 1pt solid; BORDER-RIGHT: black 1pt solid; BORDER-TOP: black 1pt solid; FONT-FAMILY: 宋体; FONT-SIZE: 9pt; POSITION: absolute; VISIBILITY: hidden; padding:2 ;Z-INDEX: 100
}
A:link {font-family:"Verdana",  "宋体"; COLOR: #000000;  font-size: 12px;  TEXT-DECORATION: none }
A:visited {font-family: "Verdana", "宋体";	COLOR: #000000; FONT-SIZE:12px; TEXT-DECORATION: none }
A:active {font-family: "Verdana", "宋体"; COLOR: #000099; FONT-SIZE: 12px; TEXT-DECORATION: none }
A:hover {font-family: "Verdana", "宋体"; COLOR: #dd0000; FONT-SIZE: 12px; TEXT-DECORATION: underline }
.smallTxt{FONT-SIZE: 12px; FONT-FAMILY: "Tahoma","Arial","sans-serif"}
.style3 {FONT-SIZE: 14px; FONT-FAMILY: "Tahoma","Arial","sans-serif"; }
-->
</style>
<script language="JavaScript" src="tip.js"></script>
<SCRIPT language=javascript src="navigation.js" type=text/javascript></SCRIPT>
<script language="JavaScript">
<!--
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//-->
</script>
</head>
<body leftmargin="0" topmargin="0">
<table width="742" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
  <td height="10" align="center" valign="middle"></td>
  </tr>
  <tr> 
    <td width="742" align="center" valign="top" background="images/bg.gif"> 
      <table width="675" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="47%" height="50"></td>
          <td width="53%" height="50"><a href="write.asp"><img src="images/wyqy.gif" border="0"></a></td>
        </tr>
        <tr> 
          <td colspan="2" height="60"></td>
        </tr>
      </table>
      <DIV id=tipBox align=center></DIV>
      <table width="675" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="675" align="center"> 
            <table width="675" border="0" cellspacing="0" cellpadding="0">
              <%
startrw = 0
endrw = HLooper1__index
numberColumns = 3
numrows = 3
while((numrows <> 0) AND (Not rswishes.EOF))
	startrw = endrw + 1
	endrw = endrw + numberColumns
 %>
              <tr align="center" valign="top"> 
                <%
While ((startrw <= endrw) AND (Not rswishes.EOF))
%>
                <td width="225" height="234" valign="middle">
				<table width="225" height="194"  border="0" cellspacing="0" cellpadding="0" background="images/<%=rswishes("wish_type")%>.gif">
  <tr>
    <td width="30">&nbsp;</td>
    <td>&nbsp;</td>
    <td width="30">&nbsp;</td>
  </tr>
  <tr>
    <td width="30">&nbsp;</td>
    <td height="30"></td>
    <td width="30">&nbsp;</td>
  </tr>
  <tr>
    <td width="30">&nbsp;</td>
    <td align="center" valign="middle"><a href ="showwish.asp?wish_id=<%=rswishes("wish_id")%>" onMouseOver="this._tip = '<font color=#808080>有<%=rswishes("wish_count")%>人看过<br><%=rswishes("wish_poster")%>(<%if rswishes("wish_postersex") = "0" then response.Write("帅哥") else response.Write("美女") end if%>)的愿望</font><br><font color=#5a5a5a>请按此看看</font>'"><%="<font color=#eeeeee>"&repcontent(rswishes("wish_content"))&"</font>"%></a></td>
    <td width="30">&nbsp;</td>
  </tr>
  <tr>
    <td width="30">&nbsp;</td>
    <td>&nbsp;</td>
    <td width="30">&nbsp;</td>
  </tr>
</table>
<table width="225"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="20" align="center"><span class="smallTxt"><%=rswishes("wish_poster")%></span></td>
  </tr>
  <tr>
    <td height="20" align="center"><span class="smallTxt">祈愿于 <%=rswishes("wish_date")%></span></td>
  </tr>
</table>

				</td>
                <%
	startrw = startrw + 1
	rswishes.MoveNext()
	Wend
	%>
                <%
 numrows=numrows-1
 Wend
 %>
 </tr>
            </table>
</td>
        </tr>
		<% If rswishes.EOF And rswishes.BOF Then %>
        <tr> 
          <td height="30" align="center"><a href="write.asp">谁来许第一个愿呢？</a></td>
        </tr>
		<% End If ' end rswishes.EOF And rswishes.BOF %>
         <tr>
          <td align="center" height="40"><span class="style3"><font color="#FF0000">愿所有的祝福都能实现，有情人终成眷属！</font></span></td>
        </tr>	
        <tr> 
          <td height="45"><img src="images/picture.gif" width="38" height="22" align="absmiddle"><span class="style3">共有<font color="#FF0000"><%=(rstotalwish_total)%></font>个人在这里留下了最真诚的心愿</span><br><img src="images/picture.gif" width="38" height="22" align="absmiddle"><span class="style3">所有祈愿的总点击次数为<font color="#FF0000"><%=rscount.Fields.Item("totalcount").Value%></font>,共有<font color="#FF0000"><%=(rstotalrep_total)%></font>条回复</span></td>
        </tr>
        <tr> 
          <td background="images/dotline.gif" height="1"></td>
        </tr>
        <tr> 
          <td align="right" height="20">
            <table border="0" width="40%">
              <tr> 
                <td width="23%" align="center"> 
                  <% If MM_offset <> 0 Then %>
                  <a href="<%=MM_moveFirst%>"><font color="#ff6600">首页</font></a> 
                  <% End If ' end MM_offset <> 0 %>
                </td>
                <td width="31%" align="center"> 
                  <% If MM_offset <> 0 Then %>
                  <a href="<%=MM_movePrev%>"><font color="#ff6600">前一页</font></a> 
                  <% End If ' end MM_offset <> 0 %>
                </td>
                <td width="23%" align="center"> 
                  <% If Not MM_atTotal Then %>
                  <a href="<%=MM_moveNext%>"><font color="#ff6600">后一页</font></a> 
                  <% End If ' end Not MM_atTotal %>
                </td>
                <td width="23%" align="center"> 
                  <% If Not MM_atTotal Then %>
                  <a href="<%=MM_moveLast%>"><font color="#ff6600">末页</font></a> 
                  <% End If ' end Not MM_atTotal %>
                </td>
              </tr>
            </table>
          </td>
        </tr>
        <tr> 
          <td background="images/dotline.gif" height="1"></td>
        </tr>
        <tr> 
          <td align="center" height="30"><span class="smallTxt"><font color="#FF0000">真诚祈愿板</font> v1.0 beta by<font color="#CC6600"> 便民网-www.99fad.cn</font></span></td>
        </tr>		
    </table></td>
  </tr>
  <tr> 
    <td width="100%" bgcolor="#EEEEEE" align="right"><!--#include file="copyright.asp" --></td>
  </tr>
</table>
</body>
</html>
<%
rstotalwish.Close()
%>
<%
rscount.Close()
%>
<%
rstotalrep.Close()
%>
<%
rswishes.Close()
%>