Difference between revisions of "HypertWiki:Code/lib/data"
Jump to navigation
Jump to search
(rewrite of blogpost listing SQL) |
(some tidying) |
||
Line 242: | Line 242: | ||
</func> | </func> | ||
<func ShowRecentBlogEntriesByTopic max | <func ShowRecentBlogEntriesByTopic max topic> | ||
<let name=including val=1 /> | <let name=including val=1 /> | ||
<let name=topic self with="_"> </let> | <let name=topic self with="_"> </let> | ||
<let name= | <let name=sql>(cl_to='</let> | ||
<let name=sql>SELECT q1.* FROM qryW3_Titles_Catgs AS q1 LEFT JOIN qryW3_Titles_Catgs AS q2 ON q1.cl_from=q2.cl_from WHERE (q1.cl_to='Data/blog/post') AND (q2.cl_to='</let> | <let name=sql>SELECT q1.* FROM qryW3_Titles_Catgs AS q1 LEFT JOIN qryW3_Titles_Catgs AS q2 ON q1.cl_from=q2.cl_from WHERE (q1.cl_to='Data/blog/post') AND (q2.cl_to='</let> | ||
<let name= | <let name=sql append copy=topic /> | ||
<let name= | <let name=sql append>') ORDER BY page_title DESC LIMIT </let> | ||
<let name= | <let name=sql append copy=max /> | ||
<echo>SQL 1: <get name=sql /></echo> | |||
<for sql=$sql> | |||
<for sql=$sql | |||
<let name=pg_nspace_code>{{ns:</let> | <let name=pg_nspace_code>{{ns:</let> | ||
<let name=pg_nspace_code append val=@row.page_namespace /> | <let name=pg_nspace_code append val=@row.page_namespace /> |