00001 <?PHP
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 $page_author = "Dan Jensen";
00018 $page_author_email = "admin@NOSPAMleinir.dk";
00019 $page_menu = 100;
00020 $page_date = formatTime( time() );
00021 $page_title = i18n("Recent Updates");
00022
00023 function renderUpdates()
00024 {
00025 global $subscriptions;
00026 if( count( $subscriptions->updates ) > 0 )
00027 {
00028 $firstTime = "";
00029 $thisTime = "";
00030 $entriesPerPage = 20;
00031 $currentpage = $_GET["currentpage"];
00032 $lowerBound = $currentpage * $entriesPerPage;
00033 $upperBound = ($currentpage + 1) * $entriesPerPage;
00034 $position = 0;
00035
00036 $rendered .= "
00037 <dl class=\"updates\">";
00038 krsort($subscriptions->updates);
00039 foreach( $subscriptions->updates as $key => $value )
00040 {
00041 if( !userAllows( $value["owner"], $value["viewLevel"] ) )
00042 continue;
00043 if( $position >= $upperBound )
00044 break;
00045 if( $position >= $lowerBound )
00046 {
00047 $oldTime = $thisTime;
00048 $thisTime = date("Y-m-d" ,$value["timestamp"]);
00049 if($oldTime != $thisTime)
00050 $rendered .= "$firstTime<div class=\"updates_date\">$thisTime</div><dl class=\"updates\">";
00051
00052 $thumbData = getGlobalIDThumbnail( $value["globalID"] );
00053
00054 $authorAndTime = i18n( "By ##0## on ##1##", array( parse_profilelinks( "%%" . $value["owner"] . "%%" ), formatTime( $value["timestamp"] ) ) );
00055 $thumbnailURI = getGlobalIDThumbnail($value["globalID"]);
00056 $rendered .= "
00057 <a href=\"" . globalIDtoURL( $value["globalID"] ) . "\"><img class=\"updates_thumbnail\" src=\"" . $thumbData["uri"] . "\" width=\"" . $thumbData["width"] . "\" height=\"" . $thumbData["height"] . "\" alt=\"" . $value["subject"] . "\" /></a>
00058 <dt class=\"updates\"><a href=\"" . globalIDtoURL( $value["globalID"] ) . "\">" . $value["subject"] . "</a></dt>
00059 <dd class=\"updates\"><div class=\"updates_message\">" . parse_page_data( $value["message"] ) . "</div><div class=\"updates_authorandtime\">" . $authorAndTime . "</div></dd>";
00060 $firstTime = "</dl>";
00061 }
00062 $position++;
00063 }
00064 $rendered .= "
00065 </dl>";
00066
00067 $navigator = renderNavigator(count($subscriptions->updates), $currentpage, $lowerBound, $upperBound, $entriesPerPage);
00068
00069 $rendered = $navigator . $rendered . $navigator;
00070 }
00071 else
00072 $rendered = renderInformationBox( i18n("No updates"), i18n("Sorry, there are currently no updates to show you - please wait for someone to upload images to a gallery, a document to documents, an entry in a discussion, or make a comment.") );
00073
00074 return $rendered;
00075 }
00076
00077 $page_content = renderUpdates();
00078 ?>