summaryrefslogtreecommitdiff
path: root/util
AgeCommit message (Collapse)AuthorFilesLines
2010-11-25JS: Split script.js into a separate file for each languageYorhel1-55/+62
This greatly reduces the size of the Javascript file. The compressed size has been reduced with about 9kB, and is now a total of 14kB for en.js. A nice property of this is that more translations can be added without increasing the JS size. While I was at it, I made jsgen.pl also replace mt() function calls in cases where an exact TL string was requested without any additional arguments and/or formatting codes. This helped reduce the compressed size by about 1kB. My aim is to keep *all* the JS code of VNDB smaller than the jQuery core library, as a general "fuck you" towards users of large and bloated JS libraries. We must keep the VNDB page loading times lower than that of other sites, after all!
2010-11-24vndb.pl: Use the Makefile to auto-update static filesYorhel1-42/+7
Rather than trying to figure out what to update in the Perl code, duplicating the logic that's already present in the Makefile. This is only enabled when 'regen_static' is set to true in data/config.pl.
2010-11-21Implemented the client side of the new release filter systemYorhel1-2/+28
This isn't entirely functional yet, the server side will need to be rewritten as well. And after that new filters should be added and this system should also be used for VN/producer search. script.js is getting quite large with all those new translation strings, it may be an idea to generate a separate .js file for each language and only load the one being used. I won't have a valid reason to feel bored anytime soon, at least...
2010-11-14SQL: Removed CREATE LANGUAGE plpgsqlYorhel1-3/+0
plpgsql is available by default in PostgreSQL 9.0, so there's no need for this statement anymore.
2010-11-14SQL: Added ON DELETE clause to all foreign keys referencing users (id)Yorhel2-12/+147
This makes deleting user accounts less error prone. It also seems I forgot to git add update_2.14.sql in an earlier commit, sorry about that.
2010-11-14SQL: Added WHEN clause to all TRIGGERs for which it was usefulYorhel2-152/+144
This effectively removes compatibility with all PostgreSQL versions below 9.0. The use of the WHEN clause has two major advantages: 1. Performance: Trigger functions aren't executed when they don't need to. 2. Easier and more general trigger functions; as some of the logic has been placed in the trigger definitions now.
2010-11-14Improved performance of update_vnpopularity() on PostgreSQL 9.0Yorhel1-1/+3
Back from 180s to ~5 or ~6 seconds. It used to be quite fast on PostgreSQL 8.4, but somehow the planner failed to generate a proper execution plan for that query after the upgrade. This query is fast 9.0.
2010-11-10Multi::RG: Use dotted line to indicate unofficial status in VN relationsYorhel1-1/+1
Also fixed a minor bug with no change notification being sent to Multi when only the official flag has been changed.
2010-11-10Started on adding an "official" flag to vn<->vn relationsYorhel3-2/+9
This is the first part. The flag is stored in the database, can be edited through the usual VN edit form, and is displayed in the diff viewer. Things to do to make this feature fully functional: - display "official" status on VN page at the relation listing - update relation graphs to display unofficial relations differently - update guidelines
2010-11-06Synchronised sql/schema.sql with the actual DBYorhel1-1/+2
Looks like I forgot to add vn.c_search
2010-11-03Use newlines to separate VN aliasesYorhel1-0/+5
2010-11-02Automatically read L10N keys from script.jsYorhel1-46/+44
This makes jsgen.pl a bit easier to maintain, as there's not one reliable source to get the keys from (namely, the JS code itself). Also cleaned up the l10n() function in jsgen.pl to be more readable. I had expected the new .js file to be smaller because this trick may remove some keys that were previously present but unused. Unfortunately it seems the file only grew a bit larger and compression seems to be less effective now. No idea why this happened. :-(
2010-11-02Prefix all cookies with a configurable cookie_prefixYorhel1-0/+1
This replaces the "cookie_auth" setting, and applies to all cookies in use by VNDB.
2010-11-01Added Apple iProduct platformYorhel1-0/+1
2010-10-31Added 1024x576 and 1280x800 screen resolutionsYorhel1-0/+5
2010-03-13Improved VN searchYorhel3-0/+58
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.
2010-02-17CSS: Refer to all external files with the version as query stringYorhel1-5/+12
This makes sure that these also get forced reloaded on a version change.
2010-02-05Merge branch 'master' into betaYorhel1-2/+2
Conflicts: data/lang.txt
2010-02-05Notifications: Added 'announce' notificationYorhel4-3/+27
This one is also configurable, but mainly because I want to avoid generating several thousands of notifications for a single action...
2010-02-05Notifications: Added 'dbedit' notificationYorhel4-5/+50
And added a settings window where you can disable this notification, which is something you really want to do if you're an active contributor...
2010-02-04SQL: Alter the default of sessions.added in the update scriptYorhel1-0/+1
Forgot to do this in the earlier commit.
2010-02-04Notifications: Added notify for deletion of entries in (wish)listYorhel3-4/+41
2010-02-02Differentiate between pt-PT and pt-BR in the languagesYorhel1-5/+6
As requested, http://vndb.org/t423
2010-02-02SQL: Converted language columns to an ENUM typeYorhel4-5/+19
And changed vn.c_languages to an array type while I was at it. This required some changes in the Perl code, and I found a bug in DBD::Pg while I was at it: https://rt.cpan.org/Ticket/Display.html?id=54224 Luckily, there's an easy workaround for that.
2010-02-02SQL: Improved query in edit_commit()Yorhel1-6/+4
This one's a lot faster.
2010-02-01Added notification for database deletions to users who contributedYorhel3-4/+44
Complex queries...
2010-02-01SQL: Renamed the hidlock_update trigger namesYorhel2-6/+6
Nothing wrong with using the same name...
2010-02-01Cache the title and userid of the notificationsYorhel3-6/+11
These aren't likely to change anyway, and things will become less easy to display when other types of notifications are added.
2010-01-29SQL: Another try at fixing the tag spoiler calculationYorhel1-2/+2
62cb41c3b8780bffe5a8ea58a6a7b5053d9e1059 and 4895ea63323b94f0b128d6874be997a24d3a3b0d were bad jokes, really... let's hope this permanently fixes the problem.
2010-01-26SQL: Replaced sessions.expiration with sessions.addedYorhel2-1/+4
An expiration date doesn't make much sense if it's both not used and if it can't be configured by the user, so just make this a timestamp to indicate when the session has been added, which, while still not really used, is more valuable.
2010-01-26Keep track of when a session has last been usedYorhel2-0/+5
If we're going to automatically remove older sessions, it would make more sense to remove unused sessions, rather than old sessions that are still in use. But we first need to keep track of when a session has last been used to do so...
2010-01-26Removed the ?l10n= parameterYorhel1-8/+4
Setting the l10n cookie is now done from a separate url: /setlang This makes the language determination code less complex, and makes sure nobody links to pages that change the UI language without intending to. (I've seen some links floating around with the l10n parameter included, which is... bad)
2010-01-26Made a start on the notification systemYorhel5-8/+96
The current setup should be able to handle all kinds of notifications, though only PMs are implemented at this point. More to come.
2010-01-24Automatically generate the skin credits on d7Yorhel1-2/+2
Added a userid field in the skin config files, from which the credits are loaded. Now I don't have to constantly update d7 for every language when something changes in the skin files.
2010-01-24SkinFile: Abstracted access to the skin configuration filesYorhel2-59/+35
And updated skingen.pl and vndb.pl to make use of this abstraction.
2010-01-24Versioned the deleting and locking of database entriesYorhel4-11/+93
This is implemented by adding ihid (item hidden) and ilock (item locked) columns to the changes table, The (vn|release|producer).(hidden|locked) columns now work as a cache, refering to the changes.(ihid|ilock) columns with changes.id = (vn|release|producer).latest. The cached columns are updated automatically each time a new revision is inserted. This is a pretty large change, bugs are quite likely.
2010-01-23SQL: Don't DROP the temporary edit_* tablesYorhel1-39/+52
Simply re-using them by truncating the tables first is faster, and requires less locking when performing batch edits in one transaction.
2010-01-10L10N: Determine language from Accept-Language headerYorhel1-4/+16
So that people with correctly configured browsers don't have to manually choose their language of choice with the language switcher, and so that most people will have one cookie less. (The 'l10n' cookie is removed if it matches the Accept-Header language -- or the fallback) More info @ http://www.w3.org/International/questions/qa-lang-priorities
2010-01-09SQL: Split dump.sql into several files and merged update_2.10.sqlYorhel6-1148/+1028
The functions can now be edited without having to repeat them in the update scripts. Just importing the func.sql file with \i will do the trick.
2010-01-01SQL: Revision insertion abstraction for producer entriesYorhel1-0/+39
2010-01-01SQL: Revision insertion abstraction for release entriesYorhel2-2/+64
Also added a little sanity checking on the edit_(vn|release) table, and added a default value for releases_rev.released.
2010-01-01SQL: Made a start on revision insertion abstractionYorhel1-0/+110
This will make it easier to do automated edits, either from cron jobs, Multi, update scripts, or from within SQL triggers. So far only the VN related functions have been defined/updated, trying to edit/add releases or producers will not work at the moment. The functions for editing or adding a new database entry have been merged, as the procedure is rather similar. util/dump.sql will be updated later on.
2009-12-28SQL: Fixed bug in producer_relgraph_notify()Yorhel2-10/+4
2009-12-05SQL: Removed changes.causedbyYorhel2-3/+12
This column was used to differentiate between automated edits and user edits, but that later changed to checking for changes.requester = 1. The column has since never really been used, and due to a bug introduced in VNDB 2.0, it has never been updated, either. Meaning it's not even accurate for any database changes made after december 2008...
2009-12-05SQL: Call update_vncache() in a triggerYorhel2-2/+32
This removes the need for the dbVNCache() function in perl.
2009-12-05SQL: Don't allow argument of update_vncache() to be 0Yorhel2-18/+54
To batch update, simply do a SELECT update_vncache(id) FROM vn; The function is now more readable as well.
2009-12-05SQL: Removed the use of CONSTRAINT TRIGGERsYorhel2-30/+101
This makes use of the change that the [vn|producers].latest columns are now only updated after the entire revision has been inserted.
2009-11-29SQL: Replace index on tags_vn_inherit (tag) with an index on (tag,vid)Yorhel2-4/+4
This drastically improves the performance of the search-VN-tag-filter feature, and it seems PostgreSQL can use the index even when only filtering results by the tag column.
2009-11-29Tags: Replaced tag_tree() with WITH .. SELECT queries, and removed /g/debugYorhel2-61/+3
The return value of dbTagTree() is also somewhat easier to work with.
2009-11-29SQL: Rewrote tag_vn_calc() to use a WITH RECURSIVE .. SELECT queryYorhel2-45/+59
This is more efficient, and doesn't require the tag_tree() or tag_vn_childs() stored procedures. Does require PostgreSQL 8.4+