<!-- #include file="../include/inc_uiconfig.asp" -->
<!-- #include file="inc_page/use_uipage.asp" -->
<!-- #include file="temp_news.asp" -->
<!-- #include file="temp_prevnext.asp" -->
<%
Call uipage_start("news")
templatefile_xslt = "/templates/page_import/view_news.xslt"
edition_id = get_editionid()
othersql = " where newsIsShow=0 and newsId=" & var_id
sql_cmd = "select top 1 * from T_News" & othersql
Set rs_obj = web_dbobj.exec_sql(sql_cmd, 1)
If Not rs_obj.EOF Then
    Dim newsTopic, newsSort, newsTime, newsFrom, newsClicks, newsImage, newsUser, newsInfos, newsRemark, theItemXml
    Dim topicTitle, fromTitle, authorTitle, timeTitle, clickTitle, detailTitle
    newsSort = var_null(rs_obj("newsSort"))
    newsTopic = var_null(rs_obj("newsTopic"))
    newsFrom = var_null(rs_obj("newsFrom"))
    newsClicks = var_null(rs_obj("newsClicks"))
    newsImage = var_null(rs_obj("newsImage"))
    newsUser = var_null(rs_obj("userName"))
    newsTime = var_null(rs_obj("newsTime"))
    newsInfos = var_null(rs_obj("newsInfos"))
    newsRemark = var_null(rs_obj("newsRemark"))
    newsTime = time_type(newsTime, 4)
    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)
    theItemXml = get_ajaxtemplate("view", 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, "$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)
    templatelist_html = getHtml_DocXslt(templatefile_xmltxt, templatefile_xslt)
    If set_msortcounter("news", var_id) = True Then
        Call web_dbobj.exec_sql("update T_News set newsClicks=newsClicks+1 where newsId="&var_id, 0)
    End If
End If
rs_obj.Close
response.Write templatelist_html
Dim prevOtherSql, nextOtherSql, theRecordId, theRecordTopic, theRecordUrl
theRecordUrl = "news_view.htm?id="
templatefile_xslt = "/templates/page_import/info_prevnext.xslt"
prevOtherSql = " where newsIsShow=0 and newsId>" & var_id & " and editionId=" & edition_id & " order by newsIsTop,newsTime,newsClicks,newsId"
nextOtherSql = " where newsIsShow=0 and newsId<" & var_id & " and editionId=" & edition_id & " order by newsIsTop desc,newsTime desc,newsClicks desc,newsId desc"
templatefile_xmltxt = prevnext_record("T_News", prevOtherSql, nextOtherSql, "newsId", "newsTopic", theRecordUrl)
templatelist_html = getHtml_DocXslt(templatefile_xmltxt, templatefile_xslt)
response.Write templatelist_html
Call uipage_end()
%>