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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by wakaba, Tue Nov 25 12:45:31 2003 UTC revision 1.7 by wakaba, Tue Sep 21 03:18:21 2004 UTC
# Line 7  Plugin: Line 7  Plugin:
7       This plugin module provides "random jump" functions       This plugin module provides "random jump" functions
8       to select wiki pages randomly.       to select wiki pages randomly.
9      @@lang:en      @@lang:en
10    @License: %%GPL%%    @License: %%Perl%%
11    @Author:    @Author:
12      @@Name:      @@Name:
13        @@@@:Wakaba        @@@@:Wakaba
14        @@@lang:ja        @@@lang:ja
15        @@@script:Latn        @@@script:Latn
16      @@Mail:[email protected]      @@Mail:[email protected]
17    @Date.RCS: $Date$    @Date.RCS:
18        $Date$
19      @RequiredModule[list]:
20        SuikaWiki::Output::HTTP
21      @RequiredPlugin[list]:
22        WikiLinking
23        WikiResource
24    
25  ViewDefinition:  ViewDefinition:
26    @Mode: RandomJump    @Mode: RandomJump
# Line 28  ViewDefinition: Line 34  ViewDefinition:
34        $self->{view}->init_db;        $self->{view}->init_db;
35        my @list = $self->{view}->{wiki}->{db}->keys ('content');        my @list = $self->{view}->{wiki}->{db}->keys ('content');
36                
37        my $uri = SuikaWiki::Plugin->_uri_wiki_page        my $uri = $self->{view}->{wiki}->uri_reference
38                    (join ('//', @{$list[rand @list]}),                    (page => $self->{view}->{wiki}->name ($list[rand @list]),
39                     up_to_date => 1, absolute => 1);                     up_to_date => 1);
40                
41        require SuikaWiki::Output::HTTP;        require SuikaWiki::Output::HTTP;
42        my $output = SuikaWiki::Output::HTTP->new (wiki => $self->{view}->{wiki});        my $output = SuikaWiki::Output::HTTP->new (wiki => $self->{view}->{wiki});
43        $output->set_redirect (uri => $uri, status_code => 303);        $output->set_redirect (uri => $uri, status_code => 307);
44        $output->output (output => 'http-cgi');        $output->output (output => 'http-cgi');
45      @@Name: main      @@Name: main
46    
# Line 46  ViewFragment: Line 52  ViewFragment:
52    @Order: 110    @Order: 110
53    @Formatting:    @Formatting:
54      %link-to-wikipage (      %link-to-wikipage (
55        mode => RandomJump,        mode => RandomJump, up-to-date,
       up-to-date,  
56        rel => jump,        rel => jump,
57        label => {%link-to-it (        label => {%link-to-it (
58          label => {%res (name => GoSomewhere);}p,          label => {%res (name => GoSomewhere);}p,
# Line 62  ViewFragment: Line 67  ViewFragment:
67      @@@: "Go somewhere" link      @@@: "Go somewhere" link
68      @@lang:en      @@lang:en
69    @Formatting:    @Formatting:
70      %link-wiki(mode=>RandomJump,up-to-date,rel=>jump,      %link-wiki (mode => RandomJump, up-to-date,
71                 class=>randomlink,                  rel => jump, class => randomlink,
72                 title=>"%res(name=>GoSomewhereLink);"p);                  description => {%res(name=>GoSomewhereLink);}p);
73    
74  Resource:  Resource:
75    @GoSomewhere:    @GoSomewhere:

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.7

[email protected]
ViewVC Help
Powered by ViewVC 1.1.24