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

From HypertWiki
Jump to navigation Jump to search
(more tidying; remove debug code)
(section per function; syntax updates (probably just replicating lost work done since July))
Line 1: Line 1:
<hide>
==GetLinkBrief()==
<func GetLinkBrief>
<func GetLinkBrief>
     <let name=links.out>
     <let name=links.out>
Line 10: Line 10:
     <let name=links.out append>|talk]]: </let>
     <let name=links.out append>|talk]]: </let>


     <if flag=data[wpage]>
     <if flag=$data[wpage]>
       <let name=wtLink>[[</let>
       <let name=wtLink>[[</let>
       <let name=wtLink append copy=data[wpage] />
       <let name=wtLink append copy=data[wpage] />
Line 28: Line 28:


     <let name=text copy=data[TextShort] />
     <let name=text copy=data[TextShort] />
     <if flag=text></if><else>
     <if flag=$text></if><else>
       <let name=text copy=data[Text] len=200 />
       <let name=text copy=data[Text] len=200 />
     </else>
     </else>
Line 38: Line 38:


</func>
</func>
 
==ShowRecentLinks(max)==
<func ShowRecentLinks max>
<func ShowRecentLinks max>
   <let name=idx />
   <let name=idx />
Line 45: Line 45:
     <let name=pg_title val="@row.page_title" />
     <let name=pg_title val="@row.page_title" />
     <let name=idx inc />
     <let name=idx inc />
     <if not flag=noLoad>
     <if not flag=$noLoad>
       <load page=$pg_title />
       <load page=$pg_title />
     </if>
     </if>
     <if flag=data[Title]>
     <if flag=$data[Title]>
       <call GetLinkBrief />
       <call GetLinkBrief />
     </if><else>
     </if><else>
Line 62: Line 62:
   </for>
   </for>
</func>
</func>
 
==ShowTopic(iTopic,iMax)==
-- this should eventually be able to show data in any format: news links, blog entries...
This should eventually be able to show data in any format: news links, blog entries...
 
<func ShowTopic iTopic iMax>
<func ShowTopic iTopic iMax>
   <let name=idx />
   <let name=idx />
   <let name=including val=1 />
   <let name=including val=1 />
   <let name=topic farg=iTopic />
   <let name=topic farg=iTopic />
   <if not flag=topic>
   <if not flag=$topic>
     <let name=topic parse>{{PAGENAME}}</let>
     <let name=topic parse>{{PAGENAME}}</let>
   </if>
   </if>
Line 81: Line 80:
     <let name=pg_title val="@row.page_title" />
     <let name=pg_title val="@row.page_title" />
     <let name=idx inc />
     <let name=idx inc />
     <if not flag=noLoad>
     <if not flag=$noLoad>
       <load page=$pg_title local />
       <load page=$pg_title local />
     </if>
     </if>
     <if flag=data[Title]>
     <if flag=$data[Title]>
       <call GetBrief />
       <call GetBrief />
     </if><else>
     </if><else>
Line 97: Line 96:
   </for>
   </for>
</func>
</func>
 
==GetBlogEntryBrief()==
=== BLOG ENTRIES ===
<func GetBlogEntryBrief>
<func GetBlogEntryBrief>
INPUT:
INPUT:
Line 104: Line 102:
   pg_name - full name of page being displayed (including namespace)
   pg_name - full name of page being displayed (including namespace)


     <if not flag=noLoad>
     <if not flag=$noLoad>
       <load page=$pg_name />
       <load page=$pg_name />
     </if>
     </if>
Line 118: Line 116:


     <let name=text copy=data[TextAbove] />
     <let name=text copy=data[TextAbove] />
     <if flag=text></if><else>
     <if flag=$text></if><else>
       <let name=text copy=data[TextBelow] len=200 />
       <let name=text copy=data[TextBelow] len=200 />
     </else>
     </else>
Line 127: Line 125:
     <let name=e.out append>|more...]]''</let>
     <let name=e.out append>|more...]]''</let>
</func>
</func>
 
==GetBlogEntryBriefChrisFormat()==
<func GetBlogEntryBriefChrisFormat>
<func GetBlogEntryBriefChrisFormat>
INPUT:
INPUT:
Line 133: Line 131:
   pg_name - full name of page being displayed (including namespace)
   pg_name - full name of page being displayed (including namespace)


     <if not flag=noLoad>
     <if not flag=$noLoad>
       <load page=$pg_name />
       <load page=$pg_name />
     </if>
     </if>
Line 149: Line 147:


     <let name=text copy=data[TextAbove] />
     <let name=text copy=data[TextAbove] />
     <if flag=text></if><else>
     <if flag=$text></if><else>
       <let name=text copy=data[TextBelow] len=200 />
       <let name=text copy=data[TextBelow] len=200 />
     </else>
     </else>
Line 160: Line 158:
</let>
</let>
</func>
</func>
 
==GetBlogEntryFull()==
<func GetBlogEntryFull>
<func GetBlogEntryFull>
INPUT:
INPUT:
Line 166: Line 164:
   pg_name - full name of page being displayed (including namespace)
   pg_name - full name of page being displayed (including namespace)


     <if not flag=noLoad>
     <if not flag=$noLoad>
       <load page=$pg_name />
       <load page=$pg_name />
     </if>
     </if>
Line 188: Line 186:
     <let name=noCat val=1 />
     <let name=noCat val=1 />
     <call MakeBlogCatgs />
     <call MakeBlogCatgs />
     <if flag=wtCatGlob>
     <if flag=$wtCatGlob>
       <let name=e.out append> general: </let>
       <let name=e.out append> general: </let>
       <let name=e.out append copy=wtCatGlob>
       <let name=e.out append copy=wtCatGlob>
     </if>
     </if>
     <if flag=wtCatUser>
     <if flag=$wtCatUser>
       <let name=e.out append> user: </let>
       <let name=e.out append> user: </let>
       <let name=e.out append copy=wtCatUser>
       <let name=e.out append copy=wtCatUser>
Line 199: Line 197:
</small></let>
</small></let>
</func>
</func>
 
==ShowRecentBlogEntries(max,funcEntry)==
<func ShowRecentBlogEntries max funcEntry>
<func ShowRecentBlogEntries max funcEntry>
   <let name=idx />
   <let name=idx />
   <if not flag=funcEntry>
   <if not flag=$funcEntry>
     <let name=funcEntry val="GetBlogEntryBrief" />
     <let name=funcEntry val="GetBlogEntryBrief" />
   </if>
   </if>
Line 221: Line 219:
   </for>
   </for>
</func>
</func>
 
==ShowRecentBlogEntriesFull(max)==
 
<func ShowRecentBlogEntriesFull max>
<func ShowRecentBlogEntriesFull max>
   <let name=idx />
   <let name=idx />
Line 241: Line 238:
   </for>
   </for>
</func>
</func>
 
==ShowRecentBlogEntriesByTopic(max,topic)==
<func ShowRecentBlogEntriesByTopic max topic>
<func ShowRecentBlogEntriesByTopic max topic>
   <let name=topic self with="_"> </let>
   <let name=topic self with="_"> </let>
Line 263: Line 260:
     <let name=data[Title] null />
     <let name=data[Title] null />
     <load page=$pg_name />
     <load page=$pg_name />
     <if flag=data[Title]>
     <if flag=$data[Title]>
       <call GetBlogEntryBrief />
       <call GetBlogEntryBrief />
       <let name=e.rtn append copy=e.out />
       <let name=e.rtn append copy=e.out />
Line 270: Line 267:
   </for>
   </for>
</func>
</func>
 
==MakeBlogCatgs()==
</func>
 
<func MakeBlogCatgs>
<func MakeBlogCatgs>
   <let name=catUser copy=data[TopicsUser] />
   <let name=catUser copy=data[TopicsUser] />
Line 292: Line 287:
     <let name=wtCatUser append>|c]]'''</sub></let>
     <let name=wtCatUser append>|c]]'''</sub></let>


     <if not flag=noCat>
     <if not flag=$noCat>
       <let name=wtCatUser append> [[category:user/</let>
       <let name=wtCatUser append> [[category:user/</let>
       <let name=wtCatUser append copy=data[User] />
       <let name=wtCatUser append copy=data[User] />
Line 312: Line 307:
     <let name=wtCatGlob append>|c]]'''</sub></let>
     <let name=wtCatGlob append>|c]]'''</sub></let>


     <if not flag=noCat>
     <if not flag=$noCat>
       <let name=wtCatGlob append>[[category:</let>
       <let name=wtCatGlob append>[[category:</let>
       <let name=wtCatGlob append copy=topic />
       <let name=wtCatGlob append copy=topic />
Line 320: Line 315:
   </xploop>
   </xploop>
</func>
</func>
 
==ShowBlogPostPage()==
<func ShowBlogPostPage>
<func ShowBlogPostPage>
   <let name=PostDate copy=data[TimeStamp] len=10 />
   <let name=PostDate copy=data[TimeStamp] len=10 />
Line 337: Line 332:
   <let name=wtTitle append copy=data[Title] />
   <let name=wtTitle append copy=data[Title] />
   <let name=wtTitle append>==</let>
   <let name=wtTitle append>==</let>
   <if flag=data[TextAbove]>
   <if flag=$data[TextAbove]>
     <let name=wtTextBrief>
     <let name=wtTextBrief>
<span class=blog-post-section-hdr>In Brief</span>
<span class=blog-post-section-hdr>In Brief</span>
Line 363: Line 358:


   <let name=user copy=data[User] />
   <let name=user copy=data[User] />
   <if flag=user>
   <if flag=$user>
     <let name=wtUser>[[user:</let>
     <let name=wtUser>[[user:</let>
     <let name=wtUser append copy=user />
     <let name=wtUser append copy=user />
Line 391: Line 386:
|}</echo>
|}</echo>
</func>
</func>
==ShowBlogPostPage_v1()==
<func ShowBlogPostPage_v1>
<func ShowBlogPostPage_v1>
   <let name=PostDate copy=data[TimeStamp] len=10 />
   <let name=PostDate copy=data[TimeStamp] len=10 />
Line 407: Line 403:
   <let name=wtTitle append copy=data[Title] />
   <let name=wtTitle append copy=data[Title] />
   <let name=wtTitle append>==</let>
   <let name=wtTitle append>==</let>
   <if flag=data[TextAbove]>
   <if flag=$data[TextAbove]>
     <let name=wtTextBrief>
     <let name=wtTextBrief>
===In Brief===
===In Brief===
Line 432: Line 428:


   <let name=user copy=data[User] />
   <let name=user copy=data[User] />
   <if flag=user>
   <if flag=$user>
     <let name=wtUser>[[user:</let>
     <let name=wtUser>[[user:</let>
     <let name=wtUser append copy=user />
     <let name=wtUser append copy=user />
Line 456: Line 452:
<get name=data index=Text /><get name=wtTextBrief /><get name=wtTextFull /></echo>
<get name=data index=Text /><get name=wtTextBrief /><get name=wtTextFull /></echo>
</func>
</func>
</hide>

Revision as of 22:06, 16 December 2012

GetLinkBrief()


> function getlinkbrief() <= ()

ShowRecentLinks(max)


> function showrecentlinks() <= ()

ShowTopic(iTopic,iMax)

This should eventually be able to show data in any format: news links, blog entries...
> function showtopic() <= ()

GetBlogEntryBrief()


> function getblogentrybrief() <= ()

GetBlogEntryBriefChrisFormat()


> function getblogentrybriefchrisformat() <= ()

GetBlogEntryFull()


> function getblogentryfull() <= ()

ShowRecentBlogEntries(max,funcEntry)


> function showrecentblogentries() <= ()

ShowRecentBlogEntriesFull(max)


> function showrecentblogentriesfull() <= ()

ShowRecentBlogEntriesByTopic(max,topic)


> function showrecentblogentriesbytopic() <= ()

MakeBlogCatgs()


> function makeblogcatgs() <= ()

ShowBlogPostPage()


> function showblogpostpage() <= ()

ShowBlogPostPage_v1()


> function showblogpostpage_v1() <= ()