Table data not showing client side

DeborahFerley

New Member
Some ideas would be great on this.. I've trying to show news articles from a table: dbo.CommunityNews on this page here. but it's not showing..The code for this page is:\[code\]<!--#include virtual="/System/Startup_Public.asp"--><%If Session("PublicFranchiseGID") = "" then Response.Redirect "/"End if sLink = "/" & lcase(session("publicfranchisename")) & "/news/index.html" sym = "?" if len(""&request.querystring("nwsd"))>0 then sLink=sLink&sym&"nwsd="&request.querystring("nwsd") sym="&" end if if len(""&request.querystring("nwsc"))>0 then sLink=sLink&sym&"nwsc="&request.querystring("nwsc") sym="&" end if if len(""&request.querystring("nwssd"))>0 then sLink=sLink&sym&"&nwssd="&request.querystring("nwssd") sym="&" end if if not sLink = request.ServerVariables("HTTP_X_REWRITE_URL") then response.status = "301 Moved Permanently" response.addheader "Location", "http://www.inside-guides.co.uk" & sLink response.end end ifEnsurePageIsBasicHTTPstartdate = date()if len(""&getquery("nwssd"))>0 then if isdate(getquery("nwssd")) then startdate = getquery("nwssd") end ifend if%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title><%=server.HTMLEncode(Session("PublicFranchiseName"))%> News - Read the latest local news stories happening in <%=server.HTMLEncode(Session("PublicFranchiseName"))%>, Essex</title><meta name="Description" content="<%=server.HTMLEncode(Session("PublicFranchiseName"))%> local news is constantly updated to bring you the latest local headlines." /><meta name="Keywords" content="<% = GetContent("FranchiseCommunity_MetaKeywords", Session("PublicFranchiseGID")) %>" /><!--#include virtual="/Assets/Templates/Public/Franchise/HeadCSS.asp"--><link rel="stylesheet" type="text/css" href="http://stackoverflow.com/css/EventList.css"/><link rel="stylesheet" type="text/css" href="http://stackoverflow.com/css/hot-sneaks/jquery-ui-1.8.22.custom.css"/><script type="text/javascript" src="http://stackoverflow.com/js/common.js"></script><script type="text/javascript" src="http://stackoverflow.com/js/jquery-1.2.6.min.js"></script><script type="text/javascript" src="http://stackoverflow.com/js/Slideshow.js"></script><script type="text/javascript"> $(document).ready(function(e) { $('#datepicker').datepicker({ dateFormat:'dd/mm/yy', defaultDate: '<%=startdate%>', onSelect: function(dateText, inst) { $('#nwssd').val(dateText); } }); });</script></head><body class="news"><!--#include virtual="/Assets/Templates/Public/Franchise/TemplateStartPages.asp"--><div class="middle-content-grey"><h1><%=(Session("PublicFranchiseName"))%> News</h1> <a href="http://stackoverflow.com/questions/11811135/submit.html" style="float:right;">Submit your news item</a> <br /> <% ' default query, top 20 news items on or after today limit = " TOP 20 " where = " AND cn_startdate >= GetDate()" if len(""&getquery("nwssd")) >0 then if isdate(getquery("nwssd")) then sdate = year(getquery("nwssd")) & "-" & month(getquery("nwssd")) & "-" & day(getquery("nwssd")) where="" if left(getquery("nwsd"),1) = "p" then where = where & " AND (cn_startdate BETWEEN '"&sdate&"' AND DATEADD(day,"&cint(replace(request.querystring("nwsd"),"p",""))&",'"&sdate&"')) " else where = where & " AND (cn_startdate BETWEEN DATEADD(day,-"&cint(replace(request.querystring("nwsd"),"p",""))&",'"&sdate&"') AND '"&sdate&"') " end if limit = "" end if end if if len(""&getquery("nwsc"))>0 then if isnumeric(getquery("nwsc")) then where = where & " AND cn_category = "&cint(getquery("nwsc")) end if end if sql = "SELECT "&limit&" *,dbo.RemoveNonAlphaCharacters(LTRIM(RTRIM(cn_title))) AS URL "&_ "FROM CommunityNews "&_ "LEFT JOIN CommunityNewsCategories ON cn_category = cnc_id "&_ "WHERE cn_live = 1 AND cn_franchise = '{"&session("PublicFranchiseGID")&"}' "&_ where &_ "ORDER BY cn_startdate ASC;" getrs rs,sql,"" if rs.recordcount = 0 and len(""&limit)>0 then ' no current news items, fall back to archive listing sql = "SELECT TOP 20 *,dbo.RemoveNonAlphaCharacters(LTRIM(RTRIM(cn_title))) AS URL "&_ "FROM CommunityNews "&_ "LEFT JOIN CommunityNewsCategories ON cn_category = cnc_id "&_ "WHERE cn_live = 1 AND cn_franchise = '{"&session("PublicFranchiseGID")&"}' "&_ "ORDER BY cn_startdate ASC;" end if if rs.recordcount > 0 then while not rs.eof url = "/" & lcase(session("publicfranchisename")) & "/news/" & year(rs("cn_startdate")) & "/" & monthname(month(rs("cn_startdate"))) & "/" & server.URLEncode(rs("URL")) & ".html" %> <div class="event"> <table width="100%" border="1"> <tr> <td width="90" valign="top"> <% if len(""&rs("cn_thumbnail"))>0 then %> <a href="http://stackoverflow.com/questions/11811135/<%=url%>"><img src="http://stackoverflow.com/includes/tn.asp?w=80&src=/LiveStorage/Uploads/image/CommunityNews/<%=server.URLEncode(""&rs("cn_thumbnail"))%>" alt="<%=server.HTMLEncode(""&rs("cn_title"))%>" /></a> <% end if %> </td> <td valign="top"> <h3><% if len(""&rs("cnc_image")) > 0 then %><img src="http://stackoverflow.com/Assets/Images/NewsCategories/<%=server.URLEncode(""&rs("cnc_image"))%>" alt="<%=server.HTMLEncode(""&rs("cnc_category"))%>" class="category" /><% end if %>&nbsp;<a href="http://stackoverflow.com/questions/11811135/<%=url%>"><%=server.HTMLEncode(""&rs("cn_title"))%></a></h3> <h4>at <%=server.HTMLEncode(rs("cn_location"))%></h4> <p> <%=server.HTMLEncode(""&rs("cn_summary"))%> </p> </td> <td width="90" valign="top"> <div class="date"> <div class="month"><%=server.HTMLEncode(""&monthname(month(rs("cn_startdate")),true))%></div> <div class="day"><%=server.HTMLEncode(""&day(rs("cn_startdate")))%></div> </div> <a href="http://stackoverflow.com/questions/11811135/<%=url%>" class="moreinfo">More Info</a> </td> </tr> </table> </div> <% rs.movenext : wend else %> <p>&nbsp;</p> <p>&nbsp;</p> <p>No news items matched your query.</p> <p>&nbsp;</p> <% end if %></div><% server.execute "/Feeds/News/local_news.asp" %><br /> <div class="purple-button top"><a href='http://stackoverflow.com/questions/11811135/#top'>Top</a></div> <div class="purple-button home"><a href="http://stackoverflow.com/<%=lcase(Session("PublicFranchiseName"))%>/pages/index.html">Home</a></div><!--#include virtual="/Assets/Templates/Public/Franchise/TemplateEnd.asp"--></body></html><!--#include virtual="/System/Shutdown.asp"-->\[/code\]The page in the admin where the articles were created is 'AddNews.asp':\[code\]<% on error resume next Set upload = Server.CreateObject("Persits.Upload") upload.CodePage = 65001 upload.save on error goto 0%><!--#include virtual="/System/Startup_Admin.asp"--><!--#include virtual="/Admin/FranchiseAdmin/ContentEditor/i_EditContent.asp"--><%getrs rs,"SELECT * FROM CommunityNews WHERE cn_franchise = '"&session("AdminFranchiseGID")&"' AND cn_id = '"&cint(request.querystring("delarticle"))&"';",""if ""&request.querystring("action") = "add" then path = server.MapPath("/LiveStorage/Uploads/image/CommunityNews/")&"\" set file = upload.files("thumbimg") if not file is nothing then thumbfile = getguid & file.ext file.saveas path&thumbfile end if set file = upload.files("fullimg") if not file is nothing then fullimg = getguid & file.ext file.saveas path&fullimg end if set sql = new sql_insert with sql .table = "CommunityNews" .addparam "cn_franchise",Session("AdminFranchiseGID"),"" .addparam "cn_title",trim(""&getform("title")),"" .addparam "cn_location",trim(""&getform("location")),"" .addparam "cn_category","",cint(""&getform("category")) .addparam "cn_startdate","","'"&getform("startdate_Day") & " " & monthname(getform("startdate_Month")) & " " & getform("startdate_Year")&"'" .addparam "cn_enddate","","'"&getform("enddate_Day") & " " & monthname(getform("enddate_Month")) & " " & getform("enddate_Year")&"'" .addparam "cn_summary",""&getform("summary"),"" .addparam "cn_article",""&getform("article"),"" .addparam "cn_thumbnail",""&thumbfile,"" .addparam "cn_fullimage",""&fullimg,"" .run end with set sql = nothing response.redirect "Default.asp"end if%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>Inside-Guides.co.uk - Community Article Administration</title><!--#include virtual="/Assets/Templates/Admin/FranchiseAdmin/HeadCSS.asp"--></head><body><!--#include virtual="/Assets/Templates/Admin/FranchiseAdmin/TemplateStart.asp"--><br /><h1><%Response.Write(Session("AdminFranchiseName"))%> News: Add a New Article</h1><br /><br /><br /><% If Not Session("Role_Franchise_ManageContent") then AccessDenied %><span class="ErrorText"><% = strUserError %></span><form name="EditForm" id="EditForm" method="post" action="AddNews.asp?Action=add" enctype="multipart/form-data"> <table> <tr> <th align="left" valign="top" width="200"> Title: </th> <th align="left" valign="top"> <input type="text" name="title" id="title" style="width:97%;" /> </th> </tr> <tr> <th align="left" valign="top">Location</th> <th align="left" valign="top"> <input type="text" name="location" id="location" style="width:97%;" /> </th> </tr> <tr> <th align="left" valign="top">Start Date</th> <th align="left" valign="top"> <% CreateDateSelectionBox "startdate", NOW, False %> </th> </tr> <tr> <th align="left" valign="top">Category</th> <th align="left" valign="top"> <select name="category" id="category"> <option value=""></option> <% getrs tmp,"SELECT * FROM CommunityNewsCategories ORDER BY cnc_category;","" while not tmp.eof %> <option value="http://stackoverflow.com/questions/11811135/<%=server.HTMLEncode(""&tmp("cnc_id"))%>"><%=server.HTMLEncode(""&tmp("cnc_category"))%></option> <% tmp.movenext : wend %> </select> </th> </tr> <tr> <th align="left" valign="top">End Date (optional)</th> <th align="left" valign="top"> <% CreateDateSelectionBox "enddate", NOW, False %> </th> </tr> <tr> <th align="left" valign="top">Summary</th> <th align="left" valign="top"> <textarea name="summary" id="summary" style="border:1px solid #888;" maxlength="255"></textarea> </th> </tr> <tr> <th align="left" valign="top">Full Article</th> <th align="left" valign="top"> <textarea name="article" rows="40" id="article" style="border:1px solid #888;"></textarea> </th> </tr> <tr> <th align="left" valign="top">Thumbnail Image</th> <th align="left" valign="top"> <input type="file" name="thumbimg" id="thumbimg" /> </th> </tr> <tr> <th align="left" valign="top">Full Image</th> <th align="left" valign="top"> <input type="file" name="fullimg" id="fullimg" /> </th> </tr> <tr> <th align="left" valign="top"></th> <th align="left" valign="top"> <br /> <a style="padding:0 1em;" href="javascript:document.getElementById('EditForm').submit();"><% = GetIcon("OK", "Save Changes", 40, True) %>&nbsp;Save Changes</a> <a style="padding:0 1em;" href="javascript:document.location='Default.asp?PGID=<% = Request("PGID") %>';"><% = GetIcon("Delete", "Cancel Changes", 40, True) %>&nbsp;Cancel</a> <a style="padding:0 1em;" href="javascript:window.parent.location.reload(true);"><% = GetIcon("Undo", "Undo Changes", 40, True) %>&nbsp;Undo</a> </td> </tr> </table></form><br /><!--#include virtual="/Assets/Templates/Admin/FranchiseAdmin/TemplateEnd.asp"--></body></html><!--#include virtual="/System/Shutdown.asp"-->\[/code\]But I have no idea why it's not working. Also in case it's needed, the section from the URL rewrite for the URLs:\[code\] else if (sFirst == "news") { if (aURL[5].Contains("index.html")) { destination = "/news.asp?f=" + gFranchise; if (Request.QueryString["nwsc"] !=null) destination += "&nwsc=" + Request.QueryString["nwsc"].ToString(); if (Request.QueryString["nwsd"] !=null) destination += "&nwsd=" + Request.QueryString["nwsd"].ToString(); if (Request.QueryString["nwssd"] != null) destination += "&nwssd=" + Request.QueryString["nwssd"].ToString(); } else if (aURL[5].Contains("submit.html")) { destination = "/News-Submit.asp"; } else { destination = "/news-details.asp?f=" + gFranchise + "&y=" + aURL[5] + "&m=" + aURL[6] + "&a=" + aURL[7].Substring(0,aURL[7].IndexOf('.')); } }\[/code\]Any help would be much appreciated...
 
Back
Top