summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b>2008-10-18 13:54:35 +0000
committeryorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b>2008-10-18 13:54:35 +0000
commitb50ad43dc993013b4a8205081ed983dc96107523 (patch)
tree2f1850f8b2e57e36197a200ddb0282f4eb812bdb
parent8d4f4422dfc67204d58e52977aee967c7eae888f (diff)
Added original title field to VN entries
git-svn-id: svn://vndb.org/vndb@112 1fe2e327-d9db-4752-bcf7-ef0cb4a1748b
-rw-r--r--data/tpl/vnedit6
-rw-r--r--data/tpl/vnpage3
-rw-r--r--lib/ChangeLog1
-rw-r--r--lib/VNDB/Util/DB.pm6
-rw-r--r--lib/VNDB/VN.pm9
-rw-r--r--util/dump.sql1
6 files changed, 15 insertions, 11 deletions
diff --git a/data/tpl/vnedit b/data/tpl/vnedit
index f27fea64..2fb2fbd7 100644
--- a/data/tpl/vnedit
+++ b/data/tpl/vnedit
@@ -22,10 +22,10 @@
{ type => 'startform', action => $d{id} ?( '/v'.$d{id}.'/edit') : '/v/new', upload => 1, fh => 1 },
{ type => 'sub', title => 'General info', short => 'info' },
- { type => 'input', name => 'Title', short => 'title', r=>1 },
+ { type => 'input', name => 'Title (romaji)', short => 'title', r=>1 },
+ { type => 'input', name => 'Original title', short => 'original' },
{ type => 'static', text => q|
- Use the romanized version of the original title.
- Other titles can be added at a later time when specifying releases.<br /><br />| },
+ The original title of this release, leave blank if it already is in the Latin alphabet.<br /><br />| },
{ type => 'textarea', name => 'Aliases', short => 'alias', rows => 2, cols => 60 },
{ type => 'static', text => q|
diff --git a/data/tpl/vnpage b/data/tpl/vnpage
index 2e9fc6aa..7ba36051 100644
--- a/data/tpl/vnpage
+++ b/data/tpl/vnpage
@@ -23,7 +23,8 @@
[[ if($d{change}) { ]]
[[= cdiff($d{prev}, $d{vn},
- [ title => 'Title', 1 ],
+ [ title => 'Title (romaji)', 1 ],
+ [ original => 'Original title', 1 ],
[ alias => 'Alias', 1, 1 ],
[ desc => 'Description', 1, 1 ],
[ length => 'Length', sub { $VNDB::VNLEN->[$_[0] ][0] } ],
diff --git a/lib/ChangeLog b/lib/ChangeLog
index 664b1217..1d07aed8 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -10,6 +10,7 @@ TODO:
1.23 - ?
- Removed redirects for old revision URLs (the code wasn't very secure...)
- Fixed bug when using unicode in the AJAX vn/producers/release search box
+ - Added original title field to VN entries
1.22 - 2008-08-29 (r106)
- Inverted vote graph
diff --git a/lib/VNDB/Util/DB.pm b/lib/VNDB/Util/DB.pm
index 8641f6b0..21fee8fd 100644
--- a/lib/VNDB/Util/DB.pm
+++ b/lib/VNDB/Util/DB.pm
@@ -776,7 +776,7 @@ sub DBGetVN { # %options->{ id rev char search order results page what cati cate
'LEFT JOIN relgraph rg ON rg.id = v.rgraph' ) : (),
);
- my $sel = 'v.id, v.locked, v.hidden, v.c_released, v.c_languages, v.c_platforms, vr.title, vr.id AS cid';
+ my $sel = 'v.id, v.locked, v.hidden, v.c_released, v.c_languages, v.c_platforms, vr.title, vr.original, vr.id AS cid';
$sel .= ', vr.alias, vr.image AS image, vr.img_nsfw, vr.length, vr.desc, vr.l_wp, vr.l_encubed, vr.l_renai, vr.l_vnn' if $o{what} =~ /extended/;
$sel .= ', c.added, c.requester, c.comments, v.latest, u.username, c.rev, c.causedby' if $o{what} =~ /changes/;
$sel .= ', v.rgraph, rg.cmap' if $o{what} =~ /relgraph/;
@@ -906,9 +906,9 @@ sub _insert_vn_rev { # columns in vn_rev + categories + screenshots + relations
$$o{img_nsfw} = $$o{img_nsfw}?1:0;
$s->DBExec(q|
- INSERT INTO vn_rev (id, vid, title, "desc", alias, image, img_nsfw, length, l_wp, l_encubed, l_renai, l_vnn)
+ INSERT INTO vn_rev (id, vid, title, original, "desc", alias, image, img_nsfw, length, l_wp, l_encubed, l_renai, l_vnn)
VALUES (!l)|,
- [ $cid, $vid, @$o{qw|title desc alias image img_nsfw length l_wp l_encubed l_renai l_vnn|} ]);
+ [ $cid, $vid, @$o{qw|title original desc alias image img_nsfw length l_wp l_encubed l_renai l_vnn|} ]);
$s->DBExec(q|
INSERT INTO vn_categories (vid, cat, lvl)
diff --git a/lib/VNDB/VN.pm b/lib/VNDB/VN.pm
index 982e2e16..c25f97dd 100644
--- a/lib/VNDB/VN.pm
+++ b/lib/VNDB/VN.pm
@@ -79,7 +79,7 @@ sub VNEdit {
return $self->ResDenied if !$self->AuthCan('edit') || ($v->{locked} && !$self->AuthCan('lock'));
my %b4 = $id ? (
- ( map { $_ => $v->{$_} } qw| title desc alias img_nsfw length l_wp l_encubed l_renai l_vnn | ),
+ ( map { $_ => $v->{$_} } qw| title original desc alias img_nsfw length l_wp l_encubed l_renai l_vnn | ),
relations => join('|||', map { $_->{relation}.','.$_->{id}.','.$_->{title} } @{$v->{relations}}),
categories => join(',', map { $_->[0].$_->[1] } sort { $a->[0] cmp $b->[0] } @{$v->{categories}}),
anime => join(' ', sort { $a <=> $b } map $_->{id}, @{$v->{anime}}),
@@ -90,6 +90,7 @@ sub VNEdit {
if($self->ReqMethod() eq 'POST') {
$frm = $self->FormCheck(
{ name => 'title', required => 1, maxlength => 250 },
+ { name => 'original', required => 0, maxlength => 250 },
{ name => 'alias', required => 0, maxlength => 500, default => '' },
{ name => 'desc', required => 1, maxlength => 10240 },
{ name => 'length', required => 0, enum => [ 0..($#$VNDB::VNLEN+1) ], default => 0 },
@@ -114,7 +115,7 @@ sub VNEdit {
$frm->{screenshots} = join ' ', map sprintf('%d,%d,%d', $$_[0], $$_[1]?1:0, $$_[2]||0), sort { $$a[0] <=> $$b[0] } @$screenshots;
return $self->ResRedirect('/v'.$id, 'post')
- if $id && !$self->ReqParam('img') && 13 == scalar grep { $b4{$_} eq $frm->{$_} } keys %b4;
+ if $id && !$self->ReqParam('img') && 14 == scalar grep { $b4{$_} eq $frm->{$_} } keys %b4;
# upload image
my $imgid = 0;
@@ -147,7 +148,7 @@ sub VNEdit {
}
my %args = (
- ( map { $_ => $frm->{$_} } qw| title desc alias comm length l_wp l_encubed l_renai l_vnn img_nsfw| ),
+ ( map { $_ => $frm->{$_} } qw| title original desc alias comm length l_wp l_encubed l_renai l_vnn img_nsfw| ),
image => $imgid,
anime => $anime,
relations => $relations,
@@ -405,7 +406,7 @@ sub VNUpdReverse { # old, new, id, cid, rev
uid => 1, # Multi - hardcoded
anime => [ map $_->{id}, @{$r->{anime}} ],
screenshots => [ map [ $_->{id}, $_->{nsfw}, $_->{rid} ], @{$r->{screenshots}} ],
- ( map { $_ => $r->{$_} } qw| title desc alias categories img_nsfw length l_wp l_encubed l_renai l_vnn image | )
+ ( map { $_ => $r->{$_} } qw| title original desc alias categories img_nsfw length l_wp l_encubed l_renai l_vnn image | )
);
}
diff --git a/util/dump.sql b/util/dump.sql
index 39e74bad..4addb15d 100644
--- a/util/dump.sql
+++ b/util/dump.sql
@@ -217,6 +217,7 @@ CREATE TABLE vn_rev (
id integer NOT NULL PRIMARY KEY,
vid integer NOT NULL DEFAULT 0,
title varchar(250) NOT NULL DEFAULT '',
+ original varchar(250) NOT NULL DEFAULT '',
alias varchar(500) NOT NULL DEFAULT '',
img_nsfw boolean NOT NULL DEFAULT FALSE,
length smallint NOT NULL DEFAULT 0,