Forum OpenACS Q&A: Response to News items on index page

Collapse
Posted by Brian Mann on
I got tired of trying an just did a VERY ugly hack...I use an adp page, so I just did:
<%
 
 set db [ns_db gethandle]
 set selection [ns_db select $db "select * from calendar where sysdate() <= end_date order by start_date"] 
 while {[ns_db getrow $db $selection]} {
 
   set title [ns_set get $selection title]
   set calendar_id [ns_set get $selection calendar_id]
   set approved_p [ns_set get $selection approved_p]
   if {$approved_p != "f"} {
      ns_puts "<li><a href="calendar/item.tcl?calendar_id=$calendar_id">$title</a>"
 }}
  ns_puts "</ul>"
%>
I'm sure somebody can tell me how to do it more elegantly, but it seems to work.