#?SuikaWikiConfig/2.0 Plugin: @Name: RandomJump @Description: @@@: This plugin module provides "random jump" functions to select wiki pages randomly. @@lang:en @License: %%GPL%% @Author: @@Name: @@@@:Wakaba @@@lang:ja @@@script:Latn @@Mail:w@suika.fam.cx @Date.RCS: $Date: 2004/02/08 08:49:05 $ @RequiredModule[list]: SuikaWiki::Output::HTTP @RequiredPlugin[list]: WikiLinking WikiResource ViewDefinition: @Mode: RandomJump @Condition: @@output: http-cgi @Description: @@@:Redirection to some WikiPage selected randomly @@lang:en @method: @@@: $self->{view}->init_db; my @list = $self->{view}->{wiki}->{db}->keys ('content'); my $uri = $self->{view}->{wiki}->uri_reference (page => $self->{view}->{wiki}->name ($list[rand @list]), up_to_date => 1); require SuikaWiki::Output::HTTP; my $output = SuikaWiki::Output::HTTP->new (wiki => $self->{view}->{wiki}); $output->set_redirect (uri => $uri, status_code => 303); $output->output (output => 'http-cgi'); @@Name: main ViewFragment: @Name: navbar @Description: @@@: "Go somewhere" button on navigation bar @@lang:en @Order: 110 @Formatting: %link-to-wikipage ( mode => RandomJump, up-to-date, rel => jump, label => {%link-to-it ( label => {%res (name => GoSomewhere);}p, description => {%res (name => GoSomewhereLong);}p, class => randomlink, );}, ); ViewFragment: @Name: links @Description: @@@: "Go somewhere" link @@lang:en @Formatting: %link-wiki (mode => RandomJump, up-to-date, rel => jump, class => randomlink, description => {%res(name=>GoSomewhereLink);}p); Resource: @GoSomewhere: @@@: Lucky @@lang:en @GoSomewhereLink: @@@: Go somewhere in this wiki @@lang:en @GoSomewhereLong: @@@: Go somewhere in this wiki @@lang:en