UCWCE

From UtterChaos
Jump to: navigation, search

Utter Chaos Web Comic Engine

Modules

Page Loader

This module creates an XHTML page from the comic template, inserts the image reference to the specified comic, fills in the archive popup menu, and current news entries. As much of this work should be done before hand as possible to make this script run quickly for each page refresh.

Database Interface

This module acts as the abstraction between our internal objects and the database backend. This will probably interface with MySQL.

get_comic(int cid) 
returns a comic object filled with the contents of the specified comic.
get_comic(int page) 
returns the cid of the comic on the specified page.
get_news(int nid) 
returns a news object filled with the contents of the specified news entry.
get_news_for_comic(int cid) 
returns an ordered list of nids for a specified comic.
search_comic_string(string) 
returns an ordered list of comics that match the search string.
search_news_string(string) 
returns an ordered list of news entries that match the search string.

Still needed:

  • Insertion, modification methods
  • Chapter & book methods

Comic Uploader

This module uploads comics into the engine and updates the database with the appropriate information.

News Poster

This module is used to add news posts to the database which will be used by the page loader.

Cron Updater

This module is run on a daily basis to post comic updates at a specified time in the future.

Search

This module will run a search for keywords, new posts, and comic dialog.

File Structure

Comic image files 
/comics/comic${cid}.foo
Icons files  
/icons/*
Skins 
/skins/${skin_name}/
Templates 
/skins/${skin_name}/templates/*
PHP Script include files 
/include/*

Schema

Schema for the MySQL DB backend

Comic Table

cid page date title comic_path Chapter Text description Status
1 1 2/6/2006 Enter the Dragon comic20060206.png 1 You killed my fish! live
2 2 2/8/2006 Exit Tiger comic20060208.png 1 Why does that pickle you? working

This table contains all the information for a specific comic on a row.

  • The cid is a unique serial number for each comic that will never change no matter how much reordering of pages occurs.
  • The page field provides the ordering information as to which comic
  • The date field specifies when the comic should be or was released.
  • The title field contains the title of the comic
  • The comic_path specifies what pathname should be inserted into the XHTML template for the image. This is based on the file structure section above.
  • The chapter field specifies what chapter a comic is included in.
  • The text description contains a textual description of the comic to aid in searching.
  • The status field determines if a page appears on the live site.

This table needs to be indexed in several ways:

  • Cid: This will be the most common way of referring to a comic. It should be fastest since it uses unique unchanging IDs
  • Chapter: When building the comic archive list, the entries will be retrieved by chapter and sorted by page
  • Page: When retrieving links for next and previous pages, the quickest approach is to select on the page number before and after this one.
  • Title: A full text index will allow us to do text searches.
  • Text Description: A full text index will allow us to do text searches.

News Table

nid date title poster entry status
1 2/6/2006 15:30 EST Enter the Dragon Artist Hey everyone, I posted a comic! live
2 2/7/2006 12:43 EST You Suck Writer Pthhhpbt live
3 2/8/2006 00:00 EST Exit Tiger Artist Waka waka working
4 2/9/2006 12:17 EST Lameness Admin I am lame working

This table contains all the information for a specific news entry on a row.

  • The nid is a unique serial number for each entry that will never change. Unlike comics, these are date sensitive, so the entries will be not allow reordering. (You want to post something in the past?)
  • The date field is a timestamp of when the post was made.
  • The title field contains the title of the news entry.
  • The poster field specifies who the poster of the news entry was.
  • The entry field contains the contents of the news entry.
  • The status field determines if an entry appears on the live site.

This table needs to be indexed in several ways:

  • Nid: This will be the most common way of referring to an entry. It should be fastest since it uses unique unchanging IDs
  • Title: A full text index will allow us to do text searches.
  • Entry: A full text index will allow us to do text searches.

News Mapping Table

cid nid
1 1
1 2
2 3
2 4

This table provides a mapping of which news entries should be mapped to which comics. How this works is dependent on the customization options for a webcomic. Webcomics that do not put news entries on the same page as comics, will not need this table. Webcomics that do, may want to have the same news entries on several different comic pages if for instance they didn't write any new entries after the most recent update. This could be determined at runtime, but it may be to slow to try flip backwards through comics to determine what entries a given comic should have under it each page load.

Chapter Table

chapter title book status
1 Crash 1 live
2 Crashier 1 working

Book Table

book title status
1 Start! live
2 Downward working