4 use constant S_NOADMIN
=> 'No ADMIN_PASS defined in the configuration'; # Returns error when the config is incomplete
5 use constant S_NOSECRET
=> 'No SECRET defined in the configuration'; # Returns error when the config is incomplete
8 die S_NOADMIN
unless(defined &ADMIN_PASS
);
9 die S_NOSECRET
unless(defined &SECRET
);
10 unless(defined &CAPPED_TRIPS
)
12 if(defined &ADMIN_TRIPS
) { eval "use constant CAPPED_TRIPS => map {(\$_=>' (Admin)')} ADMIN_TRIPS" }
13 else { eval "use constant CAPPED_TRIPS => ()" }
17 eval "use constant TITLE => 'Kareha image board'" unless(defined &TITLE
);
18 eval "use constant SHOWTITLETXT => 1" unless(defined &SHOWTITLETXT
);
19 eval "use constant SHOWTITLEIMG => 0" unless(defined &SHOWTITLEIMG
);
20 eval "use constant TITLEIMG => 'title.jpg'" unless(defined &TITLEIMG
);
21 eval "use constant THREADS_DISPLAYED => 10" unless(defined &THREADS_DISPLAYED
);
22 eval "use constant THREADS_LISTED => 40" unless(defined &THREADS_LISTED
);
23 eval "use constant REPLIES_PER_THREAD => 10" unless(defined &REPLIES_PER_THREAD
);
24 eval "use constant S_ANONAME => 'Anonymous'" unless(defined &S_ANONAME
);
25 eval "use constant DEFAULT_STYLE => 'Futaba'" unless(defined &DEFAULT_STYLE
);
26 eval "use constant FAVICON => 'kareha.ico'" unless(defined &FAVICON
);
29 eval "use constant ALLOW_TEXT_THREADS => 1" unless(defined &ALLOW_TEXT_THREADS
);
30 eval "use constant ALLOW_TEXT_REPLIES => 1" unless(defined &ALLOW_TEXT_REPLIES
);
31 eval "use constant AUTOCLOSE_POSTS => 0" unless(defined &AUTOCLOSE_POSTS
);
32 eval "use constant AUTOCLOSE_DAYS => 0" unless(defined &AUTOCLOSE_DAYS
);
33 eval "use constant AUTOCLOSE_SIZE => 0" unless(defined &AUTOCLOSE_SIZE
);
34 eval "use constant MAX_RES => 20" unless(defined &MAX_RES
);
35 eval "use constant MAX_THREADS => 0" unless(defined &MAX_THREADS
);
36 eval "use constant MAX_POSTS => 500" unless(defined &MAX_POSTS
);
37 eval "use constant MAX_MEGABYTES => 0" unless(defined &MAX_MEGABYTES
);
38 eval "use constant MAX_FIELD_LENGTH => 100" unless(defined &MAX_FIELD_LENGTH
);
39 eval "use constant MAX_COMMENT_LENGTH => 8192" unless(defined &MAX_COMMENT_LENGTH
);
40 eval "use constant MAX_LINES_SHOWN => 15" unless(defined &MAX_LINES_SHOWN
);
41 eval "use constant ALLOW_ADMIN_EDIT => 0" unless(defined &ALLOW_ADMIN_EDIT
);
44 eval "use constant ALLOW_IMAGE_THREADS => 1" unless(defined &ALLOW_IMAGE_THREADS
);
45 eval "use constant ALLOW_IMAGE_REPLIES => 1" unless(defined &ALLOW_IMAGE_REPLIES
);
46 eval "use constant IMAGE_REPLIES_PER_THREAD => 0" unless(defined &IMAGE_REPLIES_PER_THREAD
);
47 eval "use constant MAX_KB => 1000" unless(defined &MAX_KB
);
48 eval "use constant MAX_W => 200" unless(defined &MAX_W
);
49 eval "use constant MAX_H => 200" unless(defined &MAX_H
);
50 eval "use constant THUMBNAIL_SMALL => 1" unless(defined &THUMBNAIL_SMALL
);
51 eval "use constant THUMBNAIL_QUALITY => 70" unless(defined &THUMBNAIL_QUALITY
);
52 eval "use constant ALLOW_UNKNOWN => 0" unless(defined &ALLOW_UNKNOWN
);
53 eval "use constant MUNGE_UNKNOWN => '.unknown'" unless(defined &MUNGE_UNKNOWN
);
54 eval "use constant FORBIDDEN_EXTENSIONS => ('php','php3','php4','phtml','shtml','cgi','pl','pm','py','r','exe','dll','scr','pif','asp','cfm','jsp','vbs')" unless(defined &FORBIDDEN_EXTENSIONS
);
55 eval "use constant STUPID_THUMBNAILING => 0" unless(defined &STUPID_THUMBNAILING
);
56 eval "use constant MAX_IMAGE_WIDTH => 16384" unless(defined &MAX_IMAGE_WIDTH
);
57 eval "use constant MAX_IMAGE_HEIGHT => 16384" unless(defined &MAX_IMAGE_HEIGHT
);
58 eval "use constant MAX_IMAGE_PIXELS => 50000000" unless(defined &MAX_IMAGE_PIXELS
);
59 eval "use constant CONVERT_COMMAND => 'convert'" unless(defined &CONVERT_COMMAND
);
62 eval "use constant ENABLE_CAPTCHA => 0" unless(defined &ENABLE_CAPTCHA
);
63 eval "use constant CAPTCHA_HEIGHT => 18" unless(defined &CAPTCHA_HEIGHT
);
64 eval "use constant CAPTCHA_SCRIBBLE => 0.2" unless(defined &CAPTCHA_SCRIBBLE
);
65 eval "use constant CAPTCHA_SCALING => 0.15" unless(defined &CAPTCHA_SCALING
);
66 eval "use constant CAPTCHA_ROTATION => 0.3" unless(defined &CAPTCHA_ROTATION
);
67 eval "use constant CAPTCHA_SPACING => 2.5" unless(defined &CAPTCHA_SPACING
);
70 eval "use constant CHARSET => 'utf-8'" unless(defined &CHARSET
);
71 eval "use constant PROXY_CHECK => ()" unless(defined &PROXY_CHECK
);
72 eval "use constant TRIM_METHOD => 0" unless(defined &TRIM_METHOD
);
73 eval "use constant REQUIRE_THREAD_TITLE => 0" unless(defined &REQUIRE_THREAD_TITLE
);
74 eval "use constant DATE_STYLE => 'futaba'" unless(defined &DATE_STYLE
);
75 eval "use constant DISPLAY_ID => ''" unless(defined &DISPLAY_ID
);
76 eval "use constant EMAIL_ID => 'Heaven'" unless(defined &EMAIL_ID
);
77 eval "use constant SILLY_ANONYMOUS => ''" unless(defined &SILLY_ANONYMOUS
);
78 eval "use constant FORCED_ANON => 0" unless(defined &FORCED_ANON
);
79 eval "use constant TRIPKEY => '!'" unless(defined &TRIPKEY
);
80 eval "use constant ALTERNATE_REDIRECT => 0" unless(defined &ALTERNATE_REDIRECT
);
81 eval "use constant APPROX_LINE_LENGTH => 150" unless(defined &APPROX_LINE_LENGTH
);
82 eval "use constant COOKIE_PATH => 'root'" unless(defined &COOKIE_PATH
);
83 eval "use constant STYLE_COOKIE => 'wakabastyle'" unless(defined &STYLE_COOKIE
);
84 eval "use constant ENABLE_DELETION => 1" unless(defined &ENABLE_DELETION
);
85 eval "use constant PAGE_GENERATION => 'paged'" unless(defined &PAGE_GENERATION
);
86 eval "use constant DELETE_FIRST => 'remove'" unless(defined &DELETE_FIRST
);
87 eval "use constant MARKUP_FORMATS => ('waka')" unless(defined &MARKUP_FORMATS
);
88 eval "use constant DEFAULT_MARKUP => 'waka'" unless(defined &DEFAULT_MARKUP
);
89 eval "use constant FUDGE_BLOCKQUOTES => 1" unless(defined &FUDGE_BLOCKQUOTES
);
90 eval "use constant USE_XHTML => 1" unless(defined &USE_XHTML
);
91 eval "use constant KEEP_MAINPAGE_NEWLINES => 0" unless(defined &KEEP_MAINPAGE_NEWLINES
);
92 eval "use constant SPAM_TRAP => 1" unless(defined &SPAM_TRAP
);
94 # Internal paths and files - might as well leave this alone.
95 eval "use constant RES_DIR => 'res/'" unless(defined &RES_DIR
);
96 eval "use constant CSS_DIR => 'css/'" unless(defined &CSS_DIR
);
97 eval "use constant IMG_DIR => 'src/'" unless(defined &IMG_DIR
);
98 eval "use constant THUMB_DIR => 'thumb/'" unless(defined &THUMB_DIR
);
99 eval "use constant INCLUDE_DIR => 'include/'" unless(defined &INCLUDE_DIR
);
100 eval "use constant LOG_FILE => 'log.txt'" unless(defined &LOG_FILE
);
101 eval "use constant PAGE_EXT => '.html'" unless(defined &PAGE_EXT
);
102 eval "use constant HTML_SELF => 'index.html'" unless(defined &HTML_SELF
);
103 eval "use constant HTML_BACKLOG => ''" unless(defined &HTML_BACKLOG
);
104 eval "use constant RSS_FILE => ''" unless(defined &RSS_FILE
);
105 eval "use constant JS_FILE => 'kareha.js'" unless(defined &JS_FILE
);
107 unless(defined &SPAM_FILES
)
109 if(defined &SPAM_FILE
) { eval "use constant SPAM_FILES => (SPAM_FILE)" }
110 else { eval "use constant SPAM_FILES => ('spam.txt')" }
112 # eval "use constant SPAM_FILE => 'spam.txt'" unless(defined &SPAM_FILE);
114 # Admin script options
115 eval "use constant ADMIN_SHOWN_LINES => 5" unless(defined &ADMIN_SHOWN_LINES
);
116 eval "use constant ADMIN_SHOWN_POSTS => 10" unless(defined &ADMIN_SHOWN_POSTS
);
117 eval "use constant ADMIN_MASK_IPS => 0" unless(defined &ADMIN_MASK_IPS
);
118 eval "use constant ADMIN_EDITABLE_FILES => (SPAM_FILES)" unless(defined &ADMIN_EDITABLE_FILES
);
119 eval "use constant ADMIN_BAN_FILE => '.htaccess'" unless(defined &ADMIN_BAN_FILE
);
120 eval 'use constant ADMIN_BAN_TEMPLATE => "\n# Banned at <var scalar localtime> (<var \$reason>)\nDeny from <var \$ip>\n"' unless(defined &ADMIN_BAN_TEMPLATE
);
123 eval "use constant FILETYPES => ()" unless(defined &FILETYPES
);
124 eval q{use constant ALLOWED_HTML => (
125 'a'=>{args=>{'href'=>'url'},forced
=>{'rel'=>'nofollow'}},
126 'b'=>{},'i'=>{},'u'=>{},'sub'=>{},'sup'=>{},
127 'em'=>{},'strong'=>{},
128 'ul'=>{},'ol'=>{},'li'=>{},'dl'=>{},'dt'=>{},'dd'=>{},
129 'p'=>{},'br'=>{empty
=>1},'blockquote'=>{},
130 )} unless(defined &ALLOWED_HTML
);
132 eval "use constant KAREHA_VERSION => '3.1.4'" unless(defined &KAREHA_VERSION
);