Changeset 2

Show
Ignore:
Timestamp:
10/17/07 22:27:05 (1 year ago)
Author:
aquarion
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/chapters/article.inc.php

    r1 r2  
    5454                        $page->content .= $return[1]; 
    5555                        $page->localnav .= $page->subheading($_EP['nameforQV']).getQV($page,$return[0],"article"); 
    56                         $page->localnav .= pageShowAds($page->date,"4546649417"); 
     56                        //$page->localnav .= pageShowAds($page->date,"4546649417"); 
     57                        $page->localnav .= pageShowAds($page->date,"4546649417", "article-".$return[0]); 
    5758                } else { 
    5859                        $page->status = 404; 
  • trunk/chapters/frontpage.inc.php

    r1 r2  
    1414$page->title = $_EP['tagline']; 
    1515 
    16 if ($wanted[1]){ // Any arguments are bad arguments 
     16if (isset($wanted[1])){ // Any arguments are bad arguments 
    1717        $page->status = 404; 
    1818} else { 
     
    143143//********************************** 
    144144 
    145 $page->pagenav .= $page->ulink("/meta/blink.rss2", $page->image("assets/images/buttons/rss2.gif", "[RSS Icon]"), "Aquarionics Blink RSS Feed"); 
     145//$page->pagenav .= $page->ulink("/meta/blink.rss2", $page->image("assets/images/buttons/rss2.gif", "[RSS Icon]"), "Aquarionics Blink RSS Feed"); 
    146146#$page->pagenav .= $page->ulink("/meta/blink.esf", $page->image("assets/images/buttons/esf.gif", "[ESF Icon]"), "Aquarionics Blink ESF Feed"); 
    147147 
     
    161161#$page->pagenav .= "<div class=\"columnheader\">".$page->image("/assets/aq10/images/twhs.png", "Those who have spoken")."</div>\n"; 
    162162 
    163 /*$page->pagenav .= "<h2 class=\"columnheader\">Comments</h2>\n"; 
    164  
    165163$entries = array(); 
    166164$comments = array(); 
     
    171169 
    172170foreach ($items as $item){ 
    173         $comments[] = array( 
    174                 'name' => break_string($item['title'], 34), 
    175                 'link' => getPermalink("comment", $item['id']) 
    176         ); 
    177 
    178  
    179 $page->pagenav .= $page->menu($comments,"commentsRSS"); 
    180 #$page->pagenav .= "Comments: "; 
    181 $page->pagenav .= $page->ulink("/meta/comment.rss2", $page->image("assets/images/buttons/rss-comments.png", "[RSS Comments Icon]"), "Aquarionics Comments RSS Feed")."<br>\n"; 
    182 $page->pagenav .= $page->ulink("/meta/comment.esf", $page->image("assets/images/buttons/esf-comments.png", "[ESF Comments Icon]"), "Aquarionics Comments ESF Feed")."<br>\n"; 
    183 $page->pagenav .= $page->ulink("/meta/comment.cdf", $page->image("/assets/images/buttons/cdf.gif", "[CDF Icon]"), "Aquarionics ".$page->chapter." CDF Channel")."<br>\n"; 
    184 */ 
     171 
     172        $comments[] = "<a href=\"".getPermalink("comment", $item['id'])."\" >" 
     173                .$item['title'] 
     174                ."</a>"; 
     175
     176 
     177 
     178$recentComments = "<h2>Recent Comments...</h2>"; 
     179$recentComments .= $page->buildlist($comments,false,"plainlist"); 
     180$recentComments .= <<<EOW 
     181        <a href="/meta/comments.rss2" class="more"><img src="/assets/aq13/images/feed-icon-14x14.png" width="14" height="14" border="0" alt="Feed Icon"> Subscribe</a> 
     182        <a href="/comments" class="more">More comments...</a> 
     183EOW; 
     184 
     185 
     186 
     187 
     188 
     189 
     190$page->boxes['comments'] = $recentComments;  
     191 
     192 
    185193 
    186194/* Now Listening To */ 
     
    301309$type = array("journal","article","writing","gallery"); 
    302310$display = "full"; 
    303 $limit = 1; 
     311$limit = 7; 
     312 
     313$page->content = ' 
     314                <div id="twitter"> 
     315 
     316                        <span class="twitterInfo"><a href="http://www.twitter.com/aquarion">Current Status:</a> </span> 
     317                        <q id="twitterQuote"><img src="/assets/images/ajax-loader.gif" width="15" height="15" border="0" alt=""></q> 
     318                        <span id="twitterTime"></span> 
     319                </div> 
     320'; 
    304321 
    305322#$page->content .= "<div class=\"columnheader\">".$page->image("/assets/aq10/images/twi.png", "That which is")."</div>\n"; 
  • trunk/chapters/gallery.inc.php

    r1 r2  
    1919 
    2020$page->title = "Gallery"; 
     21 
    2122 
    2223/******************************************************************* 
     
    4748$results = safequery($query); 
    4849 
     50 
     51 
    4952if (mysql_num_rows($results) == 0) { 
    5053                $page->content = "Gallery in existance failure error. The universe will self-destruct shortly.<br>".$query; 
     
    5356} else { 
    5457        $page->debug[] = "Found Gallery"; 
     58 
    5559        $gallery = mysql_fetch_assoc($results); 
    5660        $page->title = $gallery['title']; 
     
    5862 
    5963        $fdir = $_EP['webdir']."/".$dir; 
     64 
     65        $page->localnav = pageShowAds($page->date,"", "gallery-".$gallery['id']); 
     66 
    6067 
    6168        $menu = array(); 
     
    94101        #$page->localnav .= byCat("gallery", "nodesc", "", "title"); 
    95102 
     103         
     104 
    96105        if ($wanted[2] == "") { 
    97106 
  • trunk/chapters/journal.inc.php

    r1 r2  
    5656                        $page->content .= $return[1]; 
    5757                        $page->localnav .= $page->subheading($_EP['nameforQV']).getQV($page,$return[0],"journal"); 
    58                         $page->localnav .= pageShowAds($page->date,"3821646156"); 
    5958                } else { 
    6059                        $page->status=404; 
     
    8281                        ."and title = \"".ep_decode($wanted[4])."\" "; 
    8382                        $return = showItem($page,$qex,"journal",$display); 
     83 
    8484                        if ($return){ 
    8585                                $page->content .= $return[1]; 
    8686                                $page->localnav .= $page->subheading($_EP['nameforQV']).getQV($page,$return[0],"journal"); 
    87                                 $page->localnav .= pageShowAds($page->date,"3821646156"); 
     87                                $page->localnav .= pageShowAds($page->date,"3821646156", "journal-".$return[0]); 
     88 
    8889                        } else { 
    8990                                        $page->status=404; 
  • trunk/chapters/showcode.inc.php

    r1 r2  
    2424array_shift($wanted); 
    2525 
    26 if ($wanted[0] == "chapters"){ 
     26if ($wanted[0] == "newchapters"){ 
     27        $srcfile = "newchapters/".$wanted[1]; 
     28} elseif ($wanted[0] == "chapters"){ 
    2729        $srcfile = "chapters/".$wanted[1]; 
    2830} elseif ($wanted[0] == "include"){ 
  • trunk/classes/html.class.php

    r1 r2  
    8585<link rel="stylesheet" type="text/css" href="http://www.aquarionics.com/assets/aq9/basic.css"> 
    8686<link rel="stylesheet" type="text/css" media="print" href="http://www.aquarionics.com/assets/aq9/print.css"> 
     87<script src="/assets/yui/build/yahoo/yahoo.js"></script>  
     88<script src="/assets/yui/build/connection/connection.js"></script>  
     89 
     90<script src="/assets/yui/build/event/event.js"></script>  
     91 
     92<script type="text/javascript"> 
     93var TwitterHandleSuccess = function(o){ 
     94        if(o.responseText !== undefined){ 
     95 
     96                textElements = o.responseXML.getElementsByTagName("text"); 
     97 
     98 
     99                if (textElements.length == 0){ 
     100                        document.getElementById('twitterQuote').innerHTML = "Unable to talk to Twitter :-("; 
     101                } 
     102                 
     103 
     104                desc = textElements[0].textContent; 
     105                time = o.responseXML.getElementsByTagName("created_at")[0].firstChild.data; 
     106                //div.innerHTML 
     107                if(desc){ 
     108                        document.getElementById('twitterQuote').innerHTML = desc; 
     109                        document.getElementById('twitterTime').innerHTML = time; 
     110                } else { 
     111                         
     112                } 
     113        } 
     114} 
     115 
     116var handleFailure = function(o){ 
     117        alert("FAIL!"); 
     118} 
     119var twitterCB = 
     120{ 
     121  success:TwitterHandleSuccess, 
     122  failure:handleFailure, 
     123  argument: { foo:"foo", bar:"bar" } 
     124}; 
     125function doTwitter(){ 
     126        var sUrl = "/assets/ajax/twitter.php"; 
     127        var request = YAHOO.util.Connect.asyncRequest('GET', sUrl, twitterCB); 
     128} 
     129YAHOO.util.Event.onAvailable ('twitter',doTwitter); 
     130 
     131</script> 
     132 
    87133<link rel="SHORTCUT ICON" href="http://www.aquarionics.com/assets/aq9/favicon.png"> 
    88134<style type="text/css"> 
     
    94140                $files = array ( 
    95141                        //"header", 
     142                        date("Y",$this->date)."/header", 
     143                        date("Y\/F",$this->date), 
     144                        date("Y\/\w\kW",$this->date), 
     145                        date("Y\/m\-d",$this->date), 
    96146                        date("Y")."/header", 
    97147                        date("Y\/F"), 
    98148                        date("Y\/\w\kW"), 
    99149                        date("Y\/m\-d"), 
    100                         date("Y",$this->date)."/header", 
    101                         date("Y\/F",$this->date), 
    102                         date("Y\/\w\kW",$this->date), 
    103                         date("Y\/m\-d",$this->date), 
    104150                        "end", 
    105151                ); 
     
    114160 
    115161                        if (file_exists($_EP['webdir']."/assets/aq13/headers/".$test.".jpg")){ 
    116                                 $header .="\t #banner {\n\t\tbackground-image: url('/assets/aq13/headers/".$test.".jpg');\n\t}\n"; 
     162                                $header .="\t #banner {\n\t\tbackground-image: url('/assets/reflector/gd.php?http://www.aquarionics.com/assets/aq13/headers/".$test.".jpg');\n\t}\n"; 
    117163 
    118164                        } elseif (file_exists($_EP['webdir']."/assets/aq10/headers/".$test.".jpg")){ 
    119                                 $header .="\t #banner {\n\t\tbackground-image: url('/assets/aq10/headers/".$test.".jpg');\n\tbackground-color: black;\n\t}\n"; 
     165                                $header .="\t #banner {\n\t\tbackground-image: url('/assets/reflector/gd.php?http://www.aquarionics.com/assets/aq10/headers/".$test.".jpg');\n\tbackground-color: black;\n\t}\n"; 
    120166 
    121167                        } 
     
    183229                } 
    184230 
     231// Recent Journal Entries 
     232if (function_exists("getIndex")){ // Static pages like Projects fail this 
     233        $thoughts = getIndex("journal",'full',5); 
     234        $thoughtslist = array(); 
     235        foreach($thoughts as $thought){ 
     236                $thoughtslist[] = '<a href="'.getpermalink('journal', $thought['id'], $thought).'">'.$thought['title'].'</a>'; 
     237        } 
     238        $thoughts = $this->buildlist($thoughtslist, false, "recent journal"); 
     239} 
     240 
     241if (function_exists("getIndex")){ // Static pages like Projects fail this 
     242        $articles = getIndex("article",'full',5); 
     243        $articleslist = array(); 
     244        foreach($articles as $article){ 
     245                $articleslist[] = '<a href="'.getpermalink('article', $article['id'], $article).'">'.$article['title'].'</a>'; 
     246        } 
     247        $articles = $this->buildlist($articleslist, false, "recent article"); 
     248} 
     249// Recent Pictures 
     250 
     251$file = "http://www.aquarionics.com/assets/ajax/flickr.php"; 
     252$doc = new DOMDocument(); 
     253 
     254 
     255$loaded = $doc->load($file); 
     256 
     257$photosTable = "<table><tr>"; 
     258 
     259 
     260 
     261if($loaded){ 
     262        $maxPhotos = 6; 
     263 
     264        $photos = $doc->getElementsByTagName("photo"); 
     265 
     266        $photosList = array(); 
     267 
     268        $photoCount = 0; 
     269        foreach($photos as $photo){ 
     270                $pageNodes =  $photo->getElementsByTagName("page"); 
     271                $node = $pageNodes->item(0); 
     272                $href = $node->textContent; 
     273 
     274 
     275                $pageNodes =  $photo->getElementsByTagName("image"); 
     276                $node = $pageNodes->item(0); 
     277                $image = $node->textContent; 
     278 
     279                $photosList[] = '<a href="'.$href.'"><img src="/assets/reflector/gd.php?'.$image.'" /></a>'; 
     280                //$photosTable .= '<td><a href="'.$href.'"><img src="'.$image.'" /></a></td>'; 
     281 
     282                $photoCount++; 
     283                if ($photoCount >= $maxPhotos){ 
     284                        break; 
     285                } elseif ($photoCount /2 == floor($photoCount/2)) { 
     286                        $photosTable .= "</tr>\n<tr>"; 
     287                } 
     288        } 
     289} else { 
     290        $photosList = array(); 
     291} 
     292 
     293$photosTable .= "</tr></table>"; 
     294$photos = $this->buildlist($photosList, false, 'recent gallery'); 
     295 
    185296$out .= <<<EOW 
    186297 
     
    194305</div> 
    195306<ul id="menu"> 
    196         <li><a href="http://www.flickr.com/photos/aquarion/" class="pictures"><span>Pictures</span></a></li> 
    197         <li><a href="/article" class="words"><span>Words</span></a></li> 
    198         <li><a href="/writing" class="worlds"><span>Worlds</span></a></li> 
    199         <li><a href="/projects" class="projects"><span>Projects</span></a></li> 
     307        <li><a href="http://www.aquarionics.com/archive/journal" class="thoughts section"><span>Thoughts</span></a> 
     308                $thoughts 
     309        </li> 
     310        <li><a href="http://www.flickr.com/photos/aquarion/" class="pictures section"><span>Pictures</span></a> 
     311                $photos 
     312        </li> 
     313        <li><a href="/article" class="words section"><span>Words</span></a> 
     314                $articles 
     315        </li> 
     316        <li><a href="http://www.factionfiction.net" class="worlds section"><span>Worlds</span></a></li> 
     317        <li><a href="/projects" class="projects section"><span>Projects</span></a></li> 
    200318</ul> 
    201319 
     
    203321EOW; 
    204322 
    205 $out .= '<div id="content">'.$this->content.'</div>'; 
     323$out .= '<div id="content"> 
     324 
     325 
     326'.$this->content.'</div>'; 
    206327 
    207328 
     
    260381 
    261382<div class="toolbox"> 
    262 &copy; 2000 to 2006 inclusive <a href="http://www.gkhs.net/Nicholas/">Nicholas Avenell</a><br>All comments are the property of their creators, published with permission 
     383&copy; 2000 to 2007 inclusive <a href="http://www.NicholasAvenell.com">Nicholas Avenell</a><br>All comments are the property of their creators, published with permission 
    263384</div> 
    264385<div class="toolbox"> 
     
    342463         
    343464<div id="content"> 
    344 <div id="globalnav"><a href="/">Home</a> \\\\ <a href="http://www.flickr.com/photos/aquarion">Pictures</a> // <a href="/projects">Projects</a> \\\\ <a href="/article">Words</a> // <a href="/writing">Worlds</a></div> 
     465<div id="globalnav"><a href="/">Home</a> \\\\ <a href="/newgallery">Pictures</a> // <a href="/projects">Projects</a> \\\\ <a href="/article">Words</a> // <a href="/writing">Worlds</a></div> 
    345466 
    346467 
     
    493614                $out = ""; 
    494615 
    495                 if ($class != ""){$ulclass = " class=\"$class\"";}# else { $ulclass = " class=\"pipe\"";} 
    496                 if ($id != ""){$ulid = " id=\"$id\"";}; 
     616                //if ($class != ""){$ulclass = " class=\"$class\"";}# else { $ulclass = " class=\"pipe\"";} 
     617 
     618                $ulclass = $class ? ' class="'.$class.'"' : ''; 
     619                $ulid    = $id    ? ' id="'.$id.'"'       : '';  
     620 
    497621                $out .= "<ul".$ulclass.$ulid.">\n"; 
    498622                if (is_array($items)){ 
     
    830954                                                ) 
    831955                                        ); 
     956                        if (!empty($comment['email'])){ 
     957                                $links[] = array( 
     958                                        'link'  => "/comment/email/".md5($comment['email'].$_SECRET['hashSecret']), 
     959                                        'name'  => "More by this person", 
     960                                        'title' => "More comments from this given email address" 
     961                                ); 
     962                        } 
    832963                        if(allowsComments($item[0], $item[1])){ 
    833964                                $links[] = 
     
    845976                ."&amp;rating=R" 
    846977                ."&amp;size=80" 
    847                 ."&amp;default=".urlencode("http://www.aquarionics.com/assets/aq11/images/stamp.png"); 
    848  
    849 $out = '<div class="postcard"> 
     978                ."&amp;default=".urlencode("http://www.aquarionics.com/assets/images/default_avatar.jpg"); 
     979 
     980        $gravatar = 'http://www.aquarionics.com/assets/reflector/gd.php?type=jpg&url='.urlencode($gravatar); 
     981 
     982/*$out = '<div class="postcard"> 
    850983<div class="address"> 
    851984<div class="postmark">'; 
     
    8741007        '.$actions.' 
    8751008</div> 
    876         '; 
     1009        ';*/ 
     1010 
     1011                $date = date("jS M Y", $comment['epoch']); 
     1012                return '<div class="newcomment"> 
     1013                <div class="meta"> 
     1014                <img class="avatar" src="'.$gravatar.'" width="80" height="120" alt="gravatar image" class="gravatar" /> 
     1015                <div class="name">'.$name.'</div> 
     1016                <div class="date">'.$date.'</div> 
     1017                </div> 
     1018                <div class="data"> 
     1019                        '.stripslashes($quote[0]).' 
     1020                </div> 
     1021                <div class="commentactions"> 
     1022                        '.$actions.' 
     1023                </div> 
     1024                </div>'; 
    8771025 
    8781026                return $out; 
     
    9611109                } 
    9621110 
    963                 if ($array['update_epoch'] != $array['epoch'] && $array['update_epoch'] != 0){ 
    964                         $out .= "<div class=\"lastmodified\">Last Modified: ".date("Y-m-d\TH:i",$array['update_epoch']); 
    965                 } 
    9661111 
    9671112 
     
    9891134 
    9901135                        . "\t<ul class=\"pipe\">\n" 
    991                         . "\t<li class=\"first\">".$date."</li>\n" 
    992                         . "<li>".$this->ulink("/sysadmin/edit/?item=".$type."-".$array['id'], "", "Edit this")."</li>\n" 
    993                         . "\t<li>By ".$array['author']."</li>\n"; 
     1136                        . "\t<li class=\"first\">".$date."</li>\n"; 
     1137 
     1138                if ($array['update_epoch'] != $array['epoch'] && $array['update_epoch'] != 0){ 
     1139                        //nice_time(); 
     1140                         
     1141                        $time = niceTime($array['epoch'], $array['update_epoch'], true); 
     1142                        $out .= "<li class=\"lastmodified\" title=\"".date("Y-m-d H:i",$array['update_epoch']).'">Updated '.$time.' later</li>'; 
     1143                } 
     1144 
     1145                //$out .= "<li>".$this->ulink("/sysadmin/edit/?item=".$type."-".$array['id'], "", "Edit this")."</li>\n" 
     1146                $out .=  "\t<li>By ".$array['author']."</li>\n"; 
    9941147                        if ($array['location']){ 
    9951148                                $out .= "<li>From ".$array['location']."</li>\n"; 
     
    10231176//                      } 
    10241177//              } 
     1178                $return .= "</div>"; 
    10251179                if ($array['display'] != "readmore" && $array['display'] != "brief"){ 
    10261180                        $comments = getComments($page, $type."-".$array['id']); 
     
    10301184                        } 
    10311185                } 
    1032                 $return .= "</div>"; 
    10331186 
    10341187 
  • trunk/epistula.php

    r1 r2  
    8282 
    8383 
    84 if ($_GET['nocache'] || $_GET['regen']){ 
     84if (isset($_GET['nocache']) || isset($_GET['regen'])){ 
    8585        $caching = false;  
    8686        $_EP['caching'] = false; 
     
    102102header("X-Pingback: ".$_EP['url']."/xmlrpc"); 
    103103 
    104 if (strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], "gzip")){ 
     104if (strstr($_SERVER['HTTP_ACCEPT_ENCODING'], "gzip")){ 
    105105        $compress = true; 
    106106} else { 
     
    121121 
    122122$keyboom = explode(".",$parsedURL['path']); 
    123 if ($keyboom[1] && $filetypes[$keyboom[1]]){ 
     123if (isset($keyboom[1]) && $filetypes[$keyboom[1]]){ 
    124124        header("Content-Type: ".$filetypes[$keyboom[1]]); 
    125125} 
     
    149149                header("HTTP/1.1 304 Not Modified"); 
    150150        } elseif ($compress){ 
     151                        //die(finfo_file($_EP['cachedir']."/".$cachename)); 
    151152                        header("X-Compression: gzip"); 
    152153                        header("Content-Encoding: gzip"); 
     
    242243 
    243244if ($_SERVER['QUERY_STRING'] != ""){ 
    244         $query = explode( "&",$HTTP_SERVER_VARS['QUERY_STRING']); 
     245        $query = explode( "&",$_SERVER['QUERY_STRING']); 
    245246        $querypos = strpos($_SERVER['REQUEST_URI'], "?"); 
    246247        $wanted = explode("/",substr($wanted, 0 , $querypos)); 
     
    296297        array($wanted[0], "^rss", "/meta/all.rss"), 
    297298        array($wanted[0], "^favicon\.ico", "/assets/aq9/favicon.png"), 
    298         array($query[0], "id=(.*?)$", "/journal/id/[[1]]"), 
     299        array($query[0], "id=(.*)$", "/journal/id/[[1]]"), 
    299300        array($query[0], "^name=(.*)", "/article/name/[[1]]"), 
    300301        array($query[0], "^node=(.*)", "/article/id/[[1]]"), 
     
    312313 
    313314function doRedirects($redirects){ 
     315        global $_EP; 
     316 
    314317        global $page; 
    315318        $found = false; 
     
    362365doRedirects($forceRedirects); 
    363366 
    364 if ($override){ 
     367if (isset($override) && !empty($override)){ 
    365368        require("chapters/".$override.".inc.php"); 
    366369        $_EP['chapter'] = $override.".inc.php"; 
     
    373376        $page->debug[] = $db; 
    374377        $_EP['chapter'] = ""; 
    375 } elseif ($forward){ 
     378} elseif (isset($forward)){ 
    376379        // We're golden. 
    377380 
     
    402405 
    403406} else { 
    404         if (!doRedirects($redirects)){ 
     407        if (isset($_GET['id'])) { 
     408                header('location: /journal/id/'.$_GET['id']); 
     409                die(); 
     410        } elseif (!doRedirects($redirects)){ 
    405411                $page->debug[] = array(0, "Wanted-0 (".$wanted[0].") Unrecognised"); 
    406412                $page->status = 404; 
  • trunk/include/library.php

    r1 r2  
    681681function buildIndex($type,$display,$limit, $queryextras="", $order = "desc"){ 
    682682        global $page; 
     683 
     684 
    683685        $items = getIndex($type,$display,$limit, $queryextras, $order); 
    684686        $index = array(); 
     
    697699                } elseif ($group != $date){ 
    698700                        $group = $date; 
    699  
    700  
    701                         if ($array['display'] != "single"){ 
    702                                 $epoch = strtotime($group); 
    703  
    704                                 $blinks = getBlinkIndex(false, $epoch, $epoch + 86400); 
    705                                 if (is_array($blinks)){ 
    706                                         $groupOut .= "<div class=\"blinks\">"."<h3>That which is also for ".$group."</h3>"; 
    707                                         $links = array(); 
    708                                         foreach ($blinks as $row) { 
    709                                                 $linkText = $page->ulink(htmlentities($row['link']), $row['title'], $row['content']); 
    710                                                 if ($row['content']){ 
    711                                                         $linkText .=  " (".htmlentities($row['content']).")"; 
    712                                                 } 
    713                                                 if ($row['referrer']){ 
    714                                                         $linkText .=  " [".$page->ulink(htmlentities($row['referrer']), "via")."]"; 
    715                                                 } 
    716                                                 $links[] = $linkText; 
    717                                 } 
    718  
    719                                 $groupOut .= $page->buildlist($links,false,"plainlist blinks"); 
    720                                  
    721                                 $groupOut .= "</div>"; 
    722  
    723                                 } 
    724                         } 
    725701 
    726702                        $output .= $groupOut; 
     
    10651041 
    10661042function ep_decode($in){ 
     1043        $in = urldecode($in); 
    10671044        $translate = array ("_" => " ", "[and]" => "&", "[No.]" => "#"); 
    10681045        return strtr($in, $translate); 
     
    11421119        global $urls; 
    11431120 
    1144         if ($urls[$item."-".$id]){ 
     1121        if (isset($urls[$item."-".$id])){ 
    11451122                return $urls[$item."-".$id]; 
    11461123        } 
     
    13431320        $count = 0; 
    13441321        $return = array(); 
     1322 
     1323 
     1324        if(!is_array($type)){ 
     1325                $type = array($type); 
     1326        } 
    13451327 
    13461328        $dateformat = "%W, %M %D %Y"; // Date format for diary entry display 
     
    18521834function safequery($q, $panic=true, $database = false){ 
    18531835        global $_EP; 
     1836        if(!isset($_EP['sql'])){ 
     1837                $_EP['sql'] = 0; 
     1838        } 
    18541839        $_EP['sql']++; 
    1855         $_EP['sqllog'].=$q."\n"; 
     1840        //$_EP['sqllog'].=$q."\n"; 
    18561841        if ($database){ 
    18571842                $r =  mysql_query($q, $database); 
     
    20021987} 
    20031988 
    2004 function pageShowAds($time, $channel = false){ 
     1989function pageShowAds($time, $channel = false, $pageid = ''){ 
     1990 
     1991        global $_EP; 
     1992 
     1993        $out = ''; 
     1994 
     1995        $adfile = $_EP['webdir'].'/assets/adverts/'.$pageid; 
     1996        if(file_exists($adfile)){ 
     1997                $out .= '<h4>Adverts:</h4>'.file_get_contents($adfile); 
     1998        } 
    20051999 
    20062000        if ((time() - $time) > 7889231){// 3 months.  6 months - 15778463 
     
    20262020 
    20272021        $out .= "<a href=\"/journal/2004/02/12/Selling_Out\">Explain Ads</a>"; 
    2028         } else { 
    2029                 $out = ""; 
    2030         } 
     2022        }  
    20312023        return $out; 
    20322024} 
     
    23682360         
    23692361} 
     2362 
     2363function niceTime($from, $to = false, $shortform = false){ 
     2364 
     2365        if (!$to){ 
     2366                $to = time(); 
     2367        } 
     2368 
     2369        if ($from > $to){ 
     2370                $since = $from - $to; 
     2371        } else { 
     2372                $since = $to - $from; 
     2373        } 
     2374 
     2375        // 60 // minute 
     2376        // 3600 = hour 
     2377        // 86400 = day 
     2378        // 604800 = week 
     2379 
     2380        if ($shortform){ 
     2381                $units = array ('sec','min','hr','day','wk','yr'); 
     2382        } else { 
     2383                $units = array ('second','minute','hour','day','week','year'); 
     2384        } 
     2385 
     2386        if ($since < 60){ 
     2387                $date = $since; 
     2388                $unit = $units[0]; 
     2389 
     2390        } elseif ($since < 4000){ 
     2391                $date = round($since/60); 
     2392                $unit = $units[1]; 
     2393 
     2394        } elseif ($since < 82000){ 
     2395                $date = round($since/3600); 
     2396                $unit = $units[2]; 
     2397 
     2398        } elseif ($since < 603800){ 
     2399                $date = round($since/86400); 
     2400                $unit = $units[3]; 
     2401                $plus = " on ".date("jS M"); 
     2402 
     2403        } elseif ($since < 31440000){ 
     2404                $date = round($since/604800); 
     2405                $unit = $units[4]; 
     2406 
     2407        } else { 
     2408                $date = round($since/(604800 * 52)); 
     2409                #$date = " over a year"; 
     2410                $unit = $units[5]; 
     2411        } 
     2412 
     2413        if ($date == 1 || $unit == ""){ 
     2414                $date = $date." ".$unit; 
     2415        } else { 
     2416                $date = $date." ".$unit."s"; 
     2417        } 
     2418 
     2419        if (!$shortform){ 
     2420                $date .= " ago".$plus; 
     2421        } 
     2422 
     2423        #$date .= " (".$since.")"; 
     2424 
     2425        return $date; 
     2426} 
     2427