/[pub]/suikawiki/wikidata/suikawiki-config.ph
Suika

Contents of /suikawiki/wikidata/suikawiki-config.ph

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.9 - (show annotations) (download)
Fri Jul 18 00:03:23 2003 UTC (21 years, 10 months ago) by w
Branch: MAIN
Changes since 1.8: +30 -29 lines
*** empty log message ***

1 use strict;
2
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 cookie_path => '/~wakaba/-temp/wiki/',
10 external_script => '../wiki/script/',
11 script_short_name => 'wiki',
12 ## If you use CVS repository of WikiDatabase,
13 #cvs_repository => 'http://path-to-viewcvs/path-to-repository/',
14 );
15 our $url_cgi; {
16 my $scheme = 'http';
17 $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}==80?'':":$main::ENV{SERVER_PORT}")."$uri{cookie_path}$uri{script_short_name}";
19 }
20 $uri{wiki} = $url_cgi;
21
22 ## Path to modules and databases
23 use lib qw!/home/wakaba/temp/msg!; # temporary
24 use lib qw!../wiki/lib!;
25 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)
30 CachePrefix => q(./wikidata/.cache.),
31 TempPrefix => q(./wikidata/.tmp.),
32 WikiDataBase => q(./wikidata/page),
33 WikiDatabaseErrorLog => q(./wikidata/error.log),
34 );
35
36 ## Type of WikiPage Database
37 #our $modifier_dbtype = 'AnyDBM_File'; # Fast, not available on some server, page size limited.
38 #our $modifier_dbtype = 'dbmopen'; # Fast, not available on some server, page size limited.
39 #our $modifier_dbtype = 'Yuki::YukiWikiDB'; # Slow, available on all environment.
40 #our $modifier_dbtype = 'Yuki::YukiWikiDB2'; # Slow, available on all environment.
41 our $modifier_dbtype = 'Yuki::YukiWikiDBMeta'; # Slow, available on all environment.
42 our $use_exists = 1; # If you can use 'exists' method for your DB.
43
44 ## Name of Special WikiPage (linked as parts of navigations)
45 our %PageName = (
46 FrontPage => 'HomePage',
47 IndexPage => 'IndexPage',
48 InterWikiName => 'Wiki//InterWikiName',
49 SearchPage => 'Wiki//Page//Search',
50 CreatePage => 'Wiki//Page//Create',
51 MenuBar => 'Wiki//MenuBar',
52 RecentChanges => 'RecentChanges',
53 RefererDontRecord => 'Wiki//Referer//IgnoreSite',
54 RefererSiteName => 'Wiki//Referer//SiteName',
55 ResourceNS => 'Wiki//Resource//',
56 StyleList => 'Wiki//Style//List//',
57 UserAgentList => 'Wiki//UserAgentList',
58 AdminSpecialPage => "\x11\x11Admin\x11Special\x11Page\x11\x11",
59 );
60
61 ## (Should be reimplemented)
62 our $kanjicode = 'euc';
63 our $lang = 'ja';
64
65 ## Misc. options
66 $SuikaWiki::Plugin::UserAgent::LoggingName = 1;
67 ## Use UA-name log? (require UserAgent plugin module)
68
69 ## Definition of views
70
71 require SuikaWiki::View;
72 SuikaWiki::View->template ('links')->add_line (<<'EOH');
73 %link-wiki(page=>"Wiki//News",rel=>News,class=>wiki,title=>"%res(name=>GoToWikiNewsLink);"p);
74 %link-wiki(page=>"Wiki//Help",rel=>help,class=>wiki,title=>"%res(name=>GoToWikiHelpLink);"p);
75 %link-wiki(page=>"Wiki//Page//License",rel=>copyright,class=>wiki,title=>"%res(name=>GoToWikiPageLicenseLink);"p);
76 EOH
77 SuikaWiki::View->template ('navbar')->add_line (<<"EOH");
78 %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);"p,title=>"%res(name=>ViewThisPageLong);"p);
80 %anchor-wiki(page=>{$main::PageName{CreatePage}},class=>wiki,label=>"%res(name=>GoToCreatePage);"p,title=>"%res(name=>GoToCreatePageLong);"p);
81 %anchor-wiki(page=>{$main::PageName{IndexPage}},class=>wiki,label=>"%res(name=>GoToIndexPage);"p,title=>"%res(name=>GoToIndexPageLong);"p);
82 %anchor-wiki(page=>{$main::PageName{SearchPage}},class=>wiki,label=>"%res(name=>GoToSearchPage);"p,title=>"%res(name=>GoToSearchPageLong);"p);
83 %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(page=>{$main::PageName{RecentChanges}},class=>wiki,label=>"%res(name=>GoToRecentChanges);"p,title=>"%res(name=>GoToRecentChangesLong,safe);"p);
85 EOH
86
87 push @{$SuikaWiki::Plugin::On{Load}}, sub {
88 SuikaWiki::View->definition ('read')->property (template => <<'EOH');
89 %html-document(title=>{%res(name=>{View:WebPageTitle});}p,link-meta=>{%predefined-template(name=>links);}p,content=>{
90 %section(level=>1,add-to-toc=>0,type=>body,title=>{%ns-short-page-name;}p,heading,content=>{
91 %section(id=>tools1,class=>tools,add-to-toc=>0,content=>{%predefined-template(name=>navbar);}p);
92 %section(level=>2,id=>read,add-to-toc=>0,content=>{
93 %if-calender(month,true=>{
94 %format(context=>form_input,template=>{%calender;});
95 },false=>{
96 %if-calender(true=>{
97 %format(context=>form_input,template=>{%calender-months;});
98 });
99 });
100 %read(comment);
101 }p);
102 %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=>{%res(name=>{Children:Item});}p);}p);
104 %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);
106 %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);
108 %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);
110 }p);
111 }p);%log-hotness;
112 EOH
113 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
118
119 suikawiki-config.ph --- SuikaWiki: site configuration script
120
121 =head1 LICENSE
122
123 Copyright 2003 Wakaba <w@suika.fam.cx>
124
125 This program is free software; you can redistribute it and/or
126 modify it under the same terms as Perl itself.
127
128 =cut
129
130 1; # $Date: 2003/04/29 10:43:21 $

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24