Aquarionics

/home/a/aquarion/sites/www.aquarionics.com/epistula/chapters/journal.inc.php

All my code (That is, anything not in the "Others" list on the right) is BSD licenced.

You can also view this page as text/plain or colour-coded source


<?PHP
/*******************************************************************************
    Chapter - Journal
********************************************************************************

    "Page" clone, Display the item of this type, or a list of recent items

    $Id: journal.inc.php,v 1.2 2004/08/17 19:59:35 aquarion Exp $

    $log$
    2003-05-29 - aq -    Updated to display category-based list instead of normal
                        Updated to display 404 properly.
    26/11/2002 - aq - First version.

*******************************************************************************/
#array_shift($wanted);
$file = implode("/",$wanted);

$page->title = "Journal";

$types = array("journal");
$display = "single";
$limit = 10;

$localnav = array(
    array("link" => "/journal/full", "name" => "All by Category"),
    array("link" => "/journal/", "name" => "Last 10"),
    array("link" => "/archive/journal/", "name" => "By Date")
);

$page->localnav = $page->subheading("More Journal:").$page->menu($localnav);
$page->localnav .= $page->ulink("/meta/journal.rss2", $page->image("/assets/images/buttons/rss2.gif", "[RSS Icon]"), "Aquarionics ".$page->chapter." RSS Feed")."<br>";
$page->localnav .= $page->ulink("/meta/journal.esf", $page->image("/assets/images/buttons/esf.gif", "[ESF Icon]"), "Aquarionics ".$page->chapter." ESF Feed")."<br>";
$page->localnav .= $page->ulink("/meta/journal.cdf", $page->image("/assets/images/buttons/cdf.gif", "[CDF Icon]"), "Aquarionics ".$page->chapter." CDF Channel");


switch ($wanted[1]){
    case "id":
        if (!is_numeric($wanted[2])){
            $page->status=404;
        } else {
            $return = showItem($page,"journal.id = ".$wanted[2],"journal",$display);
            if ($return[0]){
                    $page->content .= $return[1];
                    #$page->localnav .= $page->subheading($_EP['nameforQV']).getQV($page,$return[0],"journal");
            } else {
                    $page->status=404;
            }
        }
        
        break;    

    case "name":
        $return = showItem($page,"title = \"".urlencode($wanted[2])."\"","journal",$display);
        if ($return[0]){
            $page->content .= $return[1];
            $page->localnav .= $page->subheading($_EP['nameforQV']).getQV($page,$return[0],"journal");
        } else {
            $page->status=404;
            $found = false;
        }

    case "full":
        $page->title = "All by Category";
        $page->content .= $page->item(byCat("journal"));

    break;        

    case "":
        $display = "full";
        $page->title = "Last $limit Articles";
        $page->content .= buildIndex($types,$display,$limit);
        break;

    default:
            if (is_numeric($wanted[1]) && is_numeric($wanted[2]) && is_numeric($wanted[3]) && $wanted[4]){

            $qex = " (MONTH(date_created) = '".$wanted[2]."') "
            ."and (YEAR(date_created) = '".$wanted[1]."') "
            ."and (DAYOFMONTH(date_created) = '".$wanted[3]."') "
            ."and title = \"".ep_decode($wanted[4])."\" ";
            $return = showItem($page,$qex,"journal",$display);

            if ($return){
                $page->content .= $return[1];
                $page->localnav .= $page->subheading($_EP['nameforQV']).getQV($page,$return[0],"journal");
                $page->localnav .= pageShowAds($page->date,"3821646156", "journal-".$return[0]);

            } else {
                    $page->status=404;
            }
        } elseif (is_numeric($wanted[1]) && is_numeric($wanted[2]) && is_numeric($wanted[3])) {
            $page->status = 303;
            $page->content = "/archive/journal/".$wanted[1]."/".$wanted[2]."/".$wanted[3];

        } elseif (is_numeric($wanted[1]) && is_numeric($wanted[2])) {
            $page->status = 303;
            $page->content = "/archive/journal/".$wanted[1]."/".$wanted[2];

        } elseif (is_numeric($wanted[1])) {
            $page->status = 303;
            $page->content = "/archive/journal/".$wanted[1];
        } else {
            $page->status = 404;
        }
}
#$page->content .= $page->item($c);


?>



Using a heavily customised version of Tom's PHPCode2ValidXHTML Thing

Nicholas 'Aquarion' Avenell is a web developer in London, you can find out more about him or how to get in touch.

There are more Articles, Projects, Journal Entries, Photographs and things that defy description here, too.

If you're looking for something specific, there are Calendar & Category -based lists of everything.

And if you want to follow stuff that appears here, try a Syndication Feed, or the generic Feed of everything.


Aquarion's last Twitter was: [updating]
Twitter last updated


© 2000 to 2008 inclusive Nicholas Avenell
All comments are the property of their creators, published with permission
(Unless otherwise indicated, the opinions and sentiments expressed on this site are those of the author and not of any organisation of which he is an affiliate, including his employer. Caveat Lector, E&OE. sigh)
0.441 seconds, 1 queries, 2.67Mb on Sat, 05 Jul 2008 10:45:51 +0000, Not cached
Generated by Epistula Version 2.0.3