<%option explicit%> News Admin List <% if not IsNumeric(show_stories) then show_stories = "999" end if Set dConn = Server.CreateObject("ADODB.Connection") dConn.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & database_path showall = request.querystring("showall") if showall <> "" then strSQL = "SELECT TOP " & show_stories & " expire, id, newsdate, newstitle, newsbody, active from tblnews order by id desc, newsdate desc;" else strSQL = "SELECT TOP " & show_stories & " expire, id, newsdate, newstitle, newsbody, active from tblnews where active = 1 order by id desc, newsdate desc;" end if Set newsRS = Server.CreateObject("ADODB.recordset") newsRS.Open strSQL, dConn, 1, 3 recordcount = newsRS.recordcount if recordcount <> 0 then data = newsRS.GetRows() 'Data is retrieved so close all connections newsRS.Close Set newsRS = Nothing dconn.close Set dconn = nothing 'Setup for array usage iRecFirst = LBound(data, 2) iRecLast = UBound(data, 2) end if %> <% if recordcount <> 0 then ' Loop through the records (second dimension of the array) For I = iRecFirst To iRecLast news_expire = data(0,I) news_id = data(1,I) news_dat = data(2,I) news_title = data(3,I) news_body = data(4,I) active = data(5,I) if active = 1 then textcolor = "black" else textcolor = "gray" end if if DateDiff("d", todaydate, news_expire) > 0 then textcolor = "black" else textcolor = "gray" end if response.write "" & _ " " & _ "" & _ "" & _ "" & _ "" & vbcrlf Next ' I end if %>
" & news_title & " date: " & news_dat & " expires: " & news_expire & "" & _ " [edit] [delete]
" & news_body & "
admin