<% Sub nwViewItemMain() 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(nof_componentName, 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 Dim pageSize : pageSize = 1 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 showBackLink, gobackLink showBackLink = nwGetAttribute(ComponentNode, "backLink", "show") gobackLinkText = nwGetProperty(ComponentNode, "backLink") Dim backLink backLink = nwGetProperty(ComponentNode, "itemsListpage") if ( nof_popupwindow ) then backLink = "javascript: window.close();window.opener.focus();" end if Dim showNavigation showNavigation = nwGetProperty(ComponentNode, "showNavigation") Dim fields fields = nwGetLabels(ComponentNode) Dim authorShow authorShow = fields(3)(1) Dim imageShow imageShow = fields(4)(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 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 & _ " " & vbCrLf & _ "
" if ( showBackLink = "true" ) then Response.Write "" & gobackLinkText & "" end if Response.Write "" if ( showNavigation = "true" ) then if numberoflines>0 then call nwDisplayPages(offset, numberoflines, pageSize, 5, extraVars) end if Response.Write "
" & vbCrLf & _ " " & vbCrLf & _ " " & vbCrLf & _ " " & vbCrLf & _ " " & vbCrLf & _ " " & vbCrLf & _ " " & vbCrLf & _ " " & vbCrLf & _ " " & vbCrLf & _ " " & vbCrLf & _ " " & vbCrLf & _ "
" & newsTitle & "
" & vbCrLf if ( nof_popupwindow ) then Response.Write "" & vbCrLf end if Response.write " " & vbCrLf start = offset-1 inc=1 dim dateform, timeform do while Cint(start)>=0 and Cint(start)" & vbCrLf if Cint(image_pos)>0 and contentarray(start,image_pos)<>"" and trim(imageShow)="true" then Response.Write " " & vbCrLf & _ " " & vbCrLf & _ " " & vbCrLf inc=inc+1 start=start+1 loop if cint(numberoflines=0) then Response.Write " " & vbCrLf & _ " " & vbCrLf & _ " " & vbCrLf end if Response.Write "

" & vbCrLf & _ "
" & vbCrLf & _ "
" & vbCrLf else Response.Write " " & vbCrLf end if if ( showdate = "true" ) then Response.Write " " & _ dateFormat(contentarray(start,date_pos), datemask, timemask, timezone) & "" & vbCrLf & _ "
" & vbCrLf & "

" end if Response.Write " " & _ nwHtmlSpecialChars(contentarray(start,title_pos), true) & "" & vbCrLf & _ "

" & vbCrLf & _ " " & _ nwHtmlSpecialChars(contentarray(start,fullmessage_pos), true) & "" & vbCrLf 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 %>