Codex is a PHP/MySQL fanfiction database. It maintains cross-referenced data about fanfics, including authors, matchups, genres, and series, and can sort and display according to those criteria. Since there are all those complaining buttnuggets out there, I can only give you the source code and structure, you have to fill in the database information yourself. The only example entry is one for Guardian Angel by me, just so you can see how the database structure works.

The tables with two pieces of information in the name separated by an underscore (fic_series, fic_author, etc) are reference tables with no primary key, just foreign keys pointing to the primary ids for each table it references (in fic_series, for example, fic_id points to the fic we’re talking about and series_id points to the series it takes place in). The relations in the SQL comments, but there’s no real hard-coded relations – the tables are MyISAM, which doesn’t support relations natively, but innodb does. I chose MyISAM as the storage engine since it’s a write-once-read-many setup, so atomic transactions aren’t all that necessary.

There’s no easy way to add an entry now, you just edit the database directly. I’ll put an actual entry form out later. Don’t worry about conflicting version numbers for the SQL and the PHP. As long as you use the newest versions of them together, it won’t matter since they’ll work together. You’ll have to read the code to figure out more about how it works. If you do or would like to use it, you might want to drop me a line in case there are any features I’ve written but haven’t posted yet.

Changelog

  • 20080821 – 0.4.0 
    • Option to enable debugging output
    • Database persistent connections are now off by default
    • Warnings fixed in various places
    • Database access API significantly cleaner
    • ADODB caching is now an optional config setting (since caching slowed things down for me greatly)
    • Code cleanups in many places: large functions cut down in size, better code constructs, useless stats removed, etc
    • CSS split out with session support for themes (light and dark theme included)
    • Removed useless dbperfmon option
    • Support for multichapter fics, with dynamic navigation toolbars on the top and bottom and a table of contents
    • Support for attempting to unwrap fics that have fixed-width line breaks
    • Two-layer cache framework
    • Set the page width properly on iPhone
    • Search output is trimmed down to only show info relevant to search
    • Attempt a very basic fuzzy search if exact match is not found
  • 20080610 – 0.3.4 
    • Move config to its own directory
    • Smarty and ADOdb prefixes are now configurable
    • Break up function library into a file for each function that’s loaded on demand
    • Remove usage of obsolete HTTP_GET_VARS and HTTP_POST_VARS
    • Rewrite matchup_data to use SQL and be more efficient
    • SQL file is now included in tarball
    • Use a more sane versioning scheme (e.g. 0.3.3 instead of v03c)
  • 20050713 – v03c 
    • Rewritten yet again to use the smarty template system, so you’ll need that too. Yeah, it’s more stuff you have to install, but it makes it a lot easier to customize the layout and appearance of the data. Since there are a number of templates in separate files now, it’s too cumbersome to post individual files, so it’s in tarball form now. The database is still the same, so the same old sql file is distributed separately.
  • 20050616 – v02b 
    • Many many changes, hence the major version number bump. Rewritten to use ADOdb database abstraction, so you need that installed. (It’s just a few php files) Search engine that will search all fields, and highlight the search string in the results. Added on-the-fly spellchecking that can modify and replace words according to a set of regular expressions in the config file. (Because I hate seeing “definately” instead of “definitely”, among others) Put the fic name in the web page title when reading a fic. Enabled complete disabling of lemons.
  • 20050612 – v01e 
    • Besides a number of other minor changes, split into a main file and a config file. Converted to table-organized formatting. Added support for ‘marking’ lemon fics with a different color.

Download

Older versions