<!-- #include file="../include/inc_uiconfig.asp" -->
<!-- #include file="../include/inc_shared.asp" -->
<!-- #include file="inc_page/use_uipage.asp" -->
<!-- #include file="temp_pagebar.asp" -->
<!-- #include file="temp_news.asp" -->
<%
Call uipage_start("news")
index_var = "news"
pageurl = "news.htm?"
templatefile_xslt = "/templates/page_import/mainlist_news.xslt"
edition_id = get_editionid()
othersql = " where newsIsShow=0 and editionId=" & edition_id
If InStr(sortid, "_")>0 Then
    othersql = othersql & " and newsSort in (" & getmsort_sqls(sortid, "news") & ")"
    pageurl = pageurl & "sortid=" & sortid & "&"
End If
sql_cmd = "select count(newsId) from T_News" & othersql
Set rs_obj = web_dbobj.exec_sql(sql_cmd, 1)
rs_cnum = rs_obj(0)
rs_obj.Close
If Int(rs_cnum)>0 Then
    Dim theDocXml, theItemList
    nummers = web_listshownum(index_var, "_shownum", edition_id, nummers)
    Dim topicTitle, fromTitle, authorTitle, timeTitle, clickTitle, detailTitle
    topicTitle = web_moduletitle("tit_newstopic", edition_id, "Title", 0)
    fromTitle = web_moduletitle("tit_newsfrom", edition_id, "ComeFrom", 0)
    authorTitle = web_moduletitle("tit_newsauthor", edition_id, "Author", 0)
    timeTitle = web_moduletitle("tit_newstime", edition_id, "Time", 0)
    clickTitle = web_moduletitle("tit_newsclick", edition_id, "Click", 0)
    detailTitle = web_moduletitle("tit_newsdetail", edition_id, "DetailInfos", 0)
    rs_lines = nummers
    Call format_pagecute()
    sql_cmd = "select top " & nummers * viewpage & " * from T_News" & othersql &" order by newsIsTop desc,newsTime desc,newsClicks desc,newsId desc"
    Call web_dbobj.exec_sql(sql_cmd, -1)
    rs_obj.Open sql_cmd, conn_obj, 1, 1
    If Int(viewpage)>1 Then rs_obj.Move (viewpage -1) * nummers
    If Int(viewpage * nummers)>Int(rs_cnum) Then rs_lines = nummers - (viewpage * nummers - rs_cnum)
    For var_i = 1 To rs_lines
        Dim newsTopic, newsSort, newsFrom, newsTime, newsClicks, newsUser, newsImage, newsInfos, newsRemark, theItemXml
        newsSort = var_null(rs_obj("newsSort"))
        newsTopic = var_null(rs_obj("newsTopic"))
        newsFrom = var_null(rs_obj("newsFrom"))
        newsClicks = var_null(rs_obj("newsClicks"))
        newsUser = var_null(rs_obj("userName"))
        newsImage = var_null(rs_obj("newsImage"))
        newsTime = var_null(rs_obj("newsTime"))
        newsInfos = var_null(rs_obj("newsInfos"))
        newsRemark = var_null(rs_obj("newsRemark"))
        newsTime = time_type(newsTime, 4)
        theItemXml = get_ajaxtemplate("listitem", 0, "")
        templatefile_xmltxt = Replace(theItemXml, "$newsid", rs_obj("newsId"))
        templatefile_xmltxt = Replace(templatefile_xmltxt, "$newstopic", newsTopic)
        templatefile_xmltxt = Replace(templatefile_xmltxt, "$newssort", newsSort)
        templatefile_xmltxt = Replace(templatefile_xmltxt, "$news_sorturl", "#")
        templatefile_xmltxt = Replace(templatefile_xmltxt, "$newsfrom", newsFrom)
        templatefile_xmltxt = Replace(templatefile_xmltxt, "$newsclicks", newsClicks)
        templatefile_xmltxt = Replace(templatefile_xmltxt, "$newsimage", newsImage)
        templatefile_xmltxt = Replace(templatefile_xmltxt, "$username", newsUser)
        templatefile_xmltxt = Replace(templatefile_xmltxt, "$newstime", newsTime)
        templatefile_xmltxt = Replace(templatefile_xmltxt, "$newsinfos", newsInfos)
        templatefile_xmltxt = Replace(templatefile_xmltxt, "$newsremark", newsRemark)
        templatefile_xmltxt = Replace(templatefile_xmltxt, "$urlpath", "news_view.htm?id=" & rs_obj("newsId"))
        templatefile_xmltxt = Replace(templatefile_xmltxt, "$tit_newstopic", topicTitle)
        templatefile_xmltxt = Replace(templatefile_xmltxt, "$tit_newsfrom", fromTitle)
        templatefile_xmltxt = Replace(templatefile_xmltxt, "$tit_newsauthor", authorTitle)
        templatefile_xmltxt = Replace(templatefile_xmltxt, "$tit_newstime", timeTitle)
        templatefile_xmltxt = Replace(templatefile_xmltxt, "$tit_newsclick", clickTitle)
        templatefile_xmltxt = Replace(templatefile_xmltxt, "$tit_newsdetail", detailTitle)
        theItemList = theItemList & vbCrLf & templatefile_xmltxt
        rs_obj.movenext
    Next
    rs_obj.Close
    theDocXml = get_ajaxtemplate("list", 0, "")
    theDocXml = Replace(theDocXml, "$newslist_item", theItemList)
    templatelist_html = getHtml_DocXslt(theDocXml, templatefile_xslt)
End If
response.Write templatelist_html
templatefile_xslt = "/templates/page_import/web_navpage.xslt"
templatefile_xmltxt = nav_pagecute(rs_cnum, thepages, viewpage, pageurl, 10)
templatelist_html = getHtml_DocXslt(templatefile_xmltxt, templatefile_xslt)
response.Write templatelist_html
Call uipage_end()
%>