Difference between revisions of "HypertWiki:Code/lib/data"

From HypertWiki
Jump to navigation Jump to search
m (Protected "HypertWiki:Code/lib/data": to enable db access in w3tpl ([edit=sysop] (indefinite) [move=sysop] (indefinite)))
(ShowRecentBlogEntriesByTopic)
Line 167: Line 167:
</func>
</func>


<func ShowRecentBlogEntries max>
<func ShowRecentBlogEntries max iTopic>
  <let name=idx />
  <let name=including val=1 />
 
  <let name=topic farg=iTopic />
  <let name=topic self with="_"> </let>
 
  <let name=sqlWhere>(cl_to='</let>
  <let name=sqlWhere append copy=topic />
  <let name=sqlWhere append>')</let>
  <let name=noLoad val=1 />
 
  <for table="qryW3_Titles_Catgs" where=$sqlWhere sort="page_title DESC" limit=$max name=pg hide>
    <let name=pg_nspace_code>{{ns:</let>
    <let name=pg_nspace_code append val=@row.page_namespace />
    <let name=pg_nspace_code append>}}</let>
    <let name=pg_nspace copy=pg_nspace_code parse />
    <let name=pg_title val="@row.page_title" />
    <let name=pg_name copy=pg_nspace />
    <let name=pg_name append>:</let>
    <let name=pg_name append copy=pg_title />
    <load page=$pg_name />
    <if flag=data[Title]>
      <let name=idx inc />
      <call GetBlogEntryBrief />
      <let name=e.rtn append copy=e.out />
    </let>
  </for>
</func>
 
<func ShowRecentBlogEntriesFull max>
   <let name=idx />
   <let name=idx />
   <let name=including val=1 />
   <let name=including val=1 />
Line 180: Line 210:
     <let name=pg_name append copy=pg_title />
     <let name=pg_name append copy=pg_title />
     <let name=idx inc />
     <let name=idx inc />
     <call GetBlogEntryBrief />
     <call GetBlogEntryFull />
     <let name=e.rtn append copy=e.out />
     <let name=e.rtn append copy=e.out />
     <let name=data />
     <let name=data />
Line 186: Line 216:
</func>
</func>


<func ShowRecentBlogEntries_Full max>
<func ShowRecentBlogEntriesByTopic max iTopic>
   <let name=idx />
   <let name=idx />
   <let name=including val=1 />
   <let name=including val=1 />
   <for table="qryW3_Titles_Catgs" where="(cl_to='Data/blog/post')" sort="page_title DESC" limit=$max name=pg hide>
 
   <let name=topic farg=iTopic />
  <let name=topic self with="_"> </let>
 
  <let name=sqlWhere>(cl_to='</let>
  <let name=sqlWhere append copy=topic />
  <let name=sqlWhere append>')</let>
 
  <let name=noLoad val=1 />
 
  <for table="qryW3_Titles_Catgs" where=$sqlWhere sort="page_title DESC" limit=$max name=pg hide>
     <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 />
Line 199: Line 239:
     <let name=pg_name append copy=pg_title />
     <let name=pg_name append copy=pg_title />
     <let name=idx inc />
     <let name=idx inc />
     <call GetBlogEntryFull />
     <load page=$pg_title />
    <let name=e.rtn append copy=e.out />
    <if flag=data[Title]>
      <call GetBlogEntryBrief />
      <let name=e.rtn append copy=e.out />
    </if>
     <let name=data />
     <let name=data />
   </for>
   </for>

Revision as of 00:03, 30 April 2010