/[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.1 by wakaba, Sun Oct 5 11:24:52 2003 UTC revision 1.4 by wakaba, Sun Feb 1 12:12:45 2004 UTC
# Line 3  Line 3 
3  Plugin:  Plugin:
4    @Name: RandomJump    @Name: RandomJump
5    @Description:    @Description:
6        @@@:
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
10    @License: %%GPL%%    @License: %%GPL%%
11    @Author[list]:    @Author:
12       Wakaba <w@suika.fam.cx>      @@Name:
13          @@@@:Wakaba
14          @@@lang:ja
15          @@@script:Latn
16        @@Mail:w@suika.fam.cx
17    @Date.RCS: $Date$    @Date.RCS: $Date$
18      @RequiredModule[list]:
19        SuikaWiki::Output::HTTP
20      @RequiredPlugin[list]:
21        WikiLinking
22        WikiResource
23    
24  ViewDefinition:  ViewDefinition:
25    @Mode: RandomJump    @Mode: RandomJump
26    @Condition:    @Condition:
27      @@output: http-cgi      @@output: http-cgi
28    @Description:Redirection to a wiki page selected randomly    @Description:
29        @@@:Redirection to some WikiPage selected randomly
30        @@lang:en
31    @method:    @method:
32      @@@:      @@@:
33        $self->{view}->init_db;        $self->{view}->init_db;
34        my @list = $self->{view}->{wiki}->{db}->keys ('content');        my @list = $self->{view}->{wiki}->{db}->keys ('content');
35        &main::_http_see_other (page => $list[rand @list]);        
36          my $uri = $self->{view}->{wiki}->uri_reference
37                      (page => $list[rand @list],
38                       up_to_date => 1);
39          
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      @@Name: main      @@Name: main
45    
46    ViewFragment:
47      @Name: navbar
48      @Description:
49        @@@: "Go somewhere" button on navigation bar
50        @@lang:en
51      @Order: 110
52      @Formatting:
53        %link-to-wikipage (
54          mode => RandomJump, up-to-date,
55          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    
63    ViewFragment:
64      @Name: links
65      @Description:
66        @@@: "Go somewhere" link
67        @@lang:en
68      @Formatting:
69        %link-wiki (mode => RandomJump, up-to-date,
70                    rel => jump, class => randomlink,
71                    description => {%res(name=>GoSomewhereLink);}p);
72    
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

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.4

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24