/[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.2 - (hide annotations) (download)
Sat Oct 25 02:22:06 2003 UTC (21 years ago) by wakaba
Branch: MAIN
Changes since 1.1: +54 -5 lines
ErrorDocument removed

1 wakaba 1.1 #?SuikaWikiConfig/2.0
2    
3     Plugin:
4     @Name: RandomJump
5     @Description:
6 wakaba 1.2 @@@:
7 wakaba 1.1 This plugin module provides "random jump" functions
8     to select wiki pages randomly.
9 wakaba 1.2 @@lang:en
10 wakaba 1.1 @License: %%GPL%%
11 wakaba 1.2 @Author:
12     @@Name:
13     @@@@:Wakaba
14     @@@lang:ja
15     @@@script:Latn
16     @@Mail:w@suika.fam.cx
17     @Date.RCS: $Date: 2003/10/05 11:24:52 $
18 wakaba 1.1
19     ViewDefinition:
20     @Mode: RandomJump
21     @Condition:
22     @@output: http-cgi
23 wakaba 1.2 @Description:
24     @@@:Redirection to some WikiPage selected randomly
25     @@lang:en
26 wakaba 1.1 @method:
27     @@@:
28     $self->{view}->init_db;
29     my @list = $self->{view}->{wiki}->{db}->keys ('content');
30 wakaba 1.2
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 wakaba 1.1 @@Name: main
40 wakaba 1.2
41     ViewFragment:
42     @Name: navbar
43     @Description:
44     @@@: "Go somewhere" button on navigation bar
45     @@lang:en
46     @Order: 110
47     @Formatting:
48     %anchor-wiki(mode=>RandomJump,up-to-date,rel=>jump,
49     class=>"wiki randomlink",
50     label=>"%res(name=>GoSomewhere);"p,
51     title=>"%res(name=>GoSomewhereLong);"p);
52    
53     ViewFragment:
54     @Name: links
55     @Description:
56     @@@: "Go somewhere" link
57     @@lang:en
58     @Formatting:
59     %link-wiki(mode=>RandomJump,up-to-date,rel=>jump,
60     class=>"wiki randomlink",
61     title=>"%res(name=>GoSomewhereLink);"p);
62    
63     Resource:
64     @GoSomewhere:
65     @@@: Lucky
66     @@lang:en
67     @GoSomewhereLink:
68     @@@: Go somewhere in this wiki
69     @@lang:en
70     @GoSomewhereLong:
71     @@@: Go somewhere in this wiki
72     @@lang:en

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24