Roxen.git
/
server
/
modules
/
examples
/
fnord.pike
version
»
Context lines:
10
20
40
80
file
none
3
Roxen.git/server/modules/examples/fnord.pike:1:
// This is a roxen module. Copyright © 1996 - 2000, Roxen IS. // This is a small sample module. It is intended to show a simple example // of a container. // This variable is shown in the configinterface as the version of the module.
-
string cvs_version = "$Id: fnord.pike,v 1.
8
2000/
02
/
24
05
:39:
03
nilsson Exp $";
+
string cvs_version = "$Id: fnord.pike,v 1.
9
2000/
03
/
17
00
:39:
43
nilsson Exp $";
// Tell Roxen that this module is threadsafe. That is there is no // request specific data in global variables. int thread_safe=1; // Include and inherit code that is needed in every module. #include <module.h> inherit "module";
Roxen.git/server/modules/examples/fnord.pike:53:
// This server <FNORD ALT="provides">will provide, when we // actually get to it,</FNORD> complete source for the ... // The way the normally hidden text is made visible is by including // "fnord" in the prestates (i.e. add "/(fnord)" before the "filename" // part of the URL). // Michael A. Patton <map@bbn.com>
-
// This is the code for the actual container. By naming it "
container
_"
-
// it is automatically recognized by Roxen as the code for a
container
-
//
tag
and is registered in its list of container tags
.
+
// This is the code for the actual container. By naming it "
simpletag
_"
+
// it is automatically recognized by Roxen as the code for a tag.
// First, check the 'request_id->prestate' multiset for the presence // of 'fnord'. If it is there, show the contents, otherwise, if there // is an 'alt' text, display it, if not, simply return an empty string
-
string
container
_fnord(string tag_name, mapping arguments, string contents,
+
string
simpletag
_fnord(string tag_name, mapping arguments, string contents,
RequestID id ) { if (id->prestate->fnord) return contents; if (arguments->alt) return arguments->alt; return ""; }