/[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.5 - (hide annotations) (download)
Sun Feb 8 08:49:05 2004 UTC (20 years, 8 months ago) by wakaba
Branch: MAIN
Changes since 1.4: +2 -2 lines
SuikaWiki 3 WikiName & SuikaWikiImage/0.9 support

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 wakaba 1.5 @Date.RCS: $Date: 2004/02/01 12:12:45 $
18 wakaba 1.4 @RequiredModule[list]:
19     SuikaWiki::Output::HTTP
20     @RequiredPlugin[list]:
21     WikiLinking
22     WikiResource
23 wakaba 1.1
24     ViewDefinition:
25     @Mode: RandomJump
26     @Condition:
27     @@output: http-cgi
28 wakaba 1.2 @Description:
29     @@@:Redirection to some WikiPage selected randomly
30     @@lang:en
31 wakaba 1.1 @method:
32     @@@:
33     $self->{view}->init_db;
34     my @list = $self->{view}->{wiki}->{db}->keys ('content');
35 wakaba 1.2
36 wakaba 1.4 my $uri = $self->{view}->{wiki}->uri_reference
37 wakaba 1.5 (page => $self->{view}->{wiki}->name ($list[rand @list]),
38 wakaba 1.4 up_to_date => 1);
39 wakaba 1.2
40     require SuikaWiki::Output::HTTP;
41     my $output = SuikaWiki::Output::HTTP->new (wiki => $self->{view}->{wiki});
42     $output->set_redirect (uri => $uri, status_code => 303);
43     $output->output (output => 'http-cgi');
44 wakaba 1.1 @@Name: main
45 wakaba 1.2
46     ViewFragment:
47     @Name: navbar
48     @Description:
49     @@@: "Go somewhere" button on navigation bar
50     @@lang:en
51     @Order: 110
52     @Formatting:
53 wakaba 1.3 %link-to-wikipage (
54 wakaba 1.4 mode => RandomJump, up-to-date,
55 wakaba 1.3 rel => jump,
56     label => {%link-to-it (
57     label => {%res (name => GoSomewhere);}p,
58     description => {%res (name => GoSomewhereLong);}p,
59     class => randomlink,
60     );},
61     );
62 wakaba 1.2
63     ViewFragment:
64     @Name: links
65     @Description:
66     @@@: "Go somewhere" link
67     @@lang:en
68     @Formatting:
69 wakaba 1.4 %link-wiki (mode => RandomJump, up-to-date,
70     rel => jump, class => randomlink,
71     description => {%res(name=>GoSomewhereLink);}p);
72 wakaba 1.2
73     Resource:
74     @GoSomewhere:
75     @@@: Lucky
76     @@lang:en
77     @GoSomewhereLink:
78     @@@: Go somewhere in this wiki
79     @@lang:en
80     @GoSomewhereLong:
81     @@@: Go somewhere in this wiki
82     @@lang:en

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24