Home > dolphinbook

dolphinbook

Dolphinbook is a project mainly written in PHP and RUBY, based on the View license.

A simple PHP-based site to tell people who were in their classes before school started, written Summer 2006

Dolphinbook "the OL Schedule DB v 2.0"

What is this?

TL;DR a database to show high school students who are in their classes based on self-reporting before school starts. And some tools to maintain it

Dolphinbook was a personal project I undertook in Summer 2006 to recreate a schedule matching database to be used in the few weeks between when class schedules were mailed out for my highschool and when classes began. More properly, it was a rewrite of something I had done on some free host in Summer 2005 with the same aim and then lost the code to. Despite being a highly niche-product, it was relatively popular and garnered about 700 users summer 2006, 600 users summer 2007, and to my great confusion, about 700 users summer 2008 despite my lack of publicizing it and the large posted notice saying I refused to ensure its integrity due to my graduation (and looking for a new maintainer who never appeared). (for scale, there were about 2400 students in the school in the 2008-2009 school year, slightly less before 2007.)

The essential concept was that of a self-building database. The first user would have no data and would enter their classes completely. Later users would have suggestion/auto-completion of fields based on the input of earlier users. This sought to homogenize the exact strings entered by users so that they would get the most results. This built a table from which lists of who was in what class would be rendered and presented to users (who claimed to be) in that class.

Other features were planned but never implemented. Sadly, in summers 2006, 2007 (and 2005 on the earlier revision) I spent the majority of the two or so weeks the site was active correcting for human error (e.g. typos in teacher's names) and mismatches in the course titles entered (e.g. Spanish II vs Spanish 2). In turns out that keying on user-entered strings (or rather, creating unique numerical keys corresponding to user strings) did not lead to the most accurate of data. To assist in correcting for these errors, I built a suite of scripts/tools to locate and correct these errors. (They are in the scripts directory)

Why is it here?

Because I realized that I have no code open sourced and online; I realized this is a shame and that I should start sooner rather than later. It is to maintain a historical archive of what type of code I wrote 4 years ago. Finally, though simple and very small targeted, it was a tool that a relatively large number of people found useful at one time, so there is a small chance someone will fork it and want to use it again.

Can I use it then?

Yes.

Sure. Feel free to fork it and use it as you please. I consider all code here to be under the terms of the MIT License. Note that it is based on a A/B block scheduling (sets of 4 classes alternated every other day), so it will need some modification (though not substantial) for semantics of other types of scheduling.

Here's how...

  1. Obtain hosting that supports PHP. There aren't any non-standard modules involved. So there should be no real challenge there.
  2. Copy the source directory there. git clone it, use the download source link above, whatever you wnat.
  3. Make the database. I used MySQL, but there is no reason it shouldn't work with Postgres, MS SQL, etc. It's a pretty simple schema, just two tables. Here's the SQL you need basically.

    CREATE TABLE `classes` (
      `id` int(4) NOT NULL auto_increment,
      `block` enum('1a','2a','3a','4a','1b','2b','3b','4b') NOT NULL,
      `class` varchar(30) NOT NULL,
      `teacher` varchar(20) NOT NULL,
      PRIMARY KEY  (`id`)
    );
    
    CREATE TABLE `students` (
      `id` int(4) unsigned NOT NULL auto_increment,
      `name` varchar(30) NOT NULL,
      `password` char(40) NOT NULL, /*stored as a sha1 hash*/
      `email` varchar(50) NOT NULL,
      `verif` tinyint(1) NOT NULL,
      `1a` int(4) default NULL,
      `2a` int(4) default NULL,
      `3a` int(4) default NULL,
      `4a` int(4) default NULL,
      `1b` int(4) default NULL,
      `2b` int(4) default NULL,
      `3b` int(4) default NULL,
      `4b` int(4) default NULL,
      PRIMARY KEY  (`id`),
      UNIQUE KEY `email` (`email`)
    );
  4. Make sure there is a user that can access this database with at least SELECT, INSERT, and UPDATE privileges (one for use with the admin scripts will also need DELETE).
  5. Put server, database, user, and password in appropriate places in fnord.php (and at the tops of scripts/conflict-fix.rb, scripts/class_stats, scripts/find_classes_with, and scripts/find_empty_classes, if you want to use them).
  6. That should be it! (Now make modifications appropriate to your school. If you make feature changes that might be generally useful feel free to send a pull request.).
Previous:eventual