Data-heavy static site -- advice, please

Discussion in 'Web Design and Development' started by monokakata, Nov 13, 2012.

  1. macrumors 65816

    monokakata

    Joined:
    May 8, 2008
    Location:
    Hilo, Hawai'i
    #1
    I used to be in the running race timing business (Runtime Services), but shut my company down in 2006. When I was in business, I had a website that (among other things) posted race results. Typically I would post a set of finishers by place, and then a set of finishers by name.

    After I shut down, I created a simple site at

    www.polymorphs.net

    and posted various sets of results that I knew the running community would want to see. I promised to someday post the entire archive, and it looks like now's a good time to get to work.

    The site's very plain. I don't want to seem too defensive about it, but there's nothing to be sold, I'm out of the business so it doesn't advance me, visitors typically know exactly what they want to look at, they know exactly how to read the listings, and most people visit only a few times a year.

    It has steady but low-volume traffic -- a few hundred visitors a day, peaking before big races. It's extremely rare for anybody to contact me about the site or its content, and when they do they're asking when I'll be posting such-and-such a race.

    Once I post all my archives, there won't be any new content, and nothing on the site will change.

    I need to post roughly 1000 events, ranging in size from very small (under 50 finishers) to very large (24,000+ finishers). The total number of finishers is a bit under 1,000,000.

    I ran my company on an Alphaserver running OpenVMS, and that's where I create the listings. It's largely automated. The automated procedures wrap the plain-text results in a very simple HTML wrapper, which you can see by looking at any of the files up there now.

    The listings on the site now are in files named according to the rules I used when I was running an active site (now gone). Now that I'm starting from race #1 (May, 1981) I'm using a very simple convention: the race number followed by P (by place) or N (by name). Thus the first race is represented by 0001P.HTML and 0001N.HTML and the last by 1019P.HTML and 1019N.HTML.

    At least 600 of the races are from before I was posting results on the web, so I'm having to go back and create new sets of results. It's not too late to change my naming convention, and it's not too late to change the way the results are wrapped in HTML (although I'd rather not do that).

    I have a couple of files (which can be seen on the site) listing the races by race name, and in chronological order. For example:

    http://www.polymorphs.net/results/1981_2006_runtime_races_res.html

    I want to do this is the simplest possible way, because I've got other things occupying my time. But I do want to keep my promise to post the entire archive.

    My plan is to use the race-name and chronological files by making each entry a link to the corresponding pair of results (P and N). In some cases there will be four sets of results (I was a "chip" or transponder timer for the last few years, and that means there are "gun" times and "net" times for some events).

    At polymorphs I simply created a folder for each group of events (sometimes a race series, sometimes a geographical area) and put the results in those folders.

    I think I'm going to need a different structure for the complete archives, and I'm wondering whether having a simple "results" folder with about 2,000 different files in it is a good idea.

    I'm thinking of continuing with the hand-coding, because there's nothing fancy or complicated happening (every set of results is in the same font, etc.). I have Dreamweaver and Rapidweaver and iWeb available.

    I can write a program to create links in the <a href="1019n.html" . . . mode over on the Alphaserver, automatically, using those two files I mentioned. That would save a lot of typing.

    So . . . how would you web people handle this task?

    Keep in mind that it's a utility site with no purpose other than to let visitors find a set of results and inspect them.
     
  2. macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #2
    No advice will be offered on layout or usability as you made very clear the purpose of your site and user expectations. Based on the link and your description, flat files wrapped in HTML are currently being generated.

    Here's a bare bones untested example demonstrating pagination of static content, i.e. simply create static html files named "document-page-0.html" and "document-page-1.html" etc. and paginate manually:

    PHP:
    <?php

    $page 
    = (isset($_GET['page'])) ? $_GET['page'] : 0;

    $content = include "document-page-$page.html";

    echo 
    $content;

    $total_pages count($pages);

    $prevpage $page 1;
    $nextpage $page 1;

    if (
    $page 0)
    {
        if(
    $page $total_pages 1)
        {
            
    $page_div ' | ';
        }
        else
        {
            
    $page_div '';
        }

        echo 
    "<a href=\"?page={$prevpage}\">Prev</a>{$page_div}";
    }

    if (
    $nextpage $total_pages)
    {
      echo 
    "<a href=\"?page={$nextpage}\">Next</a>";
    }

    ?>
    Note: If 2,000 lines are all in one document, you could manually edit and add in a simple token such as "{newpage}" and adjust the above script:

    PHP:
    $page = (isset($_GET['page'])) ? $_GET['page'] : 0;

    $content "Hello, World!
    {newpage}
    Hey! A new page...
    {newpage}
    Kool
    {newpage}
    Another too!
    {newpage}
    Umm, bye!"
    ;

    $pages explode('{newpage}'$content);

    echo 
    $pages[$page].'<br>';
    The object, however, is to ensure 2,000 records don't load all at once on every page for all users. So the key is to split the data into pages and paginate, no doubt. FYI - In most situations like this, the data is in a database which is then queried to return one page at a time via pagination. The query result (data) is wrapped within next/prev page form controls in HTML. PHP/MySQL in Rapidweaver could handle this for you if the data can be inserted into a database. Obviously this requires a LAMP based webhost and you'd likely use Rapidweaver to create a PHP/MySQL sandbox for development and testing using MAMP.

    Regardless of database or static file, I found one library I think will help you a great deal --- an Ajax/Pagination solution which will speed up your site and load pages dynamically:

    http://www.designaeon.com/jquery-ajax-pagination/

    Of course the example code is intended to integrate with a database, as I explained above it is the most common solution. But looking at the code, you could replace the database stuff code that gets rows from your static HTML file which has all 2000 records. The logic is the same, just a different source. So basic PHP knowledge required to open a file, load x lines, maintain offset, integrate into Ajax. Best of all worlds, only one page loads at a time, very minimal impact on site.
     
  3. thread starter macrumors 65816

    monokakata

    Joined:
    May 8, 2008
    Location:
    Hilo, Hawai'i
    #3
    Thanks very much.

    I'm replying before looking carefully at your suggestions. I was beginning to think that my task was so uninteresting that no one would respond. (I do understand that it's not very interesting in fact.)
     

Share This Page