summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2010-12-10 10:17:41 +0100
committerYorhel <git@yorhel.nl>2010-12-10 10:18:28 +0100
commit3362cf0391fad05a0eed1bd11a54f4c97f5260db (patch)
tree89a8b23c64f5fd05282c20235d32f5b2780e4c6e
parent8e4e3edcfba0b21a33834957726ed99a0b3be299 (diff)
Added a "general discussions" board
So that the "db" board is useful again.
-rw-r--r--ChangeLog1
-rw-r--r--data/docs/96
-rw-r--r--data/global.pl2
-rw-r--r--data/lang.txt7
-rw-r--r--lib/VNDB/Handler/Discussions.pm17
5 files changed, 22 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index d20e3321..97393312 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
2.14 - ?
- Removed expand/collapse from history browser and /u+/posts and switched to
a combined view
+ - Added a "general discussions" board
- API: Allow extra whitespace after "get .." command
- API: Allow non-numbers as "clientver" for the login command
- API: Added "image_nsfw" member to "get vn"
diff --git a/data/docs/9 b/data/docs/9
index fedbd2b0..8f964382 100644
--- a/data/docs/9
+++ b/data/docs/9
@@ -20,8 +20,10 @@
</p>
<dl>
<dt>db</dt><dd>
- VNDB Discussions. This is a general board for threads not about any specific
- entry in the database.
+ VNDB Discussions. This board is for discussions about the database and the site.
+ </dd><dt>ge</dt><dd>
+ General discussions. This is a general board for threads that do not fit in
+ any of the other boards.
</dd><dt>v#</dt><dd>
For discussions about a particular visual novel. The board <i>v17</i>, for example,
is used for all threads related to <a href="/v17">v17</a>.
diff --git a/data/global.pl b/data/global.pl
index c64eeac7..4a431bf8 100644
--- a/data/global.pl
+++ b/data/global.pl
@@ -38,7 +38,7 @@ our %S = (%S,
],
languages => [qw|cs da de en es fi fr hu it ja ko nl no pl pt-br pt-pt ru sk sv tr vi zh|],
producer_types => [qw|co in ng|],
- discussion_boards => [qw|an db v p u|],
+ discussion_boards => [qw|an db ge v p u|], # <- note that some properties of these boards are hard-coded
vn_lengths => [ 0..5 ],
anime_types => [qw|tv ova mov oth web spe mv|],
vn_relations => {
diff --git a/data/lang.txt b/data/lang.txt
index 6157bd04..fa270bba 100644
--- a/data/lang.txt
+++ b/data/lang.txt
@@ -857,6 +857,13 @@ cs : Diskuse o VNDB
hu : VNDB Társalgó
nl : VNDB discussies
+:_dboard_ge
+en : General discussions
+ru*:
+cs*:
+hu*:
+nl : Algemene discussies
+
:_dboard_v
en : Visual novels
ru : Новеллы
diff --git a/lib/VNDB/Handler/Discussions.pm b/lib/VNDB/Handler/Discussions.pm
index 4cd9f04d..1641ff4e 100644
--- a/lib/VNDB/Handler/Discussions.pm
+++ b/lib/VNDB/Handler/Discussions.pm
@@ -11,10 +11,10 @@ use VNDB::Func;
YAWF::register(
qr{t([1-9]\d*)(?:/([1-9]\d*))?} => \&thread,
qr{t([1-9]\d*)\.([1-9]\d*)} => \&redirect,
- qr{t/(db|an|[vpu])([1-9]\d*)?} => \&board,
+ qr{t/(db|an|ge|[vpu])([1-9]\d*)?} => \&board,
qr{t([1-9]\d*)/reply} => \&edit,
qr{t([1-9]\d*)\.([1-9]\d*)/edit} => \&edit,
- qr{t/(db|an|[vpu])([1-9]\d*)?/new} => \&edit,
+ qr{t/(db|an|ge|[vpu])([1-9]\d*)?/new} => \&edit,
qr{t} => \&index,
);
@@ -135,7 +135,7 @@ sub edit {
# in case we start a new thread, parse boards
my $board = '';
if($tid !~ /^\d+$/) {
- return 404 if $tid =~ /(db|an)/ && $num || $tid =~ /[vpu]/ && !$num;
+ return 404 if $tid =~ /(db|an|ge)/ && $num || $tid =~ /[vpu]/ && !$num;
$board = $tid.($num||'');
$tid = 0;
$num = 0;
@@ -187,6 +187,7 @@ sub edit {
!$ty || !grep($_ eq $ty, @{$self->{discussion_boards}})
|| $ty eq 'an' && ($id || !$self->authCan('boardmod'))
|| $ty eq 'db' && $id
+ || $ty eq 'ge' && $id
|| $ty eq 'v' && (!$id || !$self->dbVNGet(id => $id)->[0]{id})
|| $ty eq 'p' && (!$id || !$self->dbProducerGet(id => $id)->[0]{id})
|| $ty eq 'u' && (!$id || !$self->dbUserGet(uid => $id)->[0]{id});
@@ -270,7 +271,7 @@ sub edit {
sub board {
my($self, $type, $iid) = @_;
$iid ||= '';
- return 404 if $type =~ /(db|an)/ && $iid;
+ return 404 if $type =~ /(db|an|ge)/ && $iid;
my $f = $self->formValidate(
{ name => 'p', required => 0, default => 1, template => 'int' },
@@ -316,7 +317,7 @@ sub board {
br; br;
a href => "/t/$type$iid/new", mt '_disboard_createyourown';
} else {
- a href => '/t/'.($iid ? $type.$iid : 'db').'/new', mt '_disboard_startnew';
+ a href => '/t/'.($iid ? $type.$iid : $type ne 'ge' ? 'db' : $type).'/new', mt '_disboard_startnew';
}
end;
end;
@@ -335,14 +336,14 @@ sub index {
h1 mt '_disindex_title';
p class => 'browseopts';
a href => '/t/'.$_, mt "_dboard_$_"
- for (qw|an db v p u|);
+ for (@{$self->{discussion_boards}});
end;
end;
- for (qw|an db v p u|) {
+ for (@{$self->{discussion_boards}}) {
my $list = $self->dbThreadGet(
type => $_,
- results => $_ eq 'db' || $_ eq 'v' ? 10 : 5,
+ results => /^(db|v|ge)$/ ? 10 : 5,
page => 1,
what => 'firstpost lastpost boardtitles',
sort => 'lastpost', reverse => 1,