<% Sub nwViewMain() On Error Resume Next dim fieldsarray dim contentarray dim arrayaux dim cont dim propfile dim language language = "en" propfile = nof_sitePath & nof_scriptDir & "\" & nof_scriptInterfaceFile Dim XMLDoc set XMLDoc = nwOpenXMLFile(propfile) Dim ComponentNode if XMLDoc is nothing then call Err.Raise ( 601, "nw_view.nwViewMain", nwGetLocaleString("Error.601", Array(propFile)) ) Call nwRaiseFatalError(err, nof_debug) exit sub end if set ComponentNode = nwGetNode(XMLDoc,,"Component", Array("name","id"), Array("view", nof_componentId), -1) Set XMLDoc = nothing if ComponentNode is Nothing then call Err.Raise ( 400, "nw_add.nwAddMain", nwGetLocaleString("Error.400", Array(nof_componentId)) ) Call nwRaiseFatalError(err, nof_debug) exit sub end if usePageLimit = nwGetAttribute(ComponentNode, "pagePize", "uselimit") pagesize = nwGetProperty(ComponentNode, "pageSize") showdate = nwGetProperty(ComponentNode, "showDate") datemask = nwGetProperty(ComponentNode, "dateFormat") timemask = nwGetProperty(ComponentNode, "timeFormat") timezone = nwGetProperty(ComponentNode, "timeZone") if ( Clng(timezone) = 24 ) then timezone = -1 * nof_gmtDiff/60 end if language = nwGetProperty(ComponentNode, "language") Dim newsTitle newsTitle = nwGetProperty(ComponentNode, "newsTitle") Dim showDetailsLink, readmoreLink showDetailsLink = nwGetAttribute(ComponentNode, "detailsLink", "show") readmoreLink = nwGetProperty(ComponentNode, "detailsLink") Dim isPopup, detailsPage isPopup = nwGetAttribute(ComponentNode, "detailsPage", "popup") detailsPage = nwGetProperty(ComponentNode, "detailsPage") Dim linkTitle linkTitle = nwGetProperty(ComponentNode, "linkHeadline") Dim fields fields = nwGetLabels(ComponentNode) Dim authorShow authorShow = fields(3)(1) dbpath = nwGetProperty(ComponentNode, "dbPath") if dbPath = "" then 'the db path was not set call Err.Raise ( 526, "nw_add.nwAddMain", nwGetLocaleString("Error.526", null) ) call nwRaiseFatalError(err, nof_debug) Response.End end if Dim relPath, absPath if not inStr(1, dbPath, "\", 1) > 0 then set relPath = nothing set relPath = nwReFind(dbPath, "\.\./") absPath = nof_sitePath & nof_scriptDir if not relPath is nothing then if relPath.count > 0 then for i=1 to relPath.count absPath = Left(absPath, inStrRev(absPath,"\") - 1) dbPath = Replace(dbPath, "../", "", 1, 1) next else if inStr(1, dbPath, "./") > 0 then dbPath = Replace(dbPath, "./", "", 1, 1) end if end if set relPath = nothing end if dbPath = absPath & "\" & Replace(dbPath, "/", "\") end if contentarray = nwGetDB(dbPath, 1) if Err.number <> 0 then call nwRaiseFatalError(err, nof_debug) exit sub end if numberoflines=0 if IsArray(contentarray) then for t=1 to ubound(contentarray) numberoflines = numberoflines+1 next end if if usePageLimit = "false" then pageSize = numberoflines redim fieldsArray(Ubound(contentarray,2)) For k = 0 To Ubound(contentarray,2) fieldsArray(k) = contentarray(0,k) next if IsArray(fieldsarray) then Dim title_pos, shortmessage_pos, fullmessage_pos, author_pos, _ date_pos, image_pos, validation_pos for k=0 to ubound(fieldsarray) if trim(fieldsarray(k))="title" then title_pos=k end if if trim(fieldsarray(k))="shortmessage" then shortmessage_pos=k end if if trim(fieldsarray(k))="fullmessage" then fullmessage_pos=k end if if trim(fieldsarray(k))="author" then author_pos=k end if if trim(fieldsarray(k))="date" then date_pos=k end if if trim(fieldsarray(k))="image" then image_pos=k end if if trim(fieldsarray(k))="validation" then validation_pos=k end if next end if Dim offset offset=1 if ( Request.QueryString("nwoffset") <> "" ) then offset=Request.QueryString("nwoffset") end if Dim extraVars extraVars = "" cont = UBound(contentarray) if cont>0 then redim arrayaux(ubound(contentarray),ubound(fieldsarray)) iterator=0 for i=ubound(contentarray) to 1 step -1 for s=0 to ubound(fieldsarray) arrayaux(iterator,s)=contentarray(i,s) next iterator = iterator + 1 next contentarray=arrayaux end if Response.Write " " & vbCrLF & _ " " & vbCrLf & _ " " & vbCrLf & _ " " & vbCrLf & _ " " & vbCrLf & _ " " & vbCrLf & _ " " & vbCrLf & _ "
" if numberoflines>0 then call nwDisplayPages(offset, numberoflines, pageSize, 5, extraVars) else Response.Write " " end if Response.Write "
" & vbCrLf & _ " " & vbCrLf & _ " " & vbCrLf & _ " " & vbCrLf & _ " " & vbCrLf & _ " " & vbCrLf & _ " " & vbCrLf & _ " " & vbCrLf & _ " " & vbCrLf & _ " " & vbCrLf & _ " " & vbCrLf & _ "
" & newsTitle & "
" & vbCrLf & _ " " & vbCrLf start = offset-1 inc=1 dim dateform, timeform dim detailsPageLink, onClickAction do while Cint(start)>=0 and Cint(start)" & vbCrLf & _ "" & vbCrLf inc=inc+1 start=start+1 loop if cint(numberoflines=0) then Response.Write " " & vbCrLf & _ " " & vbCrLf & _ " " & vbCrLf end if Response.Write "
" if ( showdate = "true" ) then Response.Write " " & _ dateFormat(contentarray(start,date_pos), datemask, timemask, timezone) & "" & vbCrLf & _ "
" & vbCrLf & "

" end if Response.Write "" if ( linkTitle = "true" ) then Response.Write "" & nwHtmlSpecialChars(contentarray(start,title_pos), true) & "" else Response.Write htmlEncode(contentarray(start,title_pos)) end if Response.Write "" & vbCrLf Response.Write "

" & vbCrLf & _ "" & nwHtmlSpecialChars(contentarray(start,shortmessage_pos), true) & _ "" & vbCrLf if ( showDetailsLink = "true" ) then Response.Write "
" & readmoreLink & "" & vbCrLf end if if ( authorShow = "true" ) then Response.Write "

" & nwHtmlSpecialChars(contentarray(start,author_pos), true) & "

" end if Response.Write "
" & nwGetLocaleString("nw.Text.NoNews", null)& "
" & vbCrLf & _ "
" & vbCrLf & _ "
" & vbCrLf end sub %>