Wiki Home

How This Wiki Works

Namespace: Wiki
Some technical descriptions of how this wiki works. This should give us the ability to use it fully.

Described in VFP commands that probably don't really occur, but demonstrates the functionality. Wiki Macros and html tags have extra spaces to keep them from being evaluated by the wiki or your browser.
accept "Search: " to lcSearch
select * from wiki where upper( lcSearch ) $ upper( cWikiPageText )

For kicks, see if you can fix this to deal with the fact this wiki is optionally (user's option) transcluded with up to 31 others.... - ?lc

The New Tag # N#
Part of saving a page: StrTran( lcPageText, "# N #", "< NEW=sys(11,date()) >)

When a page is viewed:
the page is parsed into words
if lcWord = "< NEW="  
  do case
    case val( substr( lcWord, 6 ) ) > val( sys(11, date() )
      * Not sure what is going on here - see note below
    case val( substr( lcWord, 6 ) ) >= val( sys(11, date()-3 )
      lcWord = "< b>< small>< font color="red">[NEW]< /font>< /small>< /b>"
    case val( substr( lcWord, 6 ) ) >= val( sys(11, date()-5 )
      lcWord = "< b>< small>< font color="yellow?">[NEW]< /font>< /small>< /b>"
    case val( substr( lcWord, 6 ) ) >= val( sys(11, date()-7 )
      lcWord = "< b>< small>< font color="gray?">[NEW]< /font>< /small>< /b>"
      lcWord = ""

Note - So if you want a [NEW] to appear in the future, just bump the number up. There should be one here Jan 2010: (you can't see it yet, because it isn't 2010 yet)
For more kicks, try and map out the Hotlink parser. That is, the code that changes Camel Case words into links. :-) - ?lc

Ok, is it like this:

Since every page is parsed into words, look at every word, lcWord:

if upper(lcWord) = left(lcWord, 1) and not inlist(lcWord, upper(lcWord), lower(lcWord), proper(lcWord))

its camelcase. Then just make replace lcWord with:

'< a href="' + lcWord + '">' + lcWord + '< /a>' -- Mike Helland
Mike, I like this contrapositive approach a lot. However, note that CAMELcase is not a valid pattern, and I believe your method will get mixed up on that. Then, of course, there is camelcase, but that's another story... - lc
Better, just purchase Steve's framework. Even if you never set up a wiki, studying and learning from the design is well worth the price of admission - lc (who can attest to this, being a well satisfied SB-Wiki customer)
Contributors: Carl Karsten (Who's basically correct :-)-- Steven Black)
Category Wiki
( Topic last updated: 2000.09.05 11:52:25 AM )