path: root/lib/VNDB/
AgeCommit message (Collapse)AuthorFilesLines
2018-01-06Add bb2text() and use it for release notes & open graph tagsYorhel1-1/+1
2018-01-06Rewrite bb2html() to be more flexibleYorhel1-1/+2
This is based on the API that I described in It's mostly bug-compatible with the old bb2html(), main differences: - <br /> -> <br> for no reason - Doesn't sporadically add a wrong </div> - $rmwhitespace now also after [/code] Most of the test cases were contributed by flan <>
2016-01-23L10N: Intern all VNDB::Handler::* stuffYorhel1-1/+9
Most of these replacements were automated. This ended up being less work than I had anticipated. I also fixed a few minor bugs along the way, but probably introduced more than I fixed.
2016-01-20L10N: Intern all VNDB::Util::* stuffYorhel1-1/+15
With some related edits in other parts of the code, mostly due to interface changes to htmlRevision() and htmlFormError(). Trivial replacements were automated by a super awesome script.
2016-01-19Move some VNDB::L10N stuff to VNDB::Func + intern VNDB::FuncYorhel1-6/+59
2016-01-17L10N: Intern blood_types/genders/(char|staff)_roles/discussion_boardsYorhel1-5/+0
I definitely needed the Tie::IxHash thing for these.
2016-01-17L10N: Intern tag_cats/voiced/animated/*_statusYorhel1-5/+1
2016-01-16L10N: Intern languages/platforms/resolutions/media/ptype/rtype/vnlengthYorhel1-3/+20
2015-11-01Switch to HTML5 doctype + s/acronym/abbr/ + s/&nbsp;/&#xa0;/eYorhel1-2/+2
I'd have preferred to stick with XHTML 1.0, but unfortunately browsers won't allow you to use modern Javascript APIs with an older doctype. Note that most pages don't actually validate correctly as HTML5, I'm relying on browsers to be lenient. In either case, I'd like VNDB to stay valid XML (XHTML5, then), and luckily that shouldn't be a problem.
2015-10-03Handle JSON data natively when processing form dataYorhel1-0/+18
No more need for extra json_encode/json_decode calls, and the form_compare() function is more lenient w.r.t. integer/string comparison. This is the improvement I described in commit ed86cfd12b0bed7352e2be525b8e63cb4d6d5448
2015-09-20formValidate: Add json template and remove json_validate() functionYorhel1-27/+1
This is less convenient than I had expected, because all the form handling code is designed to work with plain strings rather than any scalar. This means the json data has to be encoded again to get into $frm (not doing this means that, if the form didn't validate, the field won't be filled out correctly). And then decoded for validation, and then encoded again for comparison. I suspect the better solution is to fix the form handling code to handle arbitrary data structures: comparison can be done by deep comparison rather than a simple string compare, and the form generator can auto-encode-to-json if it sees a complex object. Another advantage of this solution is that the comparison function can be less strict with respect to number formatting. In the current scheme you have to be very careful that numbers are not automatically coerced into string format, otherwise the comparison will fail. Either way, that's an idea for the future...
2015-09-17Rename jsonEncode/Decode to C-style namingYorhel1-5/+5
CamelCase is used for methods, C-style names for functions. I'm just nitpicking now.
2015-09-17Created json_validate() for JSON form data, used for Staff alias editorYorhel1-2/+28
The intention is to move more JS editing forms to use JSON, but manually verifying JSON objects is both painful and likely to introduce errors or vulnerabilities. json_validate() is a bit of a hack, but has the advantage that its validation syntax is the same as for normal forms, and it automatically strips whitespace. I intent to give kv_validate() an upgrade to be more flexible/modular so it can do more custom normalization. But that's for later. I've been meaning to rewrite the JS forms anyway together with the large JS rewrite, but I'm rather lazy. This is one small step in the right direction anyway. Note that json_validate() assumes that the JS code will provide user-friendly messages on bad input, but the staff alias editor doesn't quite do this yet.
2015-01-02staff: Don't allow empty staff revisionsYorhel1-5/+7
2015-01-02staff: Fix deleting of staff + use JSON to pass data + minor fixesmorkt1-0/+24
2013-01-21I18N: Merge all translation strings that eval to "Unknown"Yorhel1-1/+12
A generic '_unknown' is more easily usable.
2012-01-10Allow one fractional digit for VN votesYorhel1-1/+6
The interface to set a non-integer vote isn't very nice, but at least it works. Or so I hope.
2011-08-23VNDB::Func: Fixed bug in imgpath()Yorhel1-1/+1
2011-08-22Use generic imgurl() and imgpath() functions to generate image URLs/pathsYorhel1-1/+16
2011-04-03Order the traits groups on /i by their 'order' columnYorhel1-2/+2
2011-03-30chardb: Rushed in some crappy spoiler hiding stuffYorhel1-1/+7
2011-02-21chardb: char-by-trait lookup + trait usage count + tag-code sharingYorhel1-2/+2
I'll have to optimize the updating of traits_chars as soon as I have some data to test with. Also renamed tags.c_vns to c_items, to have it share the same name as traits.c_items. This makes it a lot easier to re-use code for both tags and traits, such as what I did with dbTagTree/dbTraitTree -> dbTTTree and the childtags() and parenttags() functions.
2011-02-13chardb: Added notes file and started implementing the traitsYorhel1-1/+70
2011-01-25TUWF: Initial convert from YAWF to TUWFYorhel1-3/+2
There may still be some bugs present and I've only converted the points where TUWF is incompatible with YAWF. The new TUWF features are not in use yet, I'll do that later on. Note that, in order to run the new code, TUWF must be installed on your system. The configuration for the TransAdmin plugin has also changed. Other than that there shouldn't be any issues.
2011-01-01Implemented filFetchDB() and converted the VN/Release browser to use itYorhel1-1/+1
This will correctly handle fetching stuff from the database when permanent filters are enabled. This update also removes compatibility with some old VN browse URLs. The old 'ti' and 'te' (tag include/exclude) query parameters are now ignored, and searching for a language in the query string (e.g. "q=English") won't enable the language filter.
2010-12-19RFC-01: Code/DB cleanup and renamed some stuff for consistencyYorhel1-16/+1
2010-12-17Don't allow NULL for rr.minage and use -1 for unknownYorhel1-1/+1
This can be seen as a partial revert of 0a4f97f0186d6941a4cab2e3bd05201f1fed1441. I used to think using NULL for special values is more "correct" in database terms. But in the end I guess I should be aiming for whatever solution is easier. Both are "correct" in a sense anyway.
2010-11-27Replaced old VN advanced options with the new filter selection systemYorhel1-1/+1
Had to fix some bugs here and there and add some new functionality to the abstractions at some places, but it appears to be working now. There are still a few TODOs left, I'll get to those in a bit.
2010-11-22Added basic validation of the filter stringYorhel1-4/+10
fil_parse() now checks for proper formatting of the string and ignores key/value pairs that are not the list of allowed keys. This makes it impossible to provide extra, unintended, arguments to dbReleaseGet(), such as 'results'.
2010-11-21Use ~ as value separator in the filter string, rather than a commaYorhel1-2/+2
It seems a comma has to be escaped in query string values. A ~ doesn't and thus makes the URIs significantly shorter.
2010-11-21Implemented the server side of the new release filter selectorYorhel1-1/+27
There's no validation of the filter string yet, and somehow I don't feel like adding that; it's a lot of code and there's nothing to protect - the values are inserted using parameters into a SELECT query, the worst thing that could happen is the user receiving a 500. Also, I've started using the perl '//=' operator, which was added in 5.10. This removes support for older perls.
2010-03-13Improved VN searchYorhel1-149/+2
This adds a new column to the vn table: c_search, which holds the normalized titles for speedy search results using LIKE. Also split some functions from VNDB::Func that didn't require YAWF into a VNDBUtil module, so Multi can also make use of them. The normalization functions are the same for Multi and VNDB, after all. The API and Multi::IRC still use the old search, these should be updated as well.
2009-11-14SQL/L10N: Allow NULL for releases_rev.minage and make the values translatableYorhel1-1/+16
2009-11-09bb2html: Added [code] tag and fixed a minor bugYorhel1-5/+18
The previous version also had a problem with closing tags when a $maxlength was defined. With $maxlength, not all tags actually open a tag in HTML, after all.
2009-10-07L10N: Extracted release list statusesYorhel1-2/+2
Should be converted to enums at some point... integers don't do the trick here.
2009-08-17L10N: Moved some functions from to and added Russian quant() ↵Yorhel1-67/+1
and age()
2009-08-17Started on a framework for interface I18NYorhel1-1/+8
You can ignore the entries in lang.txt, those are simply for testing purposes.
2009-06-06Improved in the release resolution options + typo fix: unkown -> unknownYorhel1-2/+2
2009-05-31Func::monthstr: Output date in italics if the day is unknownYorhel1-2/+3
<RT> yorhel, in the browse view, can you put the date in italics when the first complete release date is not "fully qualified" ? e.g. 2008-08
2009-03-22Merge branch 'tagging' into betaYorhel1-3/+31
Conflicts: lib/VNDB/DB/ util/updates/update_2.3.sql
2009-03-14Handling of g# in Multi and bb2html, and IRC notify on tag creationYorhel1-1/+1
2009-03-07Cute interface for displaying tag scoresYorhel1-2/+30
...I could've also just used a gradient background image, which is easier to do and looks better... but I hate solutions that require external resources. >.>
2009-02-16Improved handling of excessive newlines and newlines around [quote] tags in ↵Yorhel1-4/+5
2009-02-06Made all BBCodes case-insensitiveYorhel1-7/+7
2009-01-15Fixed month display on VNBrowseYorhel1-1/+1
2008-12-29Added [quote] tag formatting, fixed URL parser, and updated d9Yorhel1-4/+21
2008-12-27[spoiler] tag produces mouseover-style spoilers instead of ROT13Yorhel1-4/+8
2008-12-17Moved age() to VNDB::FuncYorhel1-1/+16
2008-12-13FF2 style fixesYorhel1-1/+9
Three-box-layout didn't work very well together with the screenshots on the homepage and the CSS icon hack needed a &nbsp; to get rid of a strange top margin. With this, the following browsers should render all pages correctly: FF2, FF3 and the latest Opera, Safari and Chrome
2008-12-11Basic userpage + recent votes to VN pages + long-object-float bugfixYorhel1-1/+8
These changes are all pretty much related, so couldn't really do that in multiple commits.