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

From HypertWiki
Jump to navigation Jump to search
(removed leftover /font tag)
(code for displaying blog entry summaries)
Line 1: Line 1:
<hide>
<hide>
 
<func GetLinkBrief>
<func GetBrief>
     <let name=links.out>
     <let name=links.out>
* '''</let>
* '''</let>
Line 50: Line 49:
     </if>
     </if>
     <if flag=data[Title]>
     <if flag=data[Title]>
       <call GetBrief />
       <call GetLinkBrief />
     </if><else>
     </if><else>
<!-- if no new-style data, just display link to page so we can fix the problem: -->
<!-- if no new-style data, just display link to page so we can fix the problem: -->
Line 63: Line 62:
   </for>
   </for>
</func>
</func>
-- this should eventually be able to show data in any format: news links, blog entries...


<func ShowTopic iTopic iMax>
<func ShowTopic iTopic iMax>
Line 94: Line 95:
     <let name=links.rtn append copy=links.out />
     <let name=links.rtn append copy=links.out />
     <let name=data null />
     <let name=data null />
  </for>
</func>
=== BLOG ENTRIES ===
<func GetBlogEntryBrief>
INPUT:
  data[*] - from blog entry page
  pg_name - full name of page being displayed (including namespace)
    <if not flag=noLoad>
      <load page=$pg_name nocat />
    </if>
    <let name=e.out>
* '''</let>
    <let name=e.out append copy=data[TimeStamp] />
    <let name=e.out append>''' </let>
    <let name=text copy=data[TextAbove] />
    <if flag=text></if><else>
      <let name=text copy=data[TextBelow] len=200 />
    </else>
    <let name=e.out append copy=text trim />
    <let name=e.out append> ''[[</let>
    <let name=e.out append copy=pg_name />
    <let name=e.out append>|more...]]''</let>
</func>
<func ShowRecentBlogEntries max>
  <let name=idx />
  <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=pg_nspace_code>{{ns:</let>
    <let name=pg_nspace_code append val=@row.pg.page_namespace />
    <let name=pg_nspace_code append>}}</let>
    <let name=pg_nspace copy=pg_nspace_code parse />
    <let name=pg_title val="@row.pg.page_title" />
    <let name=pg_name copy=pg_nspace />
    <let name=pg_name append>:</let>
    <let name=pg_name append copy=pg_title />
    <let name=idx inc />
    <call GetBlogEntryBrief />
    <let name=e.rtn append copy=e.out />
    <let name=data />
   </for>
   </for>
</func>
</func>

Revision as of 18:03, 14 February 2009