summaryrefslogtreecommitdiff
path: root/lib/VNDB/DB/Misc.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2018-02-08 16:06:17 +0100
committerYorhel <git@yorhel.nl>2018-02-08 16:12:07 +0100
commit93b79ef9ebafcfccd0d239ffd06e2b547e209e3d (patch)
tree98d96f024d00bf318b16243518e53c2977136202 /lib/VNDB/DB/Misc.pm
parent3f3a4d9810bb2483a89442b85d438639f26ecb7e (diff)
Store d+ pages in the DB as versioned entries + use markdown
This touches a bunch of things: - Adds a new first-class database entry type - Removes the d+.+.+ BBCode link syntax, adds a new d+#+ and d+#+.+ link syntax (references have been updated where possible) - Adds a new dependency on Text::MultiMarkdown
Diffstat (limited to 'lib/VNDB/DB/Misc.pm')
-rw-r--r--lib/VNDB/DB/Misc.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/VNDB/DB/Misc.pm b/lib/VNDB/DB/Misc.pm
index d6389376..61bb71a2 100644
--- a/lib/VNDB/DB/Misc.pm
+++ b/lib/VNDB/DB/Misc.pm
@@ -21,7 +21,7 @@ sub dbStats {
# Inserts a new revision into the database
-# Arguments: type [vrp], itemid, rev, %options->{ editsum uid ihid ilock + db[item]RevisionInsert }
+# Arguments: type [vrpcsd], itemid, rev, %options->{ editsum uid ihid ilock + db[item]RevisionInsert }
# rev = changes.rev of the revision this edit is based on, undef to create a new DB item
# Returns: { itemid, chid, rev }
sub dbItemEdit {
@@ -41,6 +41,7 @@ sub dbItemEdit {
$self->dbReleaseRevisionInsert( \%o) if $type eq 'r';
$self->dbCharRevisionInsert( \%o) if $type eq 'c';
$self->dbStaffRevisionInsert( \%o) if $type eq 's';
+ $self->dbDocRevisionInsert( \%o) if $type eq 'd';
return $self->dbRow('SELECT * FROM edit_!s_commit()', $type);
}
@@ -98,6 +99,7 @@ sub dbRevisionGet {
UNION ALL SELECT 'r'::dbentry_type, chid, title, original FROM releases_hist
UNION ALL SELECT 'p'::dbentry_type, chid, name, original FROM producers_hist
UNION ALL SELECT 'c'::dbentry_type, chid, name, original FROM chars_hist
+ UNION ALL SELECT 'd'::dbentry_type, chid, title, '' AS original FROM docs_hist
UNION ALL SELECT 's'::dbentry_type, sh.chid, name, original FROM staff_hist sh JOIN staff_alias_hist sah ON sah.chid = sh.chid AND sah.aid = sh.aid
) x(type, id, title, original)
WHERE $w