标题:大家好,请帮我看看这个应该如何改啊
只看楼主
xing0724
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2011-10-18
结帖率:100%
已结贴  问题点数:10 回复次数:8 
大家好,请帮我看看这个应该如何改啊
<%
dim connstrItem
dim dbItem
dim connItem
dbItem="../data/db.mdb"      '采集数据库文件的位置
'On Error Resume Next
Set connItem = Server.CreateObject("ADODB.Connection")
connstrItem="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(dbItem)
connItem.Open connstrItem
If Err Then
   err.Clear
   Set ConnItem = Nothing
   Response.Write "采集数据库连接出错,请检查连接字串。"
   Response.End
End If

Sub CloseConnItem()
   On Error Resume Next
   ConnItem.close
   Set ConnItem=nothing
End sub


'过滤超链接
Function ReplaceUrl2(HTMLstr)
Dim n,str1,str2,str3,str4
HTMLstr = Lcase(HTMLstr)
For n=1 to Ubound(Split(HTMLstr,"<a"))
str1 = Instr(HTMLstr,"<a")
str2 = Instr(str1,HTMLstr,">")
HTMLstr = left(HTMLstr,str1-1)&right(HTMLstr,len(HTMLstr)-len(left(HTMLstr,str2)))
HTMLstr = replace (HTMLstr,"</a>","")
ReplaceUrl2 = HTMLstr
Next
End Function

function searcheck(title)
   myArray = Array("多汗","皮肤","肤色","毛周角化")
   arraynum = ubound(myArray)
    forvar = len(title)
   title1 = title
   array1 = 0
   if forvar<=0 then
           forvar = ""
    end if
    for i = 1 to forvar
        for length = 1 to 4
             strtitle = mid(title,i,length)
              for array1 = 0 to arraynum
                  if strComp(strtitle,myArray(array1))=0 then
                    searcheck = myArray(array1)
                end if
            next
                title1 = strtitle
        next
    next
end function
function make_html(id,num)
On Error Resume Next
Pid = trim(id)
if pid = "" then response.End()
'response.Write pid
'response.End()
'Send = Trim(Request.Form("Send"))
'Call IsEn(Pid,"Pid值只能是数字",1)
Set Ceb_Rs = Conn.Execute("Select * From iHelp_Problem Where F_HelpId = " & Pid)
If not Ceb_Rs.Eof Then'Call Info("没有该问题",2,"./")
'response.End()
F_HelpId = Ceb_Rs("F_HelpId")
F_HelpTitle = Ceb_Rs("F_HelpTitle")
F_HelpContent = Ceb_Rs("F_HelpContent")
F_HelpComplement = Ceb_Rs("F_HelpComplement")
F_HelpEnclosure = Ceb_Rs("F_HelpEnclosure")
F_HelpiClsId = Ceb_Rs("F_HelpiClsId")
F_HelpeClsId = Ceb_Rs("F_HelpeClsId")
F_HelpsClsId = Ceb_Rs("F_HelpsClsId")
F_HelpuClsId = Ceb_Rs("F_HelpuClsId")
F_HelpCent = Ceb_Rs("F_HelpCent")
F_HelpUserId = Ceb_Rs("F_HelpUserId")
F_HelpDate = "发布时间:"& Ceb_Rs("F_HelpDate")
F_HelpBrowseNum = Ceb_Rs("F_HelpBrowseNum")
F_HelpAnswerNum = Ceb_Rs("F_HelpAnswerNum")
F_HelpCommentNum = Ceb_Rs("F_HelpCommentNum")
F_HelpRecommendationNum=Ceb_Rs("F_HelpRecommendationNum")
F_HelpSolve = Ceb_Rs("F_HelpSolve")
F_HelpValid = Ceb_Rs("F_HelpValid")
F_HelpVote = Ceb_Rs("F_HelpVote")
F_HelpVoteus = Ceb_Rs("F_HelpVoteus")
F_HelpVoteNum = Ceb_Rs("F_HelpVoteNum")
F_HelpCancel = Ceb_Rs("F_HelpCancel")
F_HelpCebCent = Ceb_Rs("F_HelpCebCent")
this_log_tags=Ceb_Rs("log_tags")
Set Ceb_Rs = Nothing

''======================调出该问题的所有信息
'If F_HelpCancel = 1 Then Call Info("该问题已被撤消",2,"./")
'If F_HelpSolve = 2 Then Call Info("该问题已结束",2,"./")
Conn.Execute("Update iHelp_Problem Set F_HelpBrowseNum = " & F_HelpBrowseNum + 1 & " Where F_HelpId = " & F_HelpId)
'=======================更新浏览量

Set Ceb_Rs = Conn.Execute("Select * From iHelp_Class Where F_ClsId = " & F_HelpiClsId)
iCebMyNav = " <a href='"& URL_ask &"ClsList.asp?Cid=" & F_HelpiClsId & "'>" & Ceb_Rs("F_ClsName") & "</a>"
Set Ceb_Rs = Nothing
Set Ceb_Rs = Conn.Execute("Select * From iHelp_Class Where F_ClsId = " & F_HelpeClsId)
iCebMyNav = iCebMyNav & " &gt <a href='"& URL_ask &"ClsList.asp?RowGo=isc&Isc=Solve&Cid=" & F_HelpeClsId & "'>" & Ceb_Rs("F_ClsName") & "</a>"
F_ClsName = Ceb_Rs("F_ClsName")
Set Ceb_Rs = Nothing
If F_HelpsClsId <> 0 Then
    Set Ceb_Rs = Conn.Execute("Select * From iHelp_Class Where F_ClsId = " & F_HelpsClsId)
    iCebMyNav = iCebMyNav & " &gt <a href='"& URL_ask &"ClsList.asp?RowGo=isc&Isc=Solve&Cid=" & F_HelpsClsId & "' class=a05>" & Ceb_Rs("F_ClsName") & "</a>"
    Set Ceb_Rs = Nothing
    If F_HelpuClsId <> 0 Then
        Set Ceb_Rs = Conn.Execute("Select * From iHelp_Class Where F_ClsId = " & F_HelpuClsId)
        iCebMyNav = iCebMyNav & " &gt <a href='"& URL_ask &"ClsList.asp?RowGo=isc&Isc=Solve&Cid=" & F_HelpuClsId & "' class=a05>" & Ceb_Rs("F_ClsName") & "</a>"
        Set Ceb_Rs = Nothing
    End If
End If
'====================================tags
iCebMyNavtags="<a href=../search.asp?key="&escape(this_log_tags)&">"&this_log_tags&"</a> &gt "&iCebMyNav&""

'=====================================分类显示

If F_HelpCommentNum <> 0 Then iCommentNum = "[" & F_HelpCommentNum & "]"
Set Ceb_Rs = Conn.Execute("Select * From iHelp_User Where F_HelpUserId = " & F_HelpUserId)
F_HelpUserName = Ceb_Rs("F_HelpUserName")
F_HelpUserSex = Ceb_Rs("F_HelpUserSex")
F_HelpUserScore = Ceb_Rs("F_HelpUserScore")
Set Ceb_Rs = Nothing
'=====================================评论数量
If F_HelpUserScore < 0 Then iUserScore = 0 Else iUserScore = F_HelpUserScore
Set Ceb_Rs = Conn.Execute("Select Top 1 * From iHelp_Grade Where F_HelpGradeCent <= " & iUserScore & " Order By F_HelpGradeId Desc")
If Ceb_Rs("F_HelpGradeCeb") = 1 Then
    UserGrades = Split(Ceb_Rs("F_HelpGradeName"),",")(Clng(F_HelpUserSex)-1)
Else
    UserGrades = Ceb_Rs("F_HelpGradeName")
End If
Set Ceb_Rs = Nothing
'====================================积分等级
Set Ceb_Rs = Conn.Execute("Select * From iHelp_Comment Where F_HelpProblemId = " & F_HelpId & " Order By F_HelpCommentId Desc")
If Not Ceb_Rs.Eof Then
    Do While Not Ceb_Rs.Eof
        Set Ceb_Rss = Conn.Execute("Select * From iHelp_User Where F_HelpUserId = " & Ceb_Rs("F_HelpCommentUserId"))
        oF_HelpUserNames = Ceb_Rss("F_HelpUserName")
        Set Ceb_Rss = Nothing
        CommentAsk = CommentAsk & "<table border='0' width='98%' align='center' cellpadding='0' cellspacing='0' style='table-layout:fixed;word-wrap:break-word;'><tr valign='top' style='padding:5px 0px 0px 5px;'><td width='140' class='f12 c9 lh13' nowrap>评论:<a href='"& URL_ask &"User.asp?Uid=" & Ceb_Rs("F_HelpCommentUserId") & "' target='_blank' class='a05'>" & oF_HelpUserNames & "</a><br><span class='hdsj'>" & Ceb_Rs("F_HelpCommentDate") & "</span></td><td class='fs13 lh15' style='padding-right:35px;word-break:break-all;'>" & Ceb_Rs("F_HelpCommentCountent") & "</td></tr><tr><td colspan='2' align='right' class='f12 c6' style='border-bottom:1px dashed #ccc;'>&nbsp;</td></tr></table>"
    Ceb_Rs.Movenext
    Loop
End If
Set Ceb_Rs = Nothing
'===================================显示评论

If F_HelpSolve = 0 Then
    DateValid  = F_HelpValid *86400
    TimeValid = DateDiff("s",F_HelpDate,Now())
    AuctionDate = DateValid-TimeValid
    If AuctionDate < 0 Then AuctionDate = 0
Else
    AuctionDate = 0
    AskSolve = 3
    AnswerAsk = 2
    MyAsk = 2
    YnVote = 2
    Report = 2
End If
If iCebLoginUserId = F_HelpUserId Then
    MyAsk = 1
    iMyAsks = 1
    NoMyAsks = 2
    AnswerAsk = 2
    Report = 2
    If F_HelpSolve = 1 Then
        Complementy = 2
        iSolves = 2
    Else
        Complementy = 1
        iSolves = 1
    End If
    MyAskOperation = 1
Else
    MyAsk = 2
    iMyAsks = 2
    NoMyAsks = 1
    Complementy = 2
    MyAskOperation = 2
    iSolves = 2
End If
Solvess = 1
If F_HelpAnswerNum = 0 Then
    iAnswer = 1
    YesAnswers = 2
    Ask_answertxt="<div class='askinfo infobg1'>抱歉,该问题暂时还没有人回答!</div>"
Else
    iAnswer = 2
    YesAnswers = 1
    Set Ceb_Rs = Conn.Execute("Select * From iHelp_Answer Where F_HelpAnswerAdopt = 1 And F_HelpAnswerWrong = 0 And F_HelpProblemId = " & F_HelpId)
    If Not Ceb_Rs.Eof Then
        iF_HelpUserIds = Ceb_Rs("F_HelpAnswerUserId")
        iF_HelpAnswerCommentNum = Ceb_Rs("F_HelpAnswerCommentNum")
        Set Ceb_Rss = Conn.Execute("Select * From iHelp_User Where F_HelpUserId = " & iF_HelpUserIds)
        iF_HelpUserNames = Ceb_Rss("F_HelpUserName")
        iF_HelpUserSexs = Ceb_Rss("F_HelpUserSex")
        iF_HelpUserScores = Ceb_Rss("F_HelpUserScore")
        Set Ceb_Rss = Nothing
        If iF_HelpUserScores < 0 Then iUserScore = 0 Else iUserScore = iF_HelpUserScores
        Set Ceb_Rss = Conn.Execute("Select Top 1 * From iHelp_Grade Where F_HelpGradeCent <= " & iUserScore & " Order By F_HelpGradeId Desc")
        If Ceb_Rss("F_HelpGradeCeb") = 1 Then
            iUserGradess = Split(Ceb_Rss("F_HelpGradeName"),",")(Clng(iF_HelpUserSexs)-1)
        Else
            iUserGradess = Ceb_Rss("F_HelpGradeName")
        End If
        Set Ceb_Rss = Nothing
        If iF_HelpAnswerCommentNum <> 0 Then eCommentNum = "[" & iF_HelpAnswerCommentNum & "]"
        iF_HelpAnswerDate = Ceb_Rs("F_HelpAnswerDate")
        iF_HelpAnswerContent = Ceb_Rs("F_HelpAnswerContent")
        iF_HelpAnswerId = Ceb_Rs("F_HelpAnswerId")
        iF_HelpAnswerEvaluate = Ceb_Rs("F_HelpAnswerEvaluate")
        iF_HelpAnswer3Q = Ceb_Rs("F_HelpAnswer3Q")
        zc=Ceb_Rs("F_zc")
        fd=Ceb_Rs("F_fd")
        Exactitudess = 1
        Exactitudes = 1
        MyAskOperation = 2
        If iF_HelpUserIds = iCebLoginUserId Then Solvess = 2
        Set Ceb_Rss = Conn.Execute("Select * From iHelp_Comment Where F_HelpAnswerId = " & iF_HelpAnswerId & " Order By F_HelpCommentId Desc")
        If Not Ceb_Rss.Eof Then
            Do While Not Ceb_Rss.Eof
                Set Ceb_Rsss = Conn.Execute("Select * From iHelp_User Where F_HelpUserId = " & Ceb_Rss("F_HelpCommentUserId"))
                oF_HelpUserNames = Ceb_Rsss("F_HelpUserName")
                Set Ceb_Rsss = Nothing
                eCommentAsk = eCommentAsk & "<table border='0' width='98%' align='center' cellpadding='0' cellspacing='0' style='table-layout:fixed;word-wrap:break-word;'><tr valign='top' style='padding:5px 0px 0px 5px;'><td width='140' class='f12 c9 lh13' nowrap>评论:<a href='"& URL_ask &"User.asp?Uid=" & Ceb_Rss("F_HelpCommentUserId") & "' target='_blank' class='a05'>" & oF_HelpUserNames & "</a><br><span class='hdsj'>" & Ceb_Rss("F_HelpCommentDate") & "</span></td><td class='fs13 lh15' style='padding-right:35px;word-break:break-all;'>" & Ceb_Rss("F_HelpCommentCountent")& "</td></tr><tr><td colspan='2' align='right' class='f12 c6' style='border-bottom:1px dashed #ccc;'>&nbsp;</td></tr></table>"
            Ceb_Rss.Movenext
            Loop
        End If
        Set Ceb_Rss = Nothing
    End If
    Set Ceb_Rs = Nothing
'======================================回答的问题
    Set Ceb_Rs = Conn.Execute("Select * From iHelp_Answer Where F_HelpAnswerAdopt = 0 And F_HelpAnswerWrong = 0 And answer_ischeck = 1 And F_HelpAnswerVote = 0 And F_HelpProblemId = " & F_HelpId & " Order By F_HelpAnswerId")
    if Ceb_Rs.EOF and Ceb_Rs.BOF then
    Ask_answertxt="<div class='askinfo infobg1'>抱歉,该问题暂时还没有人回答!</div>"
    else
    Do While Not Ceb_Rs.Eof
        F_HelpAnswerUserId = Ceb_Rs("F_HelpAnswerUserId")
        F_HelpAnswerCommentNum = Ceb_Rs("F_HelpAnswerCommentNum")
        if F_HelpAnswerUserId = 0 then
        F_HelpUserNames="匿名"
        F_HelpUserSexs="匿名"
        F_HelpUserScores=0
        F_zc = Ceb_Rs("F_zc")
        F_fd = Ceb_Rs("F_fd")
        else
        Set Ceb_Rss = Conn.Execute("Select * From iHelp_User Where F_HelpUserId = " & F_HelpAnswerUserId)
        F_HelpUserNames = Ceb_Rss("F_HelpUserName")
        F_HelpUserSexs = Ceb_Rss("F_HelpUserSex")
        F_HelpUserScores = Ceb_Rss("F_HelpUserScore")
        F_zc = Ceb_Rs("F_zc")
        F_fd = Ceb_Rs("F_fd")
        Set Ceb_Rss = Nothing
        end if
        If F_HelpUserScores < 0 Then iUserScore = 0 Else iUserScore = F_HelpUserScores
        Set Ceb_Rss = Conn.Execute("Select Top 1 * From iHelp_Grade Where F_HelpGradeCent <= " & iUserScore & " Order By F_HelpGradeId Desc")
        If Ceb_Rss("F_HelpGradeCeb") = 1 Then
            UserGradess = Split(Ceb_Rss("F_HelpGradeName"),",")(Clng(F_HelpUserSexs)-1)
        Else
            UserGradess = Ceb_Rss("F_HelpGradeName")
        End If
        Set Ceb_Rss = Nothing
        iUserScore = F_HelpUserScores
            Set Ceb_Rss = Conn.Execute("Select Top 1 * From iHelp_Grade Where F_HelpGradeCent <= " & iUserScore & " Order By F_HelpGradeId Desc")
            UserGradess = Ceb_Rss("F_HelpGradeName")
            Set Ceb_Rss = Nothing
            Ask_UserName = "<a href='"& URL_ask &"User.asp?uId=" & F_HelpAnswerUserId & "'>" & F_HelpUserNames & "</a>"
            Ask_Gradess = UserGradess
            Ask_Date = Ceb_Rs("F_HelpAnswerDate")
            Ask_Content = ReplaceUrl2(htmlcode(Ceb_Rs("F_HelpAnswerContent"),2)) '正文部分
                        if Ask_Content="" then Ask_Content = htmlcode(Ceb_Rs("F_HelpAnswerContent"),2)
            'Ask_Content = htmlcode(Ceb_Rs("F_HelpAnswerContent"),2)

                        'Ask_Content = htmlcode(Ceb_Rs("F_HelpAnswerContent"),2)
            Ask_answertxt = Ask_answertxt & "<div class='askinfo infobg'><dl style='float:left'><dt>回答:"&Ask_UserName&"</dt><dd>级别:专家</dd></dl><dl class='answer'><dt></dt><dd><p class='intro'>"&Ask_Content&"</p></dd><dd><span class='kfzx'>温馨提示:您可以在这里免费向医生在线咨询,<a target=_blank href=../../url.asp?url=http://dlt.点击这里向医生咨询</a></span></dd><dd>回复时间:"&Ask_Date&"</dd></dl></div>"
    Ceb_Rs.Movenext
    Loop
    End If
    Set Ceb_Rs = Nothing
End If
'===================================问题排行榜
    'strtitle = searcheck(F_HelpTitle)
    'Condition = "F_HelpTitle Like '%" & strtitle & "%'"

    Set Ceb_Rs = Conn.Execute("Select Top 10 * From iHelp_Problem Where F_HelpTitle like '%"&this_log_tags&"%' and F_HelpId<>"&Pid&" Order By F_HelpId Desc")
    If Ceb_Rs.Eof And Ceb_Rs.Bof Then
        YiJieJuTop = YiJieJuTop & "<li>暂无相关问题</li>"
    Else
        Do While Not Ceb_Rs.Eof
            I = I + 1
            YiJieJuTop = YiJieJuTop & "<li><a title="""&Ceb_Rs("F_HelpTitle")&""" href='" & URL_html & Ceb_Rs("F_HelpId") & ".html'>"
            YiJieJuTop = YiJieJuTop & left(Ceb_Rs("F_HelpTitle"),12) & "</a></li>"
        Ceb_Rs.Movenext
        Loop
    End If
    '最新10篇文章
    Set Ceb_clas = Conn.Execute("Select Top 10 * From iHelp_Problem where F_HelpId<"&Pid+5&" Order By F_HelpId Desc")
   
    If Ceb_clas.Eof And Ceb_clas.Bof Then
        classname = classname & "<li></li>"
    Else
        Do While Not Ceb_clas.Eof
            I = I + 1
            classname = classname & "<li>&middot;<a title="""&Ceb_clas("F_HelpTitle")&""" href='" & URL_html &Ceb_clas("F_HelpId") & ".html'>"
            classname = classname & left(Ceb_clas("F_HelpTitle"),16) & "</a></li>"
        Ceb_clas.Movenext
        Loop
    End If
    Set Ceb_Rs = Nothing
    '上一篇
    Set Ceb_up = Conn.Execute("Select Top 1 * From iHelp_Problem where F_HelpId >"& Pid &" Order By F_HelpId asc")   
    If Ceb_up.Eof And Ceb_up.Bof Then
        uptitle ="没有了"
    Else
        Do While Not Ceb_up.Eof
            I = I + 1
            uptitle = uptitle & "<a title="""&Ceb_up("F_HelpTitle")&""" href='" & URL_html &Ceb_up("F_HelpId") & ".html'>"
            uptitle = uptitle & Ceb_up("F_HelpTitle") & "</a>"
        Ceb_up.Movenext
        Loop
    End If
    Set Ceb_up = Nothing
    '下一篇
    Set Ceb_down = Conn.Execute("Select Top 1 * From iHelp_Problem where F_HelpId <"& Pid &" Order By F_HelpId desc")
   
    If Ceb_down.Eof And Ceb_down.Bof Then
        downtitle ="没有了"
    Else
        Do While Not Ceb_down.Eof
            I = I + 1
            downtitle = downtitle & "<a title="""&Ceb_down("F_HelpTitle")&""" href='" & URL_html &Ceb_down("F_HelpId") & ".html'>"
            downtitle = downtitle & Ceb_down("F_HelpTitle") & "</a>"
        Ceb_down.Movenext
        Loop
    End If
    Set Ceb_down = Nothing
        '最新文章
    Set Ceb_article = Connitem.Execute("Select Top 10 * From log_news where log_title like '%"&this_log_tags&"%' and log_html=1 and log_yz=1 Order By log_hot desc,id desc")
   
    If Ceb_article.Eof And Ceb_article.Bof Then
        article =""
    Else
        Do While Not Ceb_article.Eof
            I = I + 1
log_file=Ceb_article("log_file")
select case log_file
       case "1"
            log_file="html"
       case "2"
            log_file="item"
       case else
            log_file="article"
end select
            article = article & "<li>&middot;<a title="""&Ceb_article("log_title")&""" href='http://www.("id") & ".html'>"
            article = article & left(Ceb_article("log_title"),16) & "</a></li>"
        Ceb_article.Movenext
        Loop
    End If
    Set Ceb_article = Nothing


    islogin_html="<script src=""../login_js.asp""></script>"
    SiteTitle = F_HelpTitle
    Template = Templates("Template/moban_Top.Html") & Templates("Template/moban_ask.Html") & Templates("Template/moban_Bottom.Html")
    Template = Replace(Template,"{$Ask@SiteTitle}",SiteTitle)
    Template = Replace(Template,"{$Ask@titleclassname}",F_ClsName)
    Template = Replace(Template,"{$ask@Description}",F_HelpCebCent)
    Template = Replace(Template,"{$ask@keywords}",SiteTitle)
    Template = Replace(Template,"{$Ask@WebSite}",WebSite)
    Template = Replace(Template,"{$Ask@Body}",iBody)
    Template = Replace(Template,"{$Ask@iCebMyNav}",iCebMyNav)
    Template = Replace(Template,"{$Ask@iCebMyNavtags}",iCebMyNavtags)
    Template = Replace(Template,"{$Ask@ProblemId}",Pid)
    Template = Replace(Template,"{$Ask@UserId}",F_HelpUserId)
    Template = Replace(Template,"{$Ask@UserName}",F_HelpUserName)
    Template = Replace(Template,"{$Ask@UserGrades}",UserGrades)
    Template = Replace(Template,"{$Ask@AskCent}",F_HelpCent)
    Template = Replace(Template,"{$Ask@AnswerNum}",F_HelpAnswerNum)
    Template = Replace(Template,"{$Ask@AskSolve}",AskSolve)
    Template = Replace(Template,"{$Ask@AskTitle}",F_HelpTitle)
    Template = Replace(Template,"{$Ask@AskContent}",HtmlCode(F_HelpContent,2))
    Template = Replace(Template,"{$Ask@AuctionDate}",AuctionDate)
    Template = Replace(Template,"{$Ask@CommentAsk}",CommentAsk)
    Template = Replace(Template,"{$Ask@eCommentAsk}",eCommentAsk)
    Template = Replace(Template,"{$Ask@SessionC}",Session("AnswerContent" & Pid))
    Template = Replace(Template,"{$Ask@SessionR}",Session("AnswerReferto" & Pid))
    Template = Replace(Template,"{$Ask@AnswerAsk}",AnswerAsk)
    Template = Replace(Template,"{$Ask@MyAsk}",MyAsk)
    Template = Replace(Template,"{$Ask@Solves}",iSolves)
    Template = Replace(Template,"{$Ask@Complementy}",Complementy)
    Template = Replace(Template,"{$Ask@Complements}",Complements)
    Template = Replace(Template,"{$Ask@Complementss}",Complementss)
    Template = Replace(Template,"{$Ask@Enclosure}",Enclosure)
    Template = Replace(Template,"{$Ask@Enclosures}",Enclosures)
    Template = Replace(Template,"{$Ask@iEnclosure}",iEnclosure)
    Template = Replace(Template,"{$Ask@AskDate}",F_HelpDate)
    Template = Replace(Template,"{$Ask@Solvess}",Solvess)
    Template = Replace(Template,"{$Ask@YnVote}",YnVote)
    Template = Replace(Template,"{$Ask@iAnswer}",iAnswer)
    Template = Replace(Template,"{$Ask@Report}",Report)
    Template = Replace(Template,"{$Ask@iMyAsks}",iMyAsks)
    Template = Replace(Template,"{$Ask@NoMyAsks}",NoMyAsks)
    Template = Replace(Template,"{$Ask@YesAnswers}",YesAnswers)
    Template = Replace(Template,"{Ask@Ask_answertxt}",Ask_answertxt)
    Template = Replace(Template,"{$Ask@MyAskOperation}",MyAskOperation)
    Template = Replace(Template,"{$Ask@iF_HelpUserIds}",iF_HelpUserIds)
    Template = Replace(Template,"{$Ask@iF_HelpUserNames}",iF_HelpUserNames)
    Template = Replace(Template,"{$Ask@iUserGradess}",iUserGradess)
    Template = Replace(Template,"{$Ask@iF_HelpAnswerDate}",iF_HelpAnswerDate)
    Template = Replace(Template,"{$Ask@iF_HelpAnswerContent}",iF_HelpAnswerContent)
    Template = Replace(Template,"{$Ask@iF_HelpAnswerId}",iF_HelpAnswerId)
    Template = Replace(Template,"{$Ask@Evaluate}",iF_HelpAnswerEvaluate)
    Template = Replace(Template,"{$Ask@iF_HelpAnswer3Q}",iF_HelpAnswer3Q)
    Template = Replace(Template,"{$Ask@Exactitude}",Exactitudes)
    Template = Replace(Template,"{$Ask@Exactitudess}",Exactitudess)
    Template = Replace(Template,"{$Ask@iCebpl}",iCebpl)
    Template = Replace(Template,"{$Ask@UserScore}",iCebLoginUserScore)
    Template = Replace(Template,"{$Ask@UserGrade}",iCebLoginUserGrade)
    Template = Replace(Template,"{$Ask@YiJieJuTop}",YiJieJuTop)
    Template = Replace(Template,"{$Ask@classname}",classname)
    Template = Replace(Template,"{$Ask@iCommentNum}",iCommentNum)
    Template = Replace(Template,"{$Ask@eCommentNum}",eCommentNum)
    Template = Replace(Template,"{$ask@tuijian}",F_HelpRecommendationNum)
    Template = Replace(Template,"{$ask@islogin}",islogin_html)
    Template = Replace(Template,"{$Ask@F_zc}",zc)
    Template = Replace(Template,"{$Ask@F_fd}",fd)
    Template = Replace(Template,"{$Ask@uptitle}",uptitle)
    Template = Replace(Template,"{$Ask@downtitle}",downtitle)
    Template = Replace(Template,"{$Ask@article}",article)
HtmlNL=Template
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set fout = fso.CreateTextFile(server.mappath("html/"&pid&".html"))
fout.Write HtmlNL
fout.close
set fso = nothing
    if num = 1 then
    response.Write "<script>alert('操作成功');location='/html/"&pid&".html';</script>"
    end if
    'Response.Write "失败"
response.flush
Response.Clear
end if
end function
%>

其中红色部分是查询出最新的文章的代码,可是不管怎样修改sql语句,查出的总是以IE地址栏里面的http://localhost/ask/html/A.html最后面的A.html为基准,其中A为文章在数据库里面的F_HelpId,比如A=7606,那么查询出的10篇文章F_HelpId就是7608,7607,7606,7605,7604,7603,7602,7601,7600,7599,如果A=1606,那么查询出的10篇文章的F_HelpId就是1610,1609,1608,1607,1606,1605,1604,1603,1602,1601,现在实际上最大的ID是7620,我想查询出的10篇文章ID是7620,7619,7618,7617,7616,7615,7614,7613,7612,7611,请问这个要怎样改代码呢?在线等回答啊
搜索更多相关主题的帖子: 数据库连接 数据库文件 nothing 
2011-10-18 11:42
xing0724
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2011-10-18
得分:0 
有人在吗?怎么改呢
2011-10-18 13:06
cserwang
Rank: 3Rank: 3
等 级:论坛游侠
帖 子:25
专家分:162
注 册:2007-5-10
得分:10 
程序没有问题啊   红色的那段就是查询 当前id前5个 往后数10个啊   如果你当前id前面没有 那当然不能出现5个咯
比如你当前id是1606  那就该是1611,1610,1609,1608,1607,1606,1605,1604,1603,1602  如果说其中 1610 不存在的话 就成了1611,1609,1608,1607,1606,1605,1604,1603,1602 ,1601
2011-10-18 13:27
xing0724
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2011-10-18
得分:0 
回复 3楼 cserwang
我是想不管怎样,都想查出的文章是最新的10篇的,如果想这样,怎么改呢?现在的最大ID是7620,我想每一次查出的10篇都是从7611-7620的,当增加新文章是,比如说最大的变成了7630,我就想能在每一个静态页面旁边最新提问里查出的是7621-7630的,随着动态变化,具体你可以以查看附件查看页面布局的,就是最新提问那里,当变化时,那里不管在那个http://localhost/ask/html/7613.html,A.html是什么,都是最新的10篇

[ 本帖最后由 xing0724 于 2011-10-18 14:50 编辑 ]
2011-10-18 13:43
cserwang
Rank: 3Rank: 3
等 级:论坛游侠
帖 子:25
专家分:162
注 册:2007-5-10
得分:0 
直接写成Select Top 10 * From iHelp_Problem Order By F_HelpId Desc 不就是始终都是最新的10条了么?
2011-10-18 13:59
xing0724
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2011-10-18
得分:0 
我也修过那样写,可是最终的还是的静态html文件里面还是取的是以以前那个时候为基准的最新10篇文章,比如说那篇文章是你2009.3.1号发布的,最新提问里面显示的老是2009.3.1号附近的最新10篇文章,真不知道问题出在哪,按理说重新编辑修改了那篇文章,再生成html静态页面会变的,你有没有QQ或什么啊?那交流会快点的
2011-10-18 14:14
xing0724
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2011-10-18
得分:0 
回复 5楼 cserwang
我也修过那样写,可是最终的还是的静态html文件里面还是取的是以以前那个时候为基准的最新10篇文章,比如说那篇文章是你2009.3.1号发布的,最新提问里面显示的老是2009.3.1号附近的最新10篇文章,真不知道问题出在哪,按理说重新编辑修改了那篇文章,再生成html静态页面会变的,你有没有QQ或什么啊?那交流会快点的
2011-10-18 14:15
cserwang
Rank: 3Rank: 3
等 级:论坛游侠
帖 子:25
专家分:162
注 册:2007-5-10
得分:0 
你扣扣多少 我来加你 我倒要看看是啥妖怪问题
2011-10-18 14:20
xing0724
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2011-10-18
得分:0 
回复 8楼 cserwang
我已经通过短信息发给你了,我突然发现一些眉目了,你先加我啊
2011-10-18 14:35



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-352801-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.144712 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved