6 |
## script-short-name: wiki.cgi |
## script-short-name: wiki.cgi |
7 |
## URI parts MUST NOT contains "&" and/or non-URI characters. |
## URI parts MUST NOT contains "&" and/or non-URI characters. |
8 |
our %uri = ( |
our %uri = ( |
9 |
cookie_path => '/temp/suikawiki/', |
cookie_path => '/~wakaba/-temp/wiki/', |
10 |
external_script => '../wiki/script/', |
external_script => '../wiki/script/', |
11 |
script_short_name => 'wiki', |
script_short_name => 'wiki', |
12 |
## If you use CVS repository of WikiDatabase, |
## If you use CVS repository of WikiDatabase, |
15 |
our $url_cgi; { |
our $url_cgi; { |
16 |
my $scheme = 'http'; |
my $scheme = 'http'; |
17 |
$scheme = lc $1 if $main::ENV{SERVER_PROTOCOL} =~ m#([A-Za-z0-9+.%-]+)#; |
$scheme = lc $1 if $main::ENV{SERVER_PROTOCOL} =~ m#([A-Za-z0-9+.%-]+)#; |
18 |
$url_cgi = "$scheme://$main::ENV{SERVER_NAME}:$main::ENV{SERVER_PORT}$uri{cookie_path}$uri{script_short_name}"; |
$url_cgi = "$scheme://$main::ENV{SERVER_NAME}".($main::ENV{SERVER_PORT}==80?'':":$main::ENV{SERVER_PORT}")."$uri{cookie_path}$uri{script_short_name}"; |
19 |
} |
} |
20 |
$uri{wiki} = $url_cgi; |
$uri{wiki} = $url_cgi; |
21 |
|
|
22 |
## Path to modules and databases |
## Path to modules and databases |
23 |
use lib qw!/home/wakaba/temp/msg!; # temporary |
use lib qw!/home/wakaba/temp/msg!; # temporary |
24 |
use lib qw!../wiki/lib!; |
use lib qw!../wiki/lib!; |
25 |
$SuikaWiki::Plugin::plugin_directory = q(../wiki/lib/SuikaWiki/Plugin/); |
push @SuikaWiki::Plugin::plugin_directory, ( |
26 |
|
q(../wiki/lib/SuikaWiki/Plugin/), |
27 |
|
q(../wiki/misc/plugins/), |
28 |
|
); |
29 |
our %PathTo = ( ## Path to your data, from the main CGI script (NOT from this config script) |
our %PathTo = ( ## Path to your data, from the main CGI script (NOT from this config script) |
30 |
CachePrefix => q(./wikidata/.cache.), |
CachePrefix => q(./wikidata/.cache.), |
31 |
TempPrefix => q(./wikidata/.tmp.), |
TempPrefix => q(./wikidata/.tmp.), |
32 |
WikiDataBase => q(./wikidata/page), |
WikiDataBase => q(./wikidata/page), |
33 |
|
WikiDatabaseErrorLog => q(./wikidata/error.log), |
34 |
); |
); |
35 |
|
|
36 |
## Type of WikiPage Database |
## Type of WikiPage Database |
45 |
our %PageName = ( |
our %PageName = ( |
46 |
FrontPage => 'HomePage', |
FrontPage => 'HomePage', |
47 |
IndexPage => 'IndexPage', |
IndexPage => 'IndexPage', |
48 |
SearchPage => 'SearchPage', |
InterWikiName => 'Wiki//InterWikiName', |
49 |
CreatePage => 'CreatePage', |
SearchPage => 'Wiki//Page//Search', |
50 |
|
CreatePage => 'Wiki//Page//Create', |
51 |
|
MenuBar => 'Wiki//MenuBar', |
52 |
RecentChanges => 'RecentChanges', |
RecentChanges => 'RecentChanges', |
53 |
|
RefererDontRecord => 'Wiki//Referer//IgnoreSite', |
54 |
|
RefererSiteName => 'Wiki//Referer//SiteName', |
55 |
ResourceNS => 'Wiki//Resource//', |
ResourceNS => 'Wiki//Resource//', |
56 |
StyleList => 'Wiki//Style//List//', |
StyleList => 'Wiki//Style//List//', |
57 |
UserAgentList => 'Wiki//UserAgentList', |
UserAgentList => 'Wiki//UserAgentList', |
61 |
## (Should be reimplemented) |
## (Should be reimplemented) |
62 |
our $kanjicode = 'euc'; |
our $kanjicode = 'euc'; |
63 |
our $lang = 'ja'; |
our $lang = 'ja'; |
|
$wiki::useragent::UseLog = 0; ## Use User-Agent name log (WikiUserAgentList) or not |
|
64 |
|
|
65 |
## Misc. options |
## Misc. options |
66 |
|
$SuikaWiki::Plugin::UserAgent::LoggingName = 1; |
67 |
|
## Use UA-name log? (require UserAgent plugin module) |
68 |
|
|
69 |
## Definition of views |
## Definition of views |
70 |
|
|
71 |
require SuikaWiki::View; |
require SuikaWiki::View; |
72 |
SuikaWiki::View->template ('links')->add_line (<<'EOH'); |
SuikaWiki::View->template ('links')->add_line (<<'EOH'); |
73 |
%link-wiki(page=>IndexPage,rel=>index,class=>wiki,title=>"%res(name=>GoToIndexPageLink,safe);"p); |
%link-wiki(page=>"Wiki//News",rel=>News,class=>wiki,title=>"%res(name=>GoToWikiNewsLink);"p); |
74 |
%link-wiki(page=>HomePage,rel=>home,class=>wiki,title=>"%res(name=>GoToHomePageLink,safe);"p); |
%link-wiki(page=>"Wiki//Help",rel=>help,class=>wiki,title=>"%res(name=>GoToWikiHelpLink);"p); |
75 |
%link-wiki(page=>"Wiki//News",rel=>News,class=>wiki,title=>"%res(name=>GoToWikiNewsLink,safe);"p); |
%link-wiki(page=>"Wiki//Page//License",rel=>copyright,class=>wiki,title=>"%res(name=>GoToWikiPageLicenseLink);"p); |
|
%link-wiki(page=>SearchPage,rel=>search,class=>wiki,title=>"%res(name=>GoToSearchPageLink,safe);"p); |
|
|
%link-wiki(page=>"Wiki//Help",mode=>read,rel=>help,class=>wiki,title=>"%res(name=>GoToWikiHelpLink,safe);"p); |
|
|
%link-wiki(page=>"Wiki//Page//License",rel=>copyright,class=>wiki,title=>"%res(name=>GoToWikiPageLicenseLink,safe);"p); |
|
|
%link-wiki(mode=>RandomJump,up_to_date,rel=>jump,class=>"wiki randomlink",title=>"%res(name=>GoSomewhereLink,safe);"p); |
|
|
%link-wiki(href=>"javascript:var%20WikiName=prompt('Please%20input%20the%20WikiName:','','Jump%20to%20SuikaWiki');if(WikiName)%7B_content.location.href='$url_cgi%3F'+encodeURIComponent(WikiName)%7D",rel=>jump,class=>wiki-cmd,title=>"%res(name=>JumpToLink,safe);"p); |
|
|
%link-wiki(href=>"javascript:var%20WikiName=prompt('Please%20input%20the%20WikiName:','','Jump%20to%20SuikaWiki');if(WikiName)%7B_content.location.href='$url_cgi%3Fmycmd=edit;mypage='+encodeURIComponent(WikiName)%7D",rel=>jump,class=>wiki-cmd,title=>"%res(name=>JumpToEditLink,safe);"p); |
|
76 |
EOH |
EOH |
77 |
SuikaWiki::View->template ('navbar')->add_line (<<'EOH'); |
SuikaWiki::View->template ('navbar')->add_line (<<"EOH"); |
78 |
%anchor-wiki(mode=>edit,rel=>edit,class=>wiki-cmd,label=>"%res(name=>EditThisPage,safe);"p,title=>"%res(name=>EditThisPageLong);"p,accesskey=>E); |
%anchor-wiki(mode=>edit,rel=>edit,class=>wiki-cmd,label=>"%res(name=>EditThisPage);"p,title=>"%res(name=>EditThisPageLong);"p,accesskey=>E); |
79 |
%anchor-wiki(rel=>view,up_to_date,class=>wiki-cmd,label=>"%res(name=>ViewThisPage,safe);"p,title=>"%res(name=>ViewThisPageLong);"p); |
%anchor-wiki(rel=>view,up_to_date,class=>wiki-cmd,label=>"%res(name=>ViewThisPage);"p,title=>"%res(name=>ViewThisPageLong);"p); |
80 |
%anchor-wiki(page=>CreatePage,class=>wiki,label=>"%res(name=>GoToCreatePage,safe);"p,title=>"%res(name=>GoToCreatePageLong,safe);"p); |
%anchor-wiki(page=>{$main::PageName{CreatePage}},class=>wiki,label=>"%res(name=>GoToCreatePage);"p,title=>"%res(name=>GoToCreatePageLong);"p); |
81 |
%anchor-wiki(page=>IndexPage,class=>wiki,label=>"%res(name=>GoToIndexPage,safe);"p,title=>"%res(name=>GoToIndexPageLong,safe);"p); |
%anchor-wiki(page=>{$main::PageName{IndexPage}},class=>wiki,label=>"%res(name=>GoToIndexPage);"p,title=>"%res(name=>GoToIndexPageLong);"p); |
82 |
%anchor-wiki(page=>HomePage,class=>wiki,label=>"%res(name=>GoToHomePage,safe);"p,title=>"%res(name=>GoToHomePageLong,safe);"p); |
%anchor-wiki(page=>{$main::PageName{SearchPage}},class=>wiki,label=>"%res(name=>GoToSearchPage);"p,title=>"%res(name=>GoToSearchPageLong);"p); |
83 |
%anchor-wiki(page=>SearchPage,class=>wiki,label=>"%res(name=>GoToSearchPage,safe);"p,title=>"%res(name=>GoToSearchPageLong,safe);"p); |
%anchor-wiki(mode=>RandomJump,up-to-date,rel=>lucky,class=>"wiki randomlink",label=>"%res(name=>GoSomewhere);"p,title=>"%res(name=>GoSomewhereLong);"p); |
84 |
%anchor-wiki(mode=>RandomJump,up-to-date,rel=>lucky,class=>"wiki randomlink",label=>"%res(name=>GoSomewhere,safe);"p,title=>"%res(name=>GoSomewhereLong,safe);"p); |
%anchor-wiki(page=>{$main::PageName{RecentChanges}},class=>wiki,label=>"%res(name=>GoToRecentChanges);"p,title=>"%res(name=>GoToRecentChangesLong,safe);"p); |
|
%anchor-wiki(page=>RecentChanges,class=>wiki,label=>"%res(name=>GoToRecentChanges,safe);"p,title=>"%res(name=>GoToRecentChangesLong,safe);"p); |
|
85 |
EOH |
EOH |
86 |
|
|
87 |
push @{$SuikaWiki::Plugin::On{Load}}, sub { |
push @{$SuikaWiki::Plugin::On{Load}}, sub { |
100 |
%read(comment); |
%read(comment); |
101 |
}p); |
}p); |
102 |
%section(level=>2,id=>children,title=>{%res(name=>{Children:Title});}p,heading, |
%section(level=>2,id=>children,title=>{%res(name=>{Children:Title});}p,heading, |
103 |
content=>{%page-list(ns=>{%page-name;}p,recursive=>0,type=>both,template=>{ |
content=>{%page-list(ns=>{%page-name;}p,recursive=>0,type=>both,template=>{%res(name=>{Children:Item});}p);}p); |
|
%wiki-link(label=>{%ns-short-page-or-ns-name;}p); |
|
|
});}p); |
|
104 |
%section(level=>2,id=>see-also,title=>{%res(name=>SeeAlso);}p,heading,content=>{%search-result;}p); |
%section(level=>2,id=>see-also,title=>{%res(name=>SeeAlso);}p,heading,content=>{%search-result;}p); |
105 |
%section(level=>2,id=>referer,title=>{%res(name=>Referer);}p,heading,content=>{%referer-list;}p); |
%section(level=>2,id=>referer,title=>{%res(name=>Referer);}p,heading,content=>{%referer-list;}p); |
106 |
%section(level=>2,id=>toc,title=>{%res(name=>{TOC:Title};}p,heading,add_to_toc=>0,content=>{%toc(drag);}p); |
%section(level=>2,id=>toc,title=>{%res(name=>{TOC:Title});}p,heading,add_to_toc=>0,content=>{%toc(drag);}p); |
107 |
%section(id=>last-modified,add_to_toc=>0,content=>{%res(name=>{LastModified=});%last-modified;}p); |
%section(id=>last-modified,add_to_toc=>0,content=>{%res(name=>{LastModified=});%last-modified;}p); |
108 |
%section(class=>tools,add_to_toc=>0,content=>{%predefined-template(name=>navbar);}p); |
%section(class=>tools,add_to_toc=>0,content=>{%predefined-template(name=>navbar);}p); |
109 |
%section(id=>footer,add-to-toc=>0,content=>{%predefined-template(name=>footer);}p); |
%section(id=>footer,add-to-toc=>0,content=>{%predefined-template(name=>footer);}p); |
111 |
}p);%log-hotness; |
}p);%log-hotness; |
112 |
EOH |
EOH |
113 |
SuikaWiki::View->definition ('-wrote')->property (template => SuikaWiki::View->definition ('-wrote')->property ('template').q(%log-hotness(weight=>2);)); |
SuikaWiki::View->definition ('-wrote')->property (template => SuikaWiki::View->definition ('-wrote')->property ('template').q(%log-hotness(weight=>2);)); |
114 |
|
SuikaWiki::View->definition ('WithMenu')->property (template => SuikaWiki::View->definition ('WithMenu')->property ('template').q(%log-hotness;)); |
115 |
}; |
}; |
116 |
|
|
117 |
=head1 NAME |
=head1 NAME |