summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/docs/264
-rw-r--r--data/docs/51
-rw-r--r--data/docs/734
-rw-r--r--data/tpl/defs.pl4
-rw-r--r--data/tpl/rpage2
-rw-r--r--lib/ChangeLog2
-rw-r--r--lib/Multi/Core.pm2
-rw-r--r--lib/Multi/IRC.pm70
-rw-r--r--lib/Multi/Maintenance.pm32
-rw-r--r--static/files/style.css1
10 files changed, 170 insertions, 42 deletions
diff --git a/data/docs/2 b/data/docs/2
index 6a11adaf..65d5cb1d 100644
--- a/data/docs/2
+++ b/data/docs/2
@@ -49,7 +49,7 @@
have to be added to Da Capo and vice versa - the internal visual novel relations will
take care of that.<br />
After submitting a new AniDB ID, VNDB will automatically fetch information about the
- anime and will present that on the site. This action can take a few minuts to - in the
+ anime and will present that on the site. This action can take a few minutes to - in the
worst case - hours. In that time you will see the ID of the anime, but not the title
and links to AnimeNFO and Anime News Network. It is not possible to manually add this
information, this will be fetched automatically!
@@ -71,14 +71,51 @@
:SUB:Image
<p>
- <i>General image guidelines and when to use the NSFW warning</i>
+ Every visual novel should have an image, preferably one of the official cover
+ art of one of the releases. In some cases, especially with doujin games, if there is
+ no official cover art available, a general image from the game's homepage or a
+ screenshot of the game itself could be used instead.<br />
+ Images can be uploaded in JPEG or PNG format, and should not be larger than 500kB.
+ All images larger than 256x400px will automatically be resized to fit on the page.
+ Keep in mind that this resizing is done in a seperate process, so you will not
+ immediately see the image after uploading. This processing often takes just a few
+ seconds, and the image should be available shortly after you've submitted the form.
+ <br /><br />
+ The NSFW warning should be used in cases where the cover art is not safe for work.
+ To determine what is safe for work and what is not, use the following guidelines:
+</p><ul>
+ <li>Nudity is only safe if the sexual characteristics are covered or hidden</li>
+ <li>Bikini, pantsu and other underwear are only safe if they contain no implicit
+ indication of sexual anatomy</li>
+ <li>If the characters pose is overly sexually suggestive, it's NSFW</li>
+ <li>If multiple characters are portrayed and they are engaged in physical contact
+ that may be considered as (a precursor to) sexual contact, then it's NSFW as well.
+ </li>
+</ul><p>
+ Even with these guidelines it may not always be easy to determine whether an image
+ is safe or not. When in doubt, it's often best to go for NSFW.
</p>
:SUB:Relations
<p>
- <i>When to add relation, and document direct and reverse relations</i><br />
- <i>(Stolen from AniDB, needs some rewriting)</i>
+ Visual novel relations can be used to indicate what games are related to each
+ other.<br />
+ When adding a relation, the reverse relation will automatically be added to
+ the other visual novel. E.g. if you add game x as a sequel to game y, then game
+ y will automatically be added as a prequel to game x. You do not have to edit
+ both games.<br />
+ Only specify <b>direct</b> relations. If one game 1 is listed to have a relation
+ with game 2, and game 2 has a relation with game 3, then game 3 does not have
+ to be added as a relation to game 1. This may sound a bit confusing at first,
+ but you will understand when you look at the relation graphs. When editing relations,
+ always try to think about the relations between all related games - as shown in
+ the graph - instead of only looking at the specific visual novel you're editing.
+ <br />
+ There is a static list of relations to choose from (as described below). As with
+ many things, the relations between games can in reality be more complex than these
+ options could describe. Simply choose the option you think is closest to describing
+ the actual relation when you're not sure which one to choose.
</p>
<dl>
<dt>Sequel</dt><dd>
@@ -86,23 +123,28 @@
</dd><dt>Prequel</dt><dd>
The story happens before the original story.&lt;=&gt;<i>Sequel</i>.
</dd><dt>Same setting</dt><dd>
- Same universe/world/reality/timeline, completely different characters.
+ Same universe, world, reality and timeline, but completely different characters.
+ The definition of "setting" is not always easy to define, but usually it
+ means that if places or items not existing in the real world described in one
+ game also exist in the other game, you could use this relation.
</dd><dt>Alternative setting</dt><dd>
- Same characters, different universe/world/reality/timeline.
+ Same characters and (mostly) the same story, but set in a different universe,
+ world, reality or timeline.
</dd><dt>Alternative version</dt><dd>
- Same setting, same characters, story is told differently.
+ Same setting, same characters, but the story is told differently.
</dd><dt>Same characters</dt><dd>
- Shares one or more characters, story is unrelated.
+ Different story, but shares some characters.
</dd><dt>Side story</dt><dd>
- Takes place sometime during the parent storyline. &lt;=&gt;<i>Parent story</i>
+ The story takes place sometime during the parent storyline. &lt;=&gt;<i>Parent story</i>
</dd><dt>Parent story</dt><dd>
- .. &lt;=&gt;<i>Side story</i>.
+ Opposite of <i>Side story</i>.
</dd><dt>Summary</dt><dd>
Summarizes full story, may contain additional stuff. &lt;=&gt;<i>Full story</i>.
</dd><dt>Full story</dt><dd>
Full version of the summarized story. &lt;=&gt;<i>Summary</i>.
</dd><dt>Other</dt><dd>
- ..
+ There is a relation, but it's not possible to describe it using the other available
+ options. This is a relation that should rarely be used.
</dd>
</dl>
diff --git a/data/docs/5 b/data/docs/5
index 12456b38..50f9db3d 100644
--- a/data/docs/5
+++ b/data/docs/5
@@ -37,5 +37,6 @@ Misc documentation:<br />
- Quoting sources in descriptions<br />
- Piracy<br />
- Spoilers<br />
+- Name order<br />
</p>
diff --git a/data/docs/7 b/data/docs/7
index 8064a44d..8542d4e5 100644
--- a/data/docs/7
+++ b/data/docs/7
@@ -1,9 +1,18 @@
:TITLE:About us
:INC:index
+
:SUB:Goal
<p>
- ..
+ Our primary goal is building a large, comprehensive and up-to-date database for
+ information about all existing visual novels. VNDB aims to be a central place
+ too look up general information about the visual novels themselves, as well as
+ practical information around it, like available releases, localisations and
+ producers.<br />
+ Our secondary goal is to promote the wonderful medium called visual novels to
+ a broader audience, an audience not limited only to people who can understand
+ Japanese, but to anyone interested in literature, anime, manga or games,
+ regardless of their geographical location or cultural differences.
</p>
@@ -15,23 +24,32 @@
:SUB:Staff
<dl>
- <dt><a href="/u2">yorhel</a></dt><dd>
- Also known as Ayo on IRC.
- </dd><dt><a href="/u4" class="retired">hillie</a><dt><dd>
- (retired)
+ <dt><a href="/u2">yorhel</a> <b>[a.k.a. Ayo]</b></dt><dd>
+ Founder of VNDB and still active as the main developer.
+ </dd><dt><a href="/u4" class="retired">hillie</a> <b>[retired]</b><dt><dd>
+ Responsible for beta testing of the first few versions of the site, thinking
+ of cool new features, adding the first few entries to the database and
+ moderating user submitted content.
</dd>
</dl>
:SUB:Thanks
<p>
- ..
+ Due to the sites nature as a wiki, all information in the database is added and
+ kept up-to-date by active users. I would like to thank everyone who has contributed
+ to the site, and the following users in particular:
</p>
<dl>
<dt><a href="/u18">rasqual</a></dt><dd>
- ..
+ One of the first active contributors. Added many visual novels to the
+ database when it was still a small and unknown website and gave useful
+ feedback on new features. His contributions motivated many other visitors to
+ help out as well.
</dd><dt><a href="/u51">echomateria</a></dt><dd>
- ..
+ Responsible for adding more than 500 visual novels in less than two months,
+ making him the largest contributor to the database. Also helped out with
+ thinking of new features and keeping the IRC channel busy.
</dd>
</dl>
diff --git a/data/tpl/defs.pl b/data/tpl/defs.pl
index e993fb58..6c70a68b 100644
--- a/data/tpl/defs.pl
+++ b/data/tpl/defs.pl
@@ -144,10 +144,10 @@ sub summary { # cmd, len, def
$l -= length($1)+6;
$as++;
}
- if(!$as && s/(http|https):\/\/(.+[0-9a-zA-Z\/])/<a href="$1:\/\/$2" rel="nofollow">link<\/a>/) {
+ if(!$as && s/(http|https):\/\/(.+[0-9a-zA-Z=\/])/<a href="$1:\/\/$2" rel="nofollow">link<\/a>/) {
$l = 4;
} elsif(!$as) {
- s/^([uvpr][0-9]+)[^\w]*$/<a href="\/$1">$1<\/a>/;
+ s/^([duvpr][0-9]+)[^\w]*$/<a href="\/$1">$1<\/a>/;
}
while(s/\[\/url\]/<\/a>/) {
$l -= 6;
diff --git a/data/tpl/rpage b/data/tpl/rpage
index 7ad3c4ea..ac5eaa11 100644
--- a/data/tpl/rpage
+++ b/data/tpl/rpage
@@ -22,7 +22,7 @@
[ website => 'Website', \&summary ],
[ released => 'Release date', \&datestr ],
[ minage => 'Age rating', sub { $VNDB::VRAGES->{$_[0]} } ],
- [ notes => 'Notes', 1 ],
+ [ notes => 'Notes', 1, 1 ],
[ platforms => 'Platforms', sub { join(', ', sort @{$_[0]}) } ],
[ media => 'Media', \&mediastr ],
[ producers => 'Producers', sub { join(', ', map { _hchar($_->{name}) } sort { $a->{name} cmp $b->{name} } @{$_[0]}) } ],
diff --git a/lib/ChangeLog b/lib/ChangeLog
index 5cc2c5a4..3f01492f 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -23,6 +23,8 @@ TODO:
- Designed a better system to handle documentation
- Created a centralised system for site errors within the same layout
- Wrote some more documentation
+ - Multi::IRC now also handles d[0-9] IDs
+ - Multi::Maintenance automatically rotates Multi's logs
1.14 - 2008-04-26
- Removed the ID gap prevention method
diff --git a/lib/Multi/Core.pm b/lib/Multi/Core.pm
index 2d9ea85f..e9c67eb6 100644
--- a/lib/Multi/Core.pm
+++ b/lib/Multi/Core.pm
@@ -10,7 +10,7 @@ use warnings;
use POE 'Component::Cron';
use Tie::ShareLite ':lock';
use Time::HiRes 'time', 'gettimeofday', 'tv_interval'; # overload time()
-use DateTime::Event::Cron; # bug in PoCo::Cron
+use DateTime::Event::Cron; # bug in PoCo::Cron (rt #35422, fixed in 0.019)
sub spawn {
diff --git a/lib/Multi/IRC.pm b/lib/Multi/IRC.pm
index b8f6d44b..984d5d5d 100644
--- a/lib/Multi/IRC.pm
+++ b/lib/Multi/IRC.pm
@@ -56,7 +56,7 @@ sub _start {
);
$_[HEAP]{irc}->plugin_add(
CTCP => POE::Component::IRC::Plugin::CTCP->new(
- version => $_[HEAP]{o}{ircname}.' v'.$Multi::VERSION,
+ version => $_[HEAP]{o}{ircname}.' v'.$VNDB::VERSION,
userinfo => $_[HEAP]{o}{ircname},
));
$_[HEAP]{irc}->plugin_add(
@@ -127,24 +127,60 @@ sub irc_msg {
sub vndbid { # dest, msg
my $m = $_[ARG1];
my @id;
- push @id, [$1,$2,$3,$4] while $m =~ s/^(.*)([uvpr])([0-9]+)(.*)$/ $1 $4 /i;
+ push @id, [$1,$2,$3,$4] while $m =~ s/^(.*)([duvpr])([0-9]+)(.*)$/ $1 $4 /i;
for (reverse @id) {
next if $$_[0] =~ /(\.org\/|[a-z])$/i || $$_[3] =~ /^[a-z]/i;
- my($t, $id) = (lc($$_[1]), $$_[2]);
- my $s = $Multi::SQL->prepare(
- $t eq 'v' ? 'SELECT vr.title FROM vn_rev vr JOIN vn v ON v.latest = vr.id WHERE v.id = ?' :
- $t eq 'u' ? 'SELECT u.username AS title FROM users u WHERE u.id = ?' :
- $t eq 'p' ? 'SELECT pr.name AS title FROM producers_rev pr JOIN producers p ON p.latest = pr.id WHERE p.id = ?' :
- 'SELECT rr.title FROM releases_rev rr JOIN releases r ON r.latest = rr.id WHERE r.id = ?'
- );
- $s->execute($id);
- my $r = $s->fetchrow_hashref;
- $s->finish;
- next if !$r || ref($r) ne 'HASH';
- $_[KERNEL]->post(circ => privmsg => $_[ARG0], sprintf
- BOLD.RED.'['.RED.'%s%d'.RED.']'.NORMAL.' %s '.RED.'@'.NORMAL.LIGHT_GREY.' http://vndb.org/%s%d'.NORMAL,
- $t, $id, $r->{title}, $t, $id
- );
+ my($t, $id, $ext) = (lc($$_[1]), $$_[2], $$_[3]);
+
+ if($t ne 'd') {
+ my $s = $Multi::SQL->prepare(
+ $t eq 'v' ? 'SELECT vr.title FROM vn_rev vr JOIN vn v ON v.latest = vr.id WHERE v.id = ?' :
+ $t eq 'u' ? 'SELECT u.username AS title FROM users u WHERE u.id = ?' :
+ $t eq 'p' ? 'SELECT pr.name AS title FROM producers_rev pr JOIN producers p ON p.latest = pr.id WHERE p.id = ?' :
+ 'SELECT rr.title FROM releases_rev rr JOIN releases r ON r.latest = rr.id WHERE r.id = ?'
+ );
+ $s->execute($id);
+ my $r = $s->fetchrow_hashref;
+ $s->finish;
+ next if !$r || ref($r) ne 'HASH';
+ $_[KERNEL]->post(circ => privmsg => $_[ARG0], sprintf
+ BOLD.RED.'['.RED.'%s%d'.RED.']'.NORMAL.' %s '.RED.'@'.NORMAL.LIGHT_GREY.' http://vndb.org/%s%d'.NORMAL,
+ $t, $id, $r->{title}, $t, $id
+ );
+
+ } else {
+ my $f = sprintf '/www/vndb/data/docs/%d', $id;
+ open my $F, '<', $f or next;
+ (my $title = <$F>) =~ s/^:TITLE://;
+ chomp($title);
+
+ my($sub, $sec) = ('', 0);
+ if($ext && $ext =~ /^\.([0-9]+)/) {
+ my $fs = $1;
+ while(<$F>) {
+ next if !/^:SUB:/;
+ $sec++;
+ if($sec == $fs) {
+ chomp;
+ ($sub = $_) =~ s/^:SUB://;
+ last;
+ }
+ }
+ }
+ close $F;
+
+ if(!$sub) {
+ $_[KERNEL]->post(circ => privmsg => $_[ARG0], sprintf
+ BOLD.RED.'['.RED.'d%d'.RED.']'.NORMAL.' %s '.RED.'@'.NORMAL.LIGHT_GREY.' http://vndb.org/d%d'.NORMAL,
+ $id, $title, $id
+ );
+ } else {
+ $_[KERNEL]->post(circ => privmsg => $_[ARG0], sprintf
+ BOLD.RED.'['.RED.'d%d.%d'.RED.']'.NORMAL.' %s -> %s '.RED.'@'.NORMAL.LIGHT_GREY.' http://vndb.org/d%d#%d'.NORMAL,
+ $id, $sec, $title, $sub, $id, $sec
+ );
+ }
+ }
}
}
diff --git a/lib/Multi/Maintenance.pm b/lib/Multi/Maintenance.pm
index 51fff936..1f1a337e 100644
--- a/lib/Multi/Maintenance.pm
+++ b/lib/Multi/Maintenance.pm
@@ -8,15 +8,17 @@ package Multi::Maintenance;
use strict;
use warnings;
use POE;
+use PerlIO::gzip;
sub spawn {
# WARNING: these maintenance tasks can block the process for a few seconds
+ # 'maintenance all' doesn't include log rotation
my $p = shift;
POE::Session->create(
package_states => [
- $p => [qw| _start cmd_maintenance vncache ratings prevcache integrity unkanime |],
+ $p => [qw| _start cmd_maintenance vncache ratings prevcache integrity unkanime logrotate |],
],
);
}
@@ -24,10 +26,12 @@ sub spawn {
sub _start {
$_[KERNEL]->alias_set('maintenance');
- $_[KERNEL]->call(core => register => qr/^maintenance((?: (?:all|vncache|ratings|prevcache|integrity|unkanime))+)$/, 'cmd_maintenance');
+ $_[KERNEL]->call(core => register => qr/^maintenance((?: (?:all|vncache|ratings|prevcache|integrity|unkanime|logrotate))+)$/, 'cmd_maintenance');
# Perform all maintenance functions every day on 0:00
$_[KERNEL]->post(core => addcron => '0 0 * * *', 'maintenance all');
+ # rotate logs every 1st day of the month at 0:05
+ $_[KERNEL]->post(core => addcron => '5 0 1 * *' => 'maintenance logrotate');
}
@@ -39,6 +43,7 @@ sub cmd_maintenance {
$_[KERNEL]->yield('prevcache') if /(?:prevcache|all)/;
$_[KERNEL]->yield('integrity') if /(?:integrity|all)/;
$_[KERNEL]->yield('unkanime') if /(?:unkanime|all)/;
+ $_[KERNEL]->yield('logrotate') if /logrotate/;
$_[KERNEL]->post(core => finish => $_[ARG0]);
}
@@ -110,6 +115,29 @@ sub unkanime {
}
+sub logrotate {
+ my $dir = sprintf '%s/old', $Multi::LOGDIR;
+ mkdir $dir if !-d $dir;
+
+ for (glob sprintf '%s/*', $Multi::LOGDIR) {
+ next if /^\./ || /~$/ || !-f;
+ my $f = /([^\/]+)$/ ? $1 : $_;
+ my $n = sprintf '%s/%s.%04d-%02d-%02d.gz', $dir, $f, (localtime)[5]+1900, (localtime)[4]+1, (localtime)[3];
+ if(-f $n) {
+ $_[KERNEL]->call(core => log => 1, 'Logs already rotated earlier today!');
+ return;
+ }
+ open my $I, '<', sprintf '%s/%s', $Multi::LOGDIR, $f;
+ open my $O, '>:gzip', $n;
+ print $O $_ while <$I>;
+ close $O;
+ close $I;
+ open $I, '>', sprintf '%s/%s', $Multi::LOGDIR, $f;
+ close $I;
+ }
+}
+
+
1;
diff --git a/static/files/style.css b/static/files/style.css
index 4b5c8d29..5d1996c6 100644
--- a/static/files/style.css
+++ b/static/files/style.css
@@ -612,6 +612,7 @@ div#lfilter label {
#dpage ul.index li { list-style-type: none; }
#dpage ul.index li a { margin: 0 0 0 10px; }
#dpage .retired { text-decoration: line-through; }
+#dpage dt b { color: #999; font-weight: normal; font-style: normal; font-size: 12px; }