Background: I'm using DNN Community Edition 7.0.6, the Announcements module v.04.00.03 and the Reports module v.05.05.00. I am not a .NET developer and so do not know how to build my own module, which would probably be a better solution. I am merely a web developer with elevated rights and enough knowledge to get me in trouble.
My goal is to produce an Expired Announcements page where unauthenticated users can view the past announcements (which appears to be unavailable in the current, stable version - high hopes for v.7!). Using the Reports module and a SQL statement, I'm able to pull the expired announcements from the Announcements table. Awesome! Thanks to the several other users posts about using the HTML Visualizer in the Reports module, I was able to get the presentation of the output 90% of the way I want it. (Ideally, I want to make it look exactly like the current Announcements and it's close. It's missing some of the editing capabilities but it would work until I can learn to build a custom module where those capabilities could be included.)
Now that it looks acceptable, I'm having trouble with the URL's coming from the Announcements table. It appears the Announcements module stores only the relative URL in the URL field. i.e. FileID=###. In the Announcements module, the URL looks something like this: http://myDotNetNuke/LinkClick.aspx?fileticket=D7L2meZOBkw%3d&tabid=132&portalid=0&mid=492. So when I click on the link in my Reports module I get a 404 error.
How do I add the rest of the URL reqired to complete the link to the file and/or page? Is there a Token to insert? Maybe I need to include another table and field in my query?
Thanks for the help!
Here's my query:
SELECT ItemID, ModuleID, CreatedDate, Title, URL, ExpireDate, Description, ViewOrder, CreatedByUser, PublishDate, ImageSource
WHERE (ModuleID = 492) AND (ExpireDate < GETDATE())
ORDER BY PublishDate DESC
Here's my html code:
<td valign="top"><span class="SubHead"><a href="[URL]">[Title]</a> - [PublishDate]</span><div class="Normal DNN_ANN_Description">[Description] <a href="[URL]">read more...</a></div></td>