/[pub]/suikawiki/script/misc/plugins/RandomJump.wp2
Suika

Contents of /suikawiki/script/misc/plugins/RandomJump.wp2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Tue Nov 25 12:45:31 2003 UTC (20 years, 11 months ago) by wakaba
Branch: MAIN
Changes since 1.2: +12 -6 lines
Use new WikiLinking interface

1 #?SuikaWikiConfig/2.0
2
3 Plugin:
4 @Name: RandomJump
5 @Description:
6 @@@:
7 This plugin module provides "random jump" functions
8 to select wiki pages randomly.
9 @@lang:en
10 @License: %%GPL%%
11 @Author:
12 @@Name:
13 @@@@:Wakaba
14 @@@lang:ja
15 @@@script:Latn
16 @@Mail:w@suika.fam.cx
17 @Date.RCS: $Date: 2003/10/25 02:22:06 $
18
19 ViewDefinition:
20 @Mode: RandomJump
21 @Condition:
22 @@output: http-cgi
23 @Description:
24 @@@:Redirection to some WikiPage selected randomly
25 @@lang:en
26 @method:
27 @@@:
28 $self->{view}->init_db;
29 my @list = $self->{view}->{wiki}->{db}->keys ('content');
30
31 my $uri = SuikaWiki::Plugin->_uri_wiki_page
32 (join ('//', @{$list[rand @list]}),
33 up_to_date => 1, absolute => 1);
34
35 require SuikaWiki::Output::HTTP;
36 my $output = SuikaWiki::Output::HTTP->new (wiki => $self->{view}->{wiki});
37 $output->set_redirect (uri => $uri, status_code => 303);
38 $output->output (output => 'http-cgi');
39 @@Name: main
40
41 ViewFragment:
42 @Name: navbar
43 @Description:
44 @@@: "Go somewhere" button on navigation bar
45 @@lang:en
46 @Order: 110
47 @Formatting:
48 %link-to-wikipage (
49 mode => RandomJump,
50 up-to-date,
51 rel => jump,
52 label => {%link-to-it (
53 label => {%res (name => GoSomewhere);}p,
54 description => {%res (name => GoSomewhereLong);}p,
55 class => randomlink,
56 );},
57 );
58
59 ViewFragment:
60 @Name: links
61 @Description:
62 @@@: "Go somewhere" link
63 @@lang:en
64 @Formatting:
65 %link-wiki(mode=>RandomJump,up-to-date,rel=>jump,
66 class=>randomlink,
67 title=>"%res(name=>GoSomewhereLink);"p);
68
69 Resource:
70 @GoSomewhere:
71 @@@: Lucky
72 @@lang:en
73 @GoSomewhereLink:
74 @@@: Go somewhere in this wiki
75 @@lang:en
76 @GoSomewhereLong:
77 @@@: Go somewhere in this wiki
78 @@lang:en

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24