1 |
w |
1.1 |
use strict; |
2 |
wakaba |
1.6 |
|
3 |
|
|
## URI (or part of URI) of Wiki CGI itself and its external addons |
4 |
|
|
## Note: If your Wiki CGI URI is <http://foo.example/path/to/wiki.cgi>, |
5 |
|
|
## cookie-path: /path/to/ |
6 |
|
|
## script-short-name: wiki.cgi |
7 |
|
|
## URI parts MUST NOT contains "&" and/or non-URI characters. |
8 |
|
|
our %uri = ( |
9 |
w |
1.9 |
cookie_path => '/~wakaba/-temp/wiki/', |
10 |
wakaba |
1.6 |
external_script => '../wiki/script/', |
11 |
|
|
script_short_name => 'wiki', |
12 |
wakaba |
1.7 |
## If you use CVS repository of WikiDatabase, |
13 |
|
|
#cvs_repository => 'http://path-to-viewcvs/path-to-repository/', |
14 |
wakaba |
1.6 |
); |
15 |
|
|
our $url_cgi; { |
16 |
w |
1.4 |
my $scheme = 'http'; |
17 |
|
|
$scheme = lc $1 if $main::ENV{SERVER_PROTOCOL} =~ m#([A-Za-z0-9+.%-]+)#; |
18 |
w |
1.9 |
$url_cgi = "$scheme://$main::ENV{SERVER_NAME}".($main::ENV{SERVER_PORT}==80?'':":$main::ENV{SERVER_PORT}")."$uri{cookie_path}$uri{script_short_name}"; |
19 |
wakaba |
1.6 |
} |
20 |
wakaba |
1.10 |
$uri{wiki_abs} = $url_cgi; |
21 |
|
|
$uri{wiki} = qq($uri{cookie_path}$uri{script_short_name}); |
22 |
wakaba |
1.6 |
|
23 |
|
|
## Path to modules and databases |
24 |
wakaba |
1.10 |
push @main::INC, 'lib'; |
25 |
w |
1.9 |
push @SuikaWiki::Plugin::plugin_directory, ( |
26 |
wakaba |
1.10 |
q(lib/SuikaWiki/Plugin/), |
27 |
|
|
q(misc/plugins/), |
28 |
w |
1.9 |
); |
29 |
wakaba |
1.6 |
our %PathTo = ( ## Path to your data, from the main CGI script (NOT from this config script) |
30 |
|
|
CachePrefix => q(./wikidata/.cache.), |
31 |
wakaba |
1.8 |
TempPrefix => q(./wikidata/.tmp.), |
32 |
wakaba |
1.6 |
WikiDataBase => q(./wikidata/page), |
33 |
w |
1.9 |
WikiDatabaseErrorLog => q(./wikidata/error.log), |
34 |
wakaba |
1.10 |
convert => q(/usr/X11R6/bin/convert), |
35 |
wakaba |
1.6 |
); |
36 |
|
|
|
37 |
|
|
## Type of WikiPage Database |
38 |
|
|
#our $modifier_dbtype = 'AnyDBM_File'; # Fast, not available on some server, page size limited. |
39 |
|
|
#our $modifier_dbtype = 'dbmopen'; # Fast, not available on some server, page size limited. |
40 |
|
|
#our $modifier_dbtype = 'Yuki::YukiWikiDB'; # Slow, available on all environment. |
41 |
|
|
#our $modifier_dbtype = 'Yuki::YukiWikiDB2'; # Slow, available on all environment. |
42 |
|
|
our $modifier_dbtype = 'Yuki::YukiWikiDBMeta'; # Slow, available on all environment. |
43 |
|
|
our $use_exists = 1; # If you can use 'exists' method for your DB. |
44 |
|
|
|
45 |
|
|
## Name of Special WikiPage (linked as parts of navigations) |
46 |
|
|
our %PageName = ( |
47 |
|
|
FrontPage => 'HomePage', |
48 |
|
|
IndexPage => 'IndexPage', |
49 |
w |
1.9 |
InterWikiName => 'Wiki//InterWikiName', |
50 |
|
|
SearchPage => 'Wiki//Page//Search', |
51 |
|
|
CreatePage => 'Wiki//Page//Create', |
52 |
|
|
MenuBar => 'Wiki//MenuBar', |
53 |
wakaba |
1.6 |
RecentChanges => 'RecentChanges', |
54 |
w |
1.9 |
RefererDontRecord => 'Wiki//Referer//IgnoreSite', |
55 |
|
|
RefererSiteName => 'Wiki//Referer//SiteName', |
56 |
wakaba |
1.7 |
ResourceNS => 'Wiki//Resource//', |
57 |
wakaba |
1.8 |
StyleList => 'Wiki//Style//List//', |
58 |
|
|
UserAgentList => 'Wiki//UserAgentList', |
59 |
wakaba |
1.6 |
AdminSpecialPage => "\x11\x11Admin\x11Special\x11Page\x11\x11", |
60 |
|
|
); |
61 |
|
|
|
62 |
|
|
## (Should be reimplemented) |
63 |
|
|
our $kanjicode = 'euc'; |
64 |
|
|
our $lang = 'ja'; |
65 |
|
|
|
66 |
|
|
## Misc. options |
67 |
w |
1.9 |
$SuikaWiki::Plugin::UserAgent::LoggingName = 1; |
68 |
|
|
## Use UA-name log? (require UserAgent plugin module) |
69 |
w |
1.3 |
|
70 |
wakaba |
1.6 |
## Definition of views |
71 |
w |
1.4 |
|
72 |
wakaba |
1.7 |
require SuikaWiki::View; |
73 |
wakaba |
1.8 |
SuikaWiki::View->template ('links')->add_line (<<'EOH'); |
74 |
w |
1.9 |
%link-wiki(page=>"Wiki//News",rel=>News,class=>wiki,title=>"%res(name=>GoToWikiNewsLink);"p); |
75 |
|
|
%link-wiki(page=>"Wiki//Help",rel=>help,class=>wiki,title=>"%res(name=>GoToWikiHelpLink);"p); |
76 |
|
|
%link-wiki(page=>"Wiki//Page//License",rel=>copyright,class=>wiki,title=>"%res(name=>GoToWikiPageLicenseLink);"p); |
77 |
wakaba |
1.8 |
EOH |
78 |
w |
1.9 |
SuikaWiki::View->template ('navbar')->add_line (<<"EOH"); |
79 |
|
|
%anchor-wiki(mode=>edit,rel=>edit,class=>wiki-cmd,label=>"%res(name=>EditThisPage);"p,title=>"%res(name=>EditThisPageLong);"p,accesskey=>E); |
80 |
|
|
%anchor-wiki(rel=>view,up_to_date,class=>wiki-cmd,label=>"%res(name=>ViewThisPage);"p,title=>"%res(name=>ViewThisPageLong);"p); |
81 |
|
|
%anchor-wiki(page=>{$main::PageName{CreatePage}},class=>wiki,label=>"%res(name=>GoToCreatePage);"p,title=>"%res(name=>GoToCreatePageLong);"p); |
82 |
|
|
%anchor-wiki(page=>{$main::PageName{IndexPage}},class=>wiki,label=>"%res(name=>GoToIndexPage);"p,title=>"%res(name=>GoToIndexPageLong);"p); |
83 |
|
|
%anchor-wiki(page=>{$main::PageName{SearchPage}},class=>wiki,label=>"%res(name=>GoToSearchPage);"p,title=>"%res(name=>GoToSearchPageLong);"p); |
84 |
|
|
%anchor-wiki(mode=>RandomJump,up-to-date,rel=>lucky,class=>"wiki randomlink",label=>"%res(name=>GoSomewhere);"p,title=>"%res(name=>GoSomewhereLong);"p); |
85 |
|
|
%anchor-wiki(page=>{$main::PageName{RecentChanges}},class=>wiki,label=>"%res(name=>GoToRecentChanges);"p,title=>"%res(name=>GoToRecentChangesLong,safe);"p); |
86 |
w |
1.4 |
EOH |
87 |
|
|
|
88 |
wakaba |
1.8 |
push @{$SuikaWiki::Plugin::On{Load}}, sub { |
89 |
|
|
SuikaWiki::View->definition ('read')->property (template => <<'EOH'); |
90 |
|
|
%html-document(title=>{%res(name=>{View:WebPageTitle});}p,link-meta=>{%predefined-template(name=>links);}p,content=>{ |
91 |
|
|
%section(level=>1,add-to-toc=>0,type=>body,title=>{%ns-short-page-name;}p,heading,content=>{ |
92 |
|
|
%section(id=>tools1,class=>tools,add-to-toc=>0,content=>{%predefined-template(name=>navbar);}p); |
93 |
|
|
%section(level=>2,id=>read,add-to-toc=>0,content=>{ |
94 |
|
|
%if-calender(month,true=>{ |
95 |
|
|
%format(context=>form_input,template=>{%calender;}); |
96 |
|
|
},false=>{ |
97 |
|
|
%if-calender(true=>{ |
98 |
|
|
%format(context=>form_input,template=>{%calender-months;}); |
99 |
|
|
}); |
100 |
|
|
}); |
101 |
|
|
%read(comment); |
102 |
|
|
}p); |
103 |
|
|
%section(level=>2,id=>children,title=>{%res(name=>{Children:Title});}p,heading, |
104 |
w |
1.9 |
content=>{%page-list(ns=>{%page-name;}p,recursive=>0,type=>both,template=>{%res(name=>{Children:Item});}p);}p); |
105 |
wakaba |
1.8 |
%section(level=>2,id=>see-also,title=>{%res(name=>SeeAlso);}p,heading,content=>{%search-result;}p); |
106 |
|
|
%section(level=>2,id=>referer,title=>{%res(name=>Referer);}p,heading,content=>{%referer-list;}p); |
107 |
w |
1.9 |
%section(level=>2,id=>toc,title=>{%res(name=>{TOC:Title});}p,heading,add_to_toc=>0,content=>{%toc(drag);}p); |
108 |
wakaba |
1.8 |
%section(id=>last-modified,add_to_toc=>0,content=>{%res(name=>{LastModified=});%last-modified;}p); |
109 |
|
|
%section(class=>tools,add_to_toc=>0,content=>{%predefined-template(name=>navbar);}p); |
110 |
|
|
%section(id=>footer,add-to-toc=>0,content=>{%predefined-template(name=>footer);}p); |
111 |
|
|
}p); |
112 |
|
|
}p);%log-hotness; |
113 |
w |
1.4 |
EOH |
114 |
wakaba |
1.8 |
SuikaWiki::View->definition ('-wrote')->property (template => SuikaWiki::View->definition ('-wrote')->property ('template').q(%log-hotness(weight=>2);)); |
115 |
w |
1.9 |
SuikaWiki::View->definition ('WithMenu')->property (template => SuikaWiki::View->definition ('WithMenu')->property ('template').q(%log-hotness;)); |
116 |
wakaba |
1.8 |
}; |
117 |
w |
1.1 |
|
118 |
wakaba |
1.6 |
=head1 NAME |
119 |
|
|
|
120 |
|
|
suikawiki-config.ph --- SuikaWiki: site configuration script |
121 |
|
|
|
122 |
|
|
=head1 LICENSE |
123 |
|
|
|
124 |
|
|
Copyright 2003 Wakaba <w@suika.fam.cx> |
125 |
|
|
|
126 |
|
|
This program is free software; you can redistribute it and/or |
127 |
|
|
modify it under the same terms as Perl itself. |
128 |
|
|
|
129 |
|
|
=cut |
130 |
|
|
|
131 |
wakaba |
1.10 |
1; # $Date: 2003/07/18 00:03:23 $ |