收藏本站腾讯微博新浪微博

经典论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

蓝色理想 最新研发动态 网站开通淘帖功能 - 蓝色理想插件 论坛内容导读一页看论坛 - 给官方提建议

论坛活动及任务 地图和邮件任务 请多用悬赏提问 热夏来袭,选一款蓝色理想的个性T恤吧!

手机上论坛,使用APP获得更好体验 急需前端攻城狮,获得内部推荐机会 论坛开通淘帖功能,收藏终于可以分类了!

搜索
查看: 1606|回复: 0

贴子为什么多次显示?

[复制链接]
发表于 2004-6-4 08:54:00 | 显示全部楼层 |阅读模式
我发一次贴子,但它每却显示的不只一次。现在如何更改使其正常显示?
下面是其代码:


<%
if Request.QueryString("FORUM_ID") = "" and (Request.Form("Method_Type") <> "login") and (Request.Form("Method_Type") <> "logout") then
        Response.Redirect "Default.asp"
end if
%>
<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_functions.asp" -->
<!--#INCLUDE FILE="inc_functions2.asp" -->
<%
Dim strFolderImg
strFolderImg =8

Function StrLen(sInputStr)
        Dim i,iLen
        iLen = 0
        For i = 1 To Len(sInputStr)
                If Asc(Mid(sInputStr,i,1))<0 Then
                        iLen = iLen + 2
                Else
                        iLen = iLen + 1
                End If
        Next
        StrLen = iLen
End Function

If Request("whichpage") = "" or Request("whichpage") <= 0 then
        mypage = 1
Else
        mypage = CINT(Request("whichpage"))
End If

'############################################
sortorder = request.Form("newsort")
SortImg = request.Form("sortimg")
if sortorder <> "" then
        mypage = 1
else
        sortorder = request.Form("sort")
end if
'############################################
nDays = Request.Cookies(strCookieURL & "NumDays")
OlderThan = Request.Cookies(strCookieURL & "OlderThan") 'HuwR

if Request.form("cookie") = 1 then

        if strSetCookieToForum = "1" then
                Response.Cookies(strCookieURL & "NumDays").Path = strCookieURL
                Response.Cookies(strCookieURL & "OlderThan").Path = strCookieURL
        end if
        Response.Cookies(strCookieURL & "NumDays") = Request.Form("days")
        Response.Cookies(strCookieURL & "NumDays").expires = strForumTimeAdjust + 365
        Response.Cookies(strCookieURL & "OlderThan") = Request.Form("OlderThan")
        Response.Cookies(strCookieURL & "OlderThan").expires = strForumTimeAdjust + 365
        OlderThan = Request.Form("OlderThan")
        nDays = Request.Form("Days")
        mypage = 1
end if

if nDays = "" then
        nDays = 0
end if

defDate = DateToStr(dateadd("d", -(nDays), StrToDate(strForumTimeAdjust)))

if (strAuthType = "nt") then
        set my_Conn = Server.CreateObject("ADODB.Connection")
        my_Conn.Open strConnString
        call NTauthenticate()
        if (ChkAccountReg() = "1") then
                call NTUser()
        end if
end if

'if strPrivateForums = "1" then
'        if Request("Method_Type") = "" and (mLev <> 4) then
'                chkUser4()
'        end if
'end if
%>
<!--#INCLUDE FILE="inc_top.asp" -->
<%
'###############################################
        Dim objConn, strConn,  User
        Dim objRS, strSQL
        Set OnlineLocation = Nothing
'###############################################
if strPrivateForums = "1" then
        if Request("Method_Type") = "" and (mLev <> 4) then
                chkUser4()
        end if
end if


if (mLev = 4) or (chkForumModerator(Request.QueryString("FORUM_ID"), STRdbntUserName)= "1") or (lcase(strNoCookies) = "1") then
        AdminAllowed = 1
else
        AdminAllowed = 0
end if

'## Forum_SQL - Find out if the Category is Locked or Un-Locked and if it Exists
strSql = "SELECT " & strTablePrefix & "CATEGORY.CAT_STATUS "
strSql = strSql & " FROM " & strTablePrefix & "CATEGORY "
strSql = strSql & " WHERE " & strTablePrefix & "CATEGORY.CAT_ID = " & Request.QueryString("CAT_ID")
set rsCStatus = my_Conn.Execute (StrSql)

'## Forum_SQL - Find out if the Topic is Locked or Un-Locked and if it Exists
strSql = "SELECT " & strTablePrefix & "FORUM.F_STATUS,  " & strTablePrefix & "FORUM.F_PRIVATEFORUMS , "
strSql = strSql & strTablePrefix & "FORUM.F_SUBJECT  "
strSql = strSql & " FROM " & strTablePrefix & "FORUM "
strSql = strSql & " WHERE " & strTablePrefix & "FORUM.FORUM_ID = " & Request.QueryString("FORUM_ID")
set rsFStatus = my_Conn.Execute (StrSql)

strPrivateForums = rsFStatus("F_PRIVATEFORUMS")
'加入版块的题目
SubForumTitle = rsFStatus("F_SUBJECT")

'## Forum_SQL - Get all topics from DB
strSql ="SELECT " & strTablePrefix & "TOPICS.T_STATUS, " & strTablePrefix & "TOPICS.CAT_ID, "
strSql = strSql & strTablePrefix & "TOPICS.FORUM_ID, " & strTablePrefix & "TOPICS.TOPIC_ID, "
strSql = strSql & strTablePrefix & "TOPICS.T_VIEW_COUNT, " & strTablePrefix & "TOPICS.T_SUBJECT, "
strSql = strSql & strTablePrefix & "TOPICS.T_MAIL, " & strTablePrefix & "TOPICS.T_AUTHOR, " & strTablePrefix & "TOPICS.T_FACE, "
strSql = strSql & strTablePrefix & "TOPICS.T_REPLIES, " & strTablePrefix & "TOPICS.T_LAST_POST, "
strSql = strSql & strTablePrefix & "TOPICS.T_LAST_POST_AUTHOR, " & strTablePrefix & "TOPICS.T_INPLACE, "
strSql = strSql & strTablePrefix & "TOPICS.T_BEST, " & strTablePrefix & "TOPICS.T_FILEID, " & strTablePrefix & "TOPICS.T_FILENAME, "& strTablePrefix & "TOPICS.T_Poll, "
strSql = strSql & strMemberTablePrefix & "MEMBERS.M_NAME, "
strSql = strSql & strMemberTablePrefix & "MEMBERS_1.M_NAME AS LAST_POST_AUTHOR_NAME "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS, "
strSql = strSql & strTablePrefix & "TOPICS, "
strSql = strSql & strMemberTablePrefix & "MEMBERS AS " & strMemberTablePrefix & "MEMBERS_1 "
strSql = strSql & " WHERE " & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & strTablePrefix & "TOPICS.T_AUTHOR "
strSql = strSql & " AND " & strTablePrefix & "TOPICS.T_LAST_POST_AUTHOR = "& strMemberTablePrefix & "MEMBERS_1.MEMBER_ID "
strSql = strSql & " AND " & strTablePrefix & "TOPICS.FORUM_ID = " & Request.QueryString("FORUM_ID") & " "
if lCase(Request.Querystring("MODE"))="best" then
        strSql = strSql & " AND " & strTablePrefix & "TOPICS.T_BEST = 1 "
end if
if nDays = "-1" then
        strSql = strSql & " AND   " & strTablePrefix & "TOPICS.T_STATUS <> 0 "
end if
if nDays > "0" then
        if OlderThan = "1" then
                strSql = strSql & " AND " & strTablePrefix & "TOPICS.T_LAST_POST < '" & defDate & "'"
        else
                strSql = strSql & " AND " & strTablePrefix & "TOPICS.T_LAST_POST > '" & defDate & "'"
        end if
end if
strSql = strSql & " ORDER BY " & strTablePrefix & "TOPICS.T_INPLACE DESC "
'############################################
SELECT CASE sortorder
        CASE "1a", "1d"
                strSql = strSql & ", " & strTablePrefix & "TOPICS.T_SUBJECT"
        CASE "2a", "2d"
                strSql = strSql & ", " & strTablePrefix & "TOPICS.T_AUTHOR"
        CASE "3a", "3d"
                strSql = strSql & ", " & strTablePrefix & "TOPICS.T_REPLIES"
        CASE "4a", "4d"
                strSql = strSql & ", " & strTablePrefix & "TOPICS.T_VIEW_COUNT"
        CASE "5a", "5d"
                strSql = strSql & ", " & strTablePrefix & "TOPICS.T_LAST_POST"
        CASE else
                strSql = strSql & ", " & strTablePrefix & "TOPICS.T_LAST_POST"
End SELECT

If InStr(1, sortorder, "a", 1) Then
        strSql = strSql & " ASC"
        SortImg = "" & strImageURL & "icon_sortUP.gif"
Else
        strSql = strSql & " DESC"
        SortImg = "" & strImageURL & "icon_sortDOWN.gif"
End if
'############################################
if strDBType = "mysql" then ' ### MySql 数据库特定代码
        if mypage > 1 then
                intOffset = CInt((mypage-1) * strPageSize)
                strSql = strSql & " LIMIT " & intOffset & ", " & strPageSize & " "
        end if

        '## Forum_SQL - Get the total pagecount
        strSql2 = "SELECT COUNT(" & strTablePrefix & "TOPICS.TOPIC_ID) AS PAGECOUNT "
        strSql2 = strSql2 & " FROM " & strTablePrefix & "TOPICS "
        strSql2 = strSql2 & " WHERE   " & strTablePrefix & "TOPICS.TOPIC_ID > 0 "
        strSql2 = strSql2 & " AND " & strTablePrefix & "TOPICS.FORUM_ID = " & Request.QueryString("FORUM_ID") & " "
        if nDays = "-1" then
                strSql2 = strSql2 & " AND   " & strTablePrefix & "TOPICS.T_STATUS <> 0 "
        end if
        if nDays > "0" then
                if OlderThan = "1" then
                        strSql2 = strSql2 & " AND " & strTablePrefix & "TOPICS.T_LAST_POST < '" & defDate & "'"
                else
                        strSql2 = strSql2 & " AND " & strTablePrefix & "TOPICS.T_LAST_POST > '" & defDate & "'"
                end if
        end if

        set rsCount = my_Conn.Execute(strSql2)
        if not rsCount.eof then
                maxpages = (rsCount("PAGECOUNT") \ strPageSize )
                        if rsCount("PAGECOUNT") mod strPageSize <> 0 then
                                maxpages = maxpages + 1
                        end if
        else
                maxpages = 0
        end if

        rsCount.close
       
        set rs = Server.CreateObject("ADODB.Recordset")
'        RS.cachesize=20

        RS.open  strSql, my_Conn, 3
        if not (RS.EOF or RS.BOF) then
                RS.movefirst
        end if

else 'end MySql specific code

        set rs = Server.CreateObject("ADODB.Recordset")
'        RS.cachesize=20

        RS.open  strSql, my_Conn, 3
        if not (RS.EOF or RS.BOF) then
                RS.MoveFirst

                RS.PageSize = strPageSize
                RS.CacheSize = RS.PageSize
                maxPages = cint(RS.PageCount)
                maxRecs = cint(RS.PageSize)
                If myPage > RS.PageCount Then
                        myPage = RS.PageCount
                end if
                RS.AbsolutePage = myPage

                StartPageNum=1
                do while StartPageNum + 10 <= myPage
                        StartPageNum = StartPageNum + 10
                Loop
                EndPageNum = StartPageNum+9
                If EndPageNum > RS.Pagecount then EndPageNum = RS.Pagecount
        end if
       
end if

'## Forum_SQL - Get all Forum Categories From DB
'## strSql = "SELECT CAT_ID FROM " & strTablePrefix & "CATEGORY"

'## set rsCat = my_Conn.Execute (StrSql)

'##################################
strForumUrl = Request.ServerVariables("SCRIPT_NAME")
strForumUrl = strForumUrl & "?FORUM_ID=" & Request.Querystring("FORUM_ID")
strForumUrl = strForumUrl & "&CAT_ID=" & Request.Querystring("CAT_ID")
'strForumUrl = strForumUrl & "&Forum_Title=" & Request.Querystring("Forum_Title")
%>
<script language="JavaScript">
<!-----
function jumpTo(s) {if (s.selectedIndex != 0) location.href = s.options[s.selectedIndex].value;return 1;}
function setDays(order)
{       
        if (order.search('a') > 0)
                document.DaysFilter.sortimg.value = '<% = strImageURL %>icon_sortUp.gif'
        else
                document.DaysFilter.sortimg.value = '<% = strImageURL %>icon_sortDown.gif';
        if (order != '')
                document.DaysFilter.newsort.value = order;
                document.DaysFilter.submit();
                return 0;
}
// -->
</script>
<%        if rsCStatus.EOF = true OR rsFStatus.EOF = true then
                Response.Redirect("default.asp")
        end if %>

<% '################################## %>
<%
if lCase(Request.Querystring("Mode"))<>"best" then
        strForumUrl = strForumUrl & "&Mode=best"
end if
%>
<table bgcolor="whitesmoke" border="0" width="<% = strTableWidth  %>" align=center>
    <td align="left" width="99%"><!--#INCLUDE FILE="inc_announce.asp" --></td>
  </tr>
</table>
</TD>
</TR>
</TABLE>
<% '################################## %>
<% if lCase(Request.Querystring("MODE"))<>"best" then %>
<%
'<!--#INCLUDE FILE="online.asp"--><!-- 显示在线人数 -->
%>
<%if rsCStatus.EOF = true OR rsFStatus.EOF = true then        Response.Redirect("default.asp")end if%> <br>
<table border="0" width="<% = strTableWidth  %>" cellspacing="0" cellpadding="2" align=center>
  <tr>
    <td width="33%" height="0" nowrap align="absmiddle">
    <a href="default.asp"><img src="<%=strImageURL %>icon_homepage.gif" alt="返回论坛首页" height=15 width=15 border="0"></a>&nbsp;<a href="main.asp">论坛首页</a>&nbsp; <span class="chinese">&gt;&gt;</span>&nbsp;<a href="forum.asp?FORUM_ID=<% =Request.QueryString("forum_id")%>&cat_id=<% =Request.QueryString("cat_id") %>"><% =SubForumTitle %></a>
    </td>
    <td align="center"  valign="bottom" nowrap width="33%" >版主:<% if (listForumModerators(Request.QueryString("FORUM_ID")) <> "") then Response.Write(listForumModerators(Request.QueryString("FORUM_ID"))) else Response.Write("暂无") end if %></td>
    <td align="right" width="34%">
<% if (mlev = 4 or mlev = 3 or mlev = 2 or mlev = 1) or (lcase(strNoCookies) = "1") or (Request.Cookies(strCookieURL & "User")("Name") = "" or Request.Cookies(strCookieURL & "User")("Pword") = "") then %>
                <right><% call PostNewTopic() %></right>      
<% else %>
        &nbsp;
<% end if %>
   </td>
  </tr>
</table>
<% end if %>
<TABLE border="0" width="<% = strTableWidth  %>" cellspacing=1 cellpadding=3 align=center bgcolor="#333333">
  <TR bgcolor="<% =strHeadCellColor %>">

    <% '############################################ %>
    <TD width=0% align="center"><b><font color="<% = strHeadFontColor %>"><img name="SortImg" src="<% =  sortimg %>"  border="0" alt="" width=0 height=0></font></b><b></b></TD>
   
    <TD align="left" width=45%><b>
      <% if sortorder = "1d" then %>
      <a href="javascript:setDays('1a')">
      <% else %><a href="javascript:setDays('1d')">
      <% end if %><font color="<% = strHeadFontColor %>">
      主 题</a></font> </b> <% '############################################ %> <% if (AdminAllowed > 0) or (lcase(strNoCookies) = "1") then %> <b>
      <% call ForumAdminOptions() %>
      </b> <% end if %> </TD>
    <TD align="center" width=14%> <b>
      <% if sortorder = "2d" then %>
      <a href="javascript:setDays('2a')">
      <% else %><a href="javascript:setDays('2d')">
      <% end if %>
      <font color="<% = strHeadFontColor %>">作者</font></A> </b> </TD>
    <TD align="center" width=4%> <b>
      <% if sortorder = "3d" then %>
      <a href="javascript:setDays('3a')">
      <% else %><a href="javascript:setDays('3d')">
      <% end if %>
      <font color="<% = strHeadFontColor %>">回复</font></A> </b> </TD>
    <TD align="center" width=4%> <b>
      <% if sortorder = "4d" then %>
      <a href="javascript:setDays('4a')">
      <% else %><a href="javascript:setDays('4d')">
      <% end if %>
      <font color="<% = strHeadFontColor %>">点击</font></A> </b> </TD>
    <TD align="center" width=25%> <b>
      <% if sortorder = "5d" then %>
      <a href="javascript:setDays('5a')">
      <% else %><a href="javascript:setDays('5d')">
      <% end if %>
      <font color="<% = strHeadFontColor %>">最后发表</font></A> </b> </TD>
  </TR>
  <% if RS.EOF or RS.BOF then %>
  <TR>
    <TD colspan="7" bgcolor="#F5F6F8"><b>没有找到任何主题</b></TD>
  </TR>
  <% else%>
  <%rec = 1
        do until RS.EOF or (rec = strPageSize + 1) %>
  <TR>
    <TD width="3%" align=center valign="center" bgcolor="white"><a href="topic.asp?TOPIC_ID=<% = rs("TOPIC_ID") %>&FORUM_ID=<% = Request.QueryString("FORUM_ID") %>&CAT_ID=<% = Request.QueryString("CAT_ID") %>">
      <%
            if rs("T_INPLACE") <> 1 then
                if rsCStatus("CAT_STATUS") <> 0 and rsFStatus("F_STATUS") <> 0 and rs("T_STATUS") <> 0 then
                        Response.Write (ChkIsNew(rs("T_LAST_POST"),rs("T_POLL")))
                else
                        if rs("T_LAST_POST") > Session(strCookieURL & "last_here_date") then
                                Response.Write "<img src=""" & strImageURL & "icon_folder_locked_new_topic.gif"" border=0 hspace=0 alt=""主题已锁定"">"
                        else
                                Response.Write "<img src=""" & strImageURL & "icon_folder_locked_new_topic.gif"" border=0 hspace=0 alt=""主题已锁定"">"
                        end if
                end if
            else
                Response.Write "<img src=""" & strImageURL & "icon_locktop.gif"" border=0 hspace=0 alt=""被固定在顶端的主题"">"
            end if %>
      </a> </TD>
    <%
        ' ### strSubject = ChkString(left(rs("T_SUBJECT"), 34),"display")
        strTopicPaging = false
        strSubject = rs("T_SUBJECT")
        if strLen(strSubject) > 26 then
                strSubject = Left(rs("T_SUBJECT"), 26) & "..."
                strTopicPaging = true
        end if
%>
   
        <TD  bgcolor="white"  valign="center" align="left" >
<% if RS("T_FILENAME")<>"" then %>
        <a href="Mods/usr/<% =RS("T_FILENAME") %>" target=_blank>
        <% if lCase(Right(RS("T_FILENAME"),4)) = ".jpg" or lCase(Right(RS("T_FILENAME"),4)) = ".gif" then %>
        <img src="<% =strImageURL %>addongif.gif" border=0></a>
        <%else%>
        <img src="<% =strImageURL %>icon_addicon.gif" width=10 alt="该主题有一个附件,点击下载" border=0></a>
        <% end if %>
<% end if %>
<a href="topic.asp?TOPIC_ID=<% =rs("TOPIC_ID") %>&FORUM_ID=<% =Request.QueryString("FORUM_ID") %>&CAT_ID=<% =Request.QueryString("CAT_ID") %>"><% =strSubject %></a>
<%
        if strShowPaging = "1" then
                call TopicPaging()
        end if
        Response.Write AdminFunction()
%>        </TD>
        <TD bgcolor="<% = strForumCellColor %>" valign="center" align="center"><font color="<% = strForumFontColor %>"><A href="pop_profile.asp?mode=display&id=<% = RS("T_AUTHOR") %>"><% = ChkString(rs("M_NAME"),"display") %></A></font></TD>
        <TD bgcolor="white" valign="center" align="center"><font color="<% = strForumFontColor %>"><% = rs("T_REPLIES") %></font></TD>
        <TD bgcolor="<% =strForumCellColor %>" valign="center" align="center"><font color="<% = strForumFontColor %>"><% = rs("T_VIEW_COUNT") %></font></TD>

<%        strLastAuthor = "<FONT COLOR=#666666> by: </FONT>"
        if IsNull(rs("T_LAST_POST_AUTHOR")) OR rs("T_REPLIES")=0 then
                strLastAuthor = strLastAuthor & "no reply"
        else
                if strUseExtendedProfile then
                        strLastAuthor = strLastAuthor & "<A href=""pop_profile.asp?mode=display&id="& rs("T_LAST_POST_AUTHOR") & """>"
                else
                        strLastAuthor = strLastAuthor & "<A href=""JavaScriptpenWindow2('pop_profile.asp?mode=display&id=" & rs("T_LAST_POST_AUTHOR") & "')"">"
                end if
                strLastAuthor = strLastAuthor & rs("LAST_POST_AUTHOR_NAME") & "</A>"
        end if %>
        <TD bgcolor="white" nowrap><img src="images/icon_post.gif" ) gray" border=0 align="absmiddle"><span class="english"><font color="<% = strForumFontColor %>"><% = " " & ChkDate(rs("T_LAST_POST")) %> <% = ChkTimeShort(rs("T_LAST_POST")) %></font></span><% = strLastAuthor %></font></TD>
        </TR>
       
<%                rec = rec + 1
                RS.MoveNext
        loop
end if
%>
</TABLE>

<!-- 主题列表结束 -->

<tr>
    <td colspan="6">
<TABLE border="0" Align="center" cellspacing=0 cellpadding=0 height="30" width="<% = strTableWidth %>">
<TR>
<TD align="left" width=33% ><% if maxpages > 1 then %>
    <table border=0 align="left">
      <tr>
        <td align="left" width=33%>本版共有主题 <b><% =maxpages %></b> 页: </td>
        <td valign="top"><% Call Paging() %></td>
      </tr>
    </table>
<% else %>
本版只有1页
<% end if %></TD>

<table width="<%=strtablewidth%>" border=0 cellspacing=0 cellpadding=0 align="center">

<FORM action="<% = Request.ServerVariables("SCRIPT_NAME") & "?" & Request.Querystring %>" method="post" name="DaysFilter">
<INPUT type="hidden" name="newsort" value="<% = SortOrder %>">
<INPUT type="hidden" name="sortimg" value="<% = SortImg %>">
<INPUT type="hidden" name="Cookie" value="1">
<!-- <br><INPUT type="Checkbox" name="OlderThan" value ="1" <% if OlderThan = "1" then Response.Write(" checked")%> onclick="javascript:setDays('5a');">显示日期之外的主题 -->
<TD align="left" nowrap width="33%" Align="center">
      <SELECT name="Days" onchange="javascript:setDays('5a');" class="editbox3">
      <option value="0" <% if ndays = "0" then Response.Write(" SELECTED")%>>显示所有主题</option>
      <option value="-1" <% if ndays = "-1" then Response.Write(" SELECTED")%>>显示所有开放的主题</option>
      <option value="1" <% if ndays = "1" then Response.Write(" SELECTED")%>>显示一天内的主题</option>
      <option value="2" <% if ndays = "2" then Response.Write(" SELECTED")%>>显示两天内的主题</option>
      <option value="5" <% if ndays = "5" then Response.Write(" SELECTED")%>>显示五天内的主题</option>
      <option value="7" <% if ndays = "7" then Response.Write(" SELECTED")%>>显示一周内的主题</option>
      <option value="14" <% if ndays = "14" then Response.Write(" SELECTED")%>>显示两周内的主题</option>
      <option value="30" <% if ndays = "30" then Response.Write(" SELECTED")%>>显示一个月内的主题</option>
      <option value="60" <% if ndays = "60" then Response.Write(" SELECTED")%>>显示两个月内的主题</option>
      <option value="120" <% if ndays = "120" then Response.Write(" SELECTED")%>>显示四个月内的主题</option>
      <option value="365" <% if ndays = "365" then Response.Write(" SELECTED")%>>显示一年内的主题</option>
    </SELECT>
<input type="Checkbox" name="OlderThan" value ="1" <% if OlderThan = "1" then Response.Write(" checked")%> onclick="javascript:setDays('5a');">
显示所选日期之外的主题
</TD>
</FORM>
      <td align="right" width=33% valign="top">
快速通道:
<!--#INCLUDE FILE="inc_jump_to.asp" -->
    </td>
</TR>
</TABLE>
<%
        if lCase(Request.Querystring("MODE"))<>"best" then
%>

<TR><TD bgcolor="#F5F6F8" colspan=6>

<TABLE cellspacing=0 cellpadding=0 width="<%=STRTABLEWIDTH%>" border=0 height=50 align=center>
<tr><td><img src=images/icon_folder_general.gif align=absmiddle> 开放的主题&nbsp;
<img src=images/icon_folder_hot.gif align=absmiddle> 回复超过10贴&nbsp;
<img src=images/icon_folder_locked.gif align=absmiddle> 锁定的主题&nbsp;
<img src=images/icon_folder_top.gif align=absmiddle> 固定顶端的主题&nbsp;
<img src=images/icon_folder_archive.gif align=absmiddle> 精华帖子&nbsp;
<img src=images/icon_poll.gif align=absmiddle> 投票帖子&nbsp;</td>
  </tr>
</table>

<%        end if %>
<!--#INCLUDE FILE="inc_footer.asp" -->
<%
Function ChkIsNew(dt,dt2)

if lCase(Request.Querystring("Mode"))="best" then
        ChkIsNew = "<img src='" & strImageURL & "icon_jh.gif' border=0 alt=""精华"">"
else
    if dt2 ="1" then
        ChkIsNew = "<img src='" & strImageURL & "icon_poll.gif' border=0 alt=""投票"">"
        else
        if lcase(strHotTopic) = "1" then
                if dt > Session(strCookieURL & "last_here_date") then
                        if rs("T_REPLIES") >= intHotTopicNum Then
                                ChkIsNew =  "<img src='" & strImageURL & "icon_folder_hot_new.gif' border=0 hspace=0 alt='新热点主题'>"
                        else
                                ChkIsNew =  "<img src='" & strImageURL & "icon_folder_topic_new.gif' border=0 hspace=0 alt='新主题'>"
                        end if
                Else
                        if rs("T_REPLIES") >= intHotTopicNum Then
                                ChkIsNew =  "<img src='" & strImageURL & "icon_folder_topc_hot_new.gif' border=0 hspace=0 alt='热点主题'>"
                        else
                                ChkIsNew = "<img src='" & strImageURL & "icon_folder_topic_old.gif' border=0>"
                        end if
                end if
        else
                if dt > Session(strCookieURL & "last_here_date") then
                        ChkIsNew =  "<img src='" & strImageURL & "icon_folder_topic_new.gif' border=0 hspace=0 alt='新主题'>"
                Else
                        ChkIsNew = "<img src='" & strImageURL & "icon_folder_topic_old.gif' border=0>"
                end if
        end if
        end if
end if
End Function

sub PostNewTopic()
%>
<%
'############### 读/写 权限 ###########################
if cInt(strPrivateForums) < 11 or AdminAllowed = 1 then
        if rsCStatus("CAT_STATUS") = 0 or rsFStatus("F_STATUS") = 0 then
                if (AdminAllowed = 1) then %>
                        <a href="post.asp?method=Topic&FORUM_ID=<% = Request.QueryString("FORUM_ID")%>&CAT_ID=<% = Request.QueryString("CAT_ID")%> %>"><img src="<% = strImageURL %>newthread.gif" alt="发表新主题" align="absmiddle" border=0></a>
                        <a href="post.asp?method=Topic&poll=yes&FORUM_ID=<% = Request.QueryString("FORUM_ID")%>&CAT_ID=<% = Request.QueryString("CAT_ID")%>"><img src="<% = strImageURL %>newpoll.gif" alt="发表新投票"align="absmiddle"  border=0></a>

<%                else %>
                        &nbsp;分类已锁定
<%                end if
        else
                if rsFStatus("F_STATUS") <> 0 then %>
                        <a href="post.asp?method=Topic&FORUM_ID=<% = Request.QueryString("FORUM_ID")%>&CAT_ID=<% = Request.QueryString("CAT_ID")%>"><img src="<% = strImageURL %>newthread.gif" alt="发表新主题" align="absmiddle" border=0></a>
                        <a href="post.asp?method=Topic&poll=yes&FORUM_ID=<% = Request.QueryString("FORUM_ID")%>&CAT_ID=<% = Request.QueryString("CAT_ID")%>"><img src="<% = strImageURL %>newpoll.gif" alt="发表新投票" align="absmiddle" border=0></a>

<%                else %>
                        &nbsp;论坛已锁定
<%                end if
        end if
else
        SELECT CASE cInt(strPrivateForums)
                CASE 10
                        Response.Write "只有管理员和版主可以在本论坛回复主题"
                CASE 11
                        Response.Write "只有管理员和版主可以在本论坛发表新主题"
                CASE 12
                        Response.Write "这是一个加密论坛,无法发表"
                CASE else
        END SELECT
end if%>
<%
end sub

sub ForumAdminOptions()

        if lCase(Request.Querystring("MODE"))<>"best" then
%>
<font face="<% = strDefaultFontFace %>" size="<% = strDefaultFontSize %>">
<%        if (AdminAllowed = 1) or (lcase(strNoCookies) = "1") then
                if rsCStatus("CAT_STATUS") = 0 then
                        if mlev = 4 then %>
                                <a href="pop_open.asp?mode=Category&CAT_ID=<% = Request.QueryString("CAT_ID") %>" onClick="return openAdminWindow(this.href)"><img src="<% = strImageURL %>icon_unlock.gif" alt="解开分类锁定" border=0></a>
<%                        end if
                else
                        if rsFStatus("F_STATUS") <> 0 then %>
                                <a href="pop_lock.asp?mode=Forum&FORUM_ID=<% = Request.QueryString("FORUM_ID") %>&CAT_ID=<% = Request.QueryString("CAT_ID") %>" onClick="return openAdminWindow(this.href)"><img src="<% = strImageURL %>icon_lock.gif" alt="锁定讨论区" border=0></a>
<%                        else %>
                                <a href="pop_open.asp?mode=Forum&FORUM_ID=<% = Request.QueryString("FORUM_ID") %>&CAT_ID=<% = Request.QueryString("CAT_ID") %>" onClick="return openAdminWindow(this.href)"><img src="<% = strImageURL %>icon_unlock.gif" alt="解开讨论区锁定" border=0></a>
<%                        end if
                end if
                if (rsCStatus("CAT_STATUS") <> 0 and rsFStatus("F_STATUS") <> 0) or (AdminAllowed = 1) then %>
                        <a href="post.asp?method=EditForum&FORUM_ID=<% = Request.QueryString("FORUM_ID") %>&CAT_ID=<% = Request.QueryString("CAT_ID") %>&type=0"><img src="<% = strImageURL %>icon_pencil.gif" alt="编辑讨论区属性" border="0" hspace="0"></a>
<%                end if %>
<%                if (mlev = 4) or (lcase(strNoCookies) = "1") then  %>
                <a href="pop_delete.asp?mode=Forum&FORUM_ID=<% = Request.QueryString("FORUM_ID") %>&CAT_ID=<% = Request.QueryString("CAT_ID") %>" onClick="return openAdminWindow(this.href)"><img src="<% = strImageURL %>icon_trashcan.gif" alt="删除讨论区" border=0></a>
<%                end if %>
<%        end if %>
</font>
<%
        end if
end sub

Function AdminFunction()
if lCase(Request.Querystring("MODE"))<>"best" then
        AdminFunction = ""
        if AdminAllowed = 1 or strNoCookies = "1" then
                AdminFunction = "<DIV align=right style=""color:" & strHeadCellColor & """>|"
                AdminFunction = AdminFunction & "<a href=""pop_lock.asp?mode=Best&TOPIC_ID=" & rs("TOPIC_ID") & "&FORUM_ID=" & rs("FORUM_ID") & "&CAT_ID=" & Request.QueryString("CAT_ID") & """ onClick=""return openAdminWindow(this.href)"" style=""color:" & strHeadCellColor & """>精</A>|"

                if rsCStatus("CAT_STATUS") = 0 then
                        AdminFunction = AdminFunction & "<a href=""pop_open.asp?mode=Category&CAT_ID=" & Request.QueryString("CAT_ID") & """ onClick=""return openAdminWindow(this.href)"" style=""color:" & strHeadCellColor & """>解</a>|"
                else
                        if rsFStatus("F_STATUS") = 0 then
                                AdminFunction = AdminFunction & "<a href=""pop_open.asp?mode=Forum&FORUM_ID=" & Request.QueryString("FORUM_ID") & "&CAT_ID=" & Request.QueryString("CAT_ID") & """ onClick=""return openAdminWindow(this.href)"" style=""color:" & strHeadCellColor & """>解</a>|"
                        else
                                if rs("T_STATUS") <> 0 then
                                        AdminFunction = AdminFunction & "<a href=""pop_lock.asp?mode=Topic&TOPIC_ID=" & rs("TOPIC_ID") & "&FORUM_ID=" & rs("FORUM_ID") & "&CAT_ID=" & Request.QueryString("CAT_ID") & """ onClick=""return openAdminWindow(this.href)"" style=""color:" & strHeadCellColor & """>锁</a>|"
                                else
                                        AdminFunction = AdminFunction & "<a href=""pop_open.asp?mode=Topic&TOPIC_ID=" & rs("TOPIC_ID")& "&FORUM_ID=" & rs("FORUM_ID") & "&CAT_ID=" & Request.QueryString("CAT_ID") & """ onClick=""return openAdminWindow(this.href)"" style=""color:" & strHeadCellColor & """>解</a>|"
                                end if
                        end if
                end if
                if (AdminAllowed = 1) or (rsCStatus("CAT_STATUS") <> 0 and rsFStatus("F_STATUS") <> 0 and rs("T_STATUS") <> 0) then
                        If rs("T_INPLACE")<>0 Then
                                AdminFunction = AdminFunction & "<a href=""pop_open.asp?mode=LockTop&TOPIC_ID=" & rs("TOPIC_ID") & "&FORUM_ID=" & rs("FORUM_ID") & "&CAT_ID=" & Request.QueryString("CAT_ID") & """ onClick=""return openAdminWindow(this.href)"" style=""color:" & strHeadCellColor & """>活</a>|"
                        else
                                AdminFunction = AdminFunction & "<a href=""pop_lock.asp?mode=LockTop&TOPIC_ID=" & rs("TOPIC_ID") & "&FORUM_ID=" & rs("FORUM_ID") & "&CAT_ID=" & Request.QueryString("CAT_ID") & """ onClick=""return openAdminWindow(this.href)"" style=""color:" & strHeadCellColor & """>固</a>|"
                        end if
                        AdminFunction = AdminFunction & "<A href=""post.asp?method=EditTopic&TOPIC_ID=" & rs("TOPIC_ID") & "&FORUM_ID=" & rs("FORUM_ID") & "&CAT_ID=" & rs("CAT_ID") & "&AUTH=" & ChkString(rs("T_AUTHOR"),"urlpath") & """ style=""color:" & strHeadCellColor & """>改</a>|"
                        AdminFunction = AdminFunction & "<A href=""post.asp?method=EditTopic&TOPIC_ID=" & rs("TOPIC_ID") & "&FORUM_ID=" & rs("FORUM_ID") & "&CAT_ID=" & rs("CAT_ID") & "&AUTH=" & ChkString(rs("T_AUTHOR"),"urlpath") & """ style=""color:" & strHeadCellColor & """>移</a>|"
                end if
                AdminFunction = AdminFunction & "<a href=""pop_delete.asp?mode=Topic&TOPIC_ID=" & rs("TOPIC_ID") & "&FORUM_ID=" & rs("FORUM_ID") & "&CAT_ID=" & Request.QueryString("CAT_ID")
                if RS("T_FILEID")<>"" and RS("T_FILENAME")<>"" then
                        AdminFunction = AdminFunction & "&FILE_ID=" & RS("T_FILEID")
                        AdminFunction = AdminFunction & "&FILE_NAME=" & RS("T_FILENAME")
                end if
                AdminFunction = AdminFunction & """ onClick=""return openAdminWindow(this.href)"" style=""color:" & strHeadCellColor & """>删</a>|"
                AdminFunction = AdminFunction & "<a href=""post.asp?method=Reply&TOPIC_ID=" & rs("TOPIC_ID") & "&FORUM_ID=" & rs("FORUM_ID") & "&CAT_ID=" & Request.QueryString("CAT_ID") & """ style=""color:" & strHeadCellColor & """>复</a>|"
                AdminFunction = AdminFunction & "</DIV>"
        end if
end if
End Function

sub Paging()
        if maxpages > 1 then
                sScriptName = Request.ServerVariables("script_name")

                ref2 = "&FORUM_ID=" & Request.QueryString("FORUM_ID")
                ref2 = ref2 & "&CAT_ID=" & Request.QueryString("CAT_ID")
                ref2 = ref2 & "&Forum_Title=" & ChkString(Request.QueryString("FORUM_TITLE"),"urlpath")

                '####################################
                if sortorder <> "" then
                        ref2 = ref2 & "&sort=" & sortorder
                end if
                if lCase(Request.Querystring("MODE"))="best" then
                        ref2 = ref2 & "&MODE=best"
                end if
                '####################################

                ref = ""
                if myPage-10 > 0 then
                        ref = ref & "<td bgcolor=#E4E4E4><A HREF=""" & sScriptName
                        ref = ref & "?whichpage=" & StartPageNum - 1
                        ref = ref & ref2
                        ref = ref & """><img src=images/pp_d.gif border=0></a></td>"
                else
                    ref = ref & "<td  bgcolor=#E4E4E4><IMG SRC=images/pp_d.gif BORDER=0></td>"

                end if

                For I = StartPageNum to EndPageNum
                        if I <> myPage then
                                ref = ref & "<td bgcolor=#E4E4E4>&nbsp;<A href=""" & sScriptName & "?whichpage=" & I
                                ref = ref & ref2
                                ref = ref & """><b>" & I & "</b></a>&nbsp;</td>"
                        else
                                ref = ref & "<td  bgcolor=#5D7790>&nbsp;<font face=" & strDefaultFontFace & " size=" & strDefaultFontSize & " color=#ffffff ><b>" & I & "</b></FONT>&nbsp;</td>"
                        end if
                Next

                if EndPageNum < maxpages then
                        ref = ref & "<td bgcolor=#E4E4E4><A href=""" & sScriptName & "?whichpage=" & EndPageNum + 1
                        ref = ref & ref2
                        ref = ref & """><IMG SRC=images/np.gif BORDER=0 ></a></td>"
                else
                    ref = ref & "<td bgcolor=#E4E4E4><IMG SRC=images/np_d.gif BORDER=0></td>"
                end if
                ref = ref & ""
                str_Table = "<TABLE border=0  cellspacing=0 cellpadding=0 align=""left"">" & vbCrLf & "<TR><td></td>" & vbCrLf
                str_Table = str_Table & "<td bgcolor=#B4B4B4><table border=0 cellspacing=1 cellpadding=0><tr align=center>"
                str_Table = str_Table & "<font face=" & strDefaultFontFace & " size=" & strDefaultFontSize & ">" & ref & "</font></TD>" & vbCrLf & "</tr></table></td></tr></table>"
        else
                str_Table = "<TABLE border=0 align=""left"">" & vbCrLf & "<TR>" & vbCrLf
                str_Table = str_Table & "<TD valign=""top"" align=""left""><font face=" & strDefaultFontFace & " size=" & strDefaultFontSize & ">本论坛只有一页</font></TD>" & vbCrLf & "</TR>" & vbCrLf & "</TABLE>" & vbCrLf
        end if
        Response.Write str_Table
        set str_Table = Nothing
end sub

sub TopicPaging()
        strPageSizeTemp = strPageNumberSize
        mxpages = (RS("T_REPLIES")) / strPageSizeTemp
        if mxPages <> cInt(mxPages) then
                mxpages = Int(mxPages) + 1
        end if
        if mxpages > 1 then
                if strTopicPaging then
                        Response.Write("<br>")
                end if
                Response.Write("&nbsp;&nbsp;<img src=images/multipage.gif align=absmiddle  alt='多页'>")
                for counter = 1 to mxPages
                        ref = ""
                        if ((mxpages > 9) and (mxpages > strPageSizeTemp)) or ((counter > 9) and (mxpages < strPageSizeTemp)) then
                                ref = ref & "&nbsp;"
                        end if               
                        ref = ref & widenum(counter) & "<a href='topic.asp?"
                        ref = ref & "TOPIC_ID=" & rs("TOPIC_ID")
                        ref = ref & "&FORUM_ID=" & rs("FORUM_ID")
                        ref = ref & "&CAT_ID=" & rs("CAT_ID")
                        ref = ref & "&Topic_Title=" & ChkString(left(rs("T_SUBJECT"), 50),"urlpath")
                        ref = ref & "&Forum_Title=" & ChkString(Request.QueryString("FORUM_Title"),"urlpath")
                        ref = ref & "&whichpage=" & counter
                        '############################################
                        if sortorder <> "" then
                                ref = ref & "&sort=" & sortorder
                        end if
                        '############################################
                        ref = ref & "'>[" & counter & "]</a>"
                        Response.Write ref
                        if counter mod strPageSizeTemp = 0 then
'                                Response.Write("</TR><TR><TD>&nbsp;</TD>")
                        end if
                next
        Response.Write("&nbsp;")
        end if
end sub
%>



############### 读/写 权限 ###########################
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|Archiver|手机版|blueidea.com ( 湘ICP备12001430号 )  

GMT+8, 2020-7-14 12:48 , Processed in 0.093512 second(s), 8 queries , Gzip On, Memcache On.

Powered by Discuz! X3.2 Licensed

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表