<?php // Note: This file is included from the extensions/IpHistory.php file in the IpHistory control. echo '<h2>' . $this->Context->GetDefinition('IpHistory') . '</h2> <ul>'; // Loop through the user's ip history $SharedCount = 0; $HistoryCount = count($this->History); if ($HistoryCount > 0) { $i = 0; for ($i = 0; $i < $HistoryCount; $i++) { $SharedCount = count($this->History[$i]['SharedWith']); echo '<li> <h3> ' . $this->History[$i]['IP'] . ' <small>(' . str_replace('//1', $this->History[$i]['UsageCount'], $this->Context->GetDefinition(FormatPlural($this->History[$i]['UsageCount'], 'XTime', 'XTimes'))) . ')</small> </h3>'; if ($SharedCount > 0) { echo '<p class="Info"> ' . $this->Context->GetDefinition('IpAlsoUsedBy') . ' </p> <p class="Note">'; for ($j = 0; $j < $SharedCount; $j++) { $SharedUserName = $this->History[$i]['SharedWith'][$j]['Name']; $SharedUserID = $this->History[$i]['SharedWith'][$j]['UserID']; if ($j > 0) { echo ', '; } echo '<a href="' . GetUrl($this->Context->Configuration, 'account.php', '', 'u', $SharedUserID) . '">' . $SharedUserName . '</a>'; } echo '</p>';
} } echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en-ca\">\r\n<head>\r\n<title>Lussumo Thumbnailer</title>\r\n<link rel=\"stylesheet\" type=\"text/css\" href=\"" . $tn->StyleUrl . "\" />\r\n<script language=\"Javascript\" type=\"text/javascript\">\r\n\t//<![CDATA[\r\n function CheckController(formName, controller, controlled) {\r\n var frm = document[formName];\r\n var CheckedStatus = controller.checked;\r\n if (frm[controlled]) {\r\n if (frm[controlled].length) {\r\n for (i = 0; i < frm[controlled].length; i++) {\r\n frm[controlled][i].checked = CheckedStatus;\r\n }\r\n } else {\r\n frm[controlled].checked = CheckedStatus;\r\n }\r\n }\r\n }\r\n\t//]]>\r\n</script>\r\n</head>\r\n<body>"; if ($PageAction == "Generate") { $p = new Parameters(); $ExcludeByPrefix = "ImageID"; $p->DefineCollection($_GET, $ExcludeByPrefix, 0, 1); $p->DefineCollection($_POST, $ExcludeByPrefix, 0, 1); $p->Set("PageAction", "Generate"); $p->Remove("btnSubmit"); echo "<form name=\"frmThumbnailer\" method=\"get\" action=\"" . $tn->SelfUrl . "\">" . $p->GetHiddenInputs(); $ImagesLeft = count($ImagesLeftToThumbnail); for ($i = 0; $i < $ImagesLeft; $i++) { echo "<input type=\"hidden\" name=\"ImageID[]\" value=\"" . $ImagesLeftToThumbnail[$i] . "\" />"; } echo "</form><script language=\"Javascript\">\r\n setTimeout(\"document.frmThumbnailer.submit();\",300);\r\n </script>\r\n <h1>Lussumo Thumbnailer</h1>\r\n <a class=\"BackToFilebrowser\" href=\"./index.php\">Back to Filebrowser</a>\r\n <div class=\"Introduction\">\r\n Processing thumbnail batch\r\n <br /><a href=\"#\" onclick=\"document.frmThumbnailer.submit();\">" . FormatPlural($ImagesLeft, "item", "items") . " remaining in batch...</a>\r\n </div>"; } elseif ($PageAction == "Complete") { echo "<h1>Lussumo Thumbnailer</h1>\r\n <a class=\"BackToFilebrowser\" href=\"./index.php\">Back to Filebrowser</a>\r\n <div class=\"Introduction\">\r\n Batch Process Completed Successfully.\r\n <br /><a href=\"" . $tn->SelfUrl . ($DirectoryID != "" ? "?did=" . $DirectoryID : "") . "\">Click here to continue</a>\r\n </div>"; } else { echo "<h1>Lussumo Thumbnailer</h1>\r\n <a class=\"BackToFilebrowser\" href=\"./index.php" . ($DirectoryID != "" ? "?did=" . $DirectoryID : "") . "\">Back to Filebrowser</a>\r\n <div class=\"Introduction\">\r\n <strong>This is the Lussumo Thumbnailer.</strong>\r\n <br />You can use this application to create thumbnail images for your Lussumo Filebrowser.\r\n <br /><br />Choose the images for which you would like to create thumbnails and click the \"Generate Thumbnails\" button.\r\n </div>\r\n <div class=\"Body\">\r\n " . $tn->FolderList; if ($tn->FileList == "") { echo "<div class=\"Container Thumbnailed\">\r\n <h2>No Images Found</h2>\r\n <p>There were no thumbnail candidate images found in the selected folder.</p>\r\n </div>"; } else { echo $tn->FileList; } echo "</div>"; } echo "<div class=\"Foot\">\r\n <div class=\"ApplicationInformation\"><a href=\"http://lussumo.com\">Lussumo</a> <a href=\"http://thefilebrowser.com\">Filebrowser</a> © " . $tn->Date . "</div>\r\n <div class=\"DeveloperInformation\">Developed by " . $tn->Developer . "</div>\r\n</div>\r\n </body>\r\n</html>"; ?>
function AddBookmarksToPanel(&$Context, &$Panel, &$DiscussionManager, $OptionalDiscussionID = "0") { if ($Context->Session->User->Setting("ShowBookmarks")) { $sReturn = ""; $UserBookmarks = $DiscussionManager->GetBookmarkedDiscussionsByUserID($Context->Session->UserID, agPANEL_BOOKMARK_COUNT, $OptionalDiscussionID); $Count = $Context->Database->RowCount($UserBookmarks); $OtherBookmarksExist = 0; $ThisDiscussionIsBookmarked = 0; if ($Count > 0) { $Discussion = $Context->ObjectFactory->NewObject($Context, "Discussion"); while ($Row = $Context->Database->GetRow($UserBookmarks)) { $Discussion->Clear(); $Discussion->GetPropertiesFromDataSet($Row); $Discussion->FormatPropertiesForDisplay(); if ($Discussion->DiscussionID != $OptionalDiscussionID) { $OtherBookmarksExist = 1; } if ($Discussion->DiscussionID == $OptionalDiscussionID && $Discussion->Bookmarked) { $ThisDiscussionIsBookmarked = 1; } $sReturn .= "<li id=\"Bookmark_" . $Discussion->DiscussionID . "\"" . ($Discussion->DiscussionID == $OptionalDiscussionID && !$Discussion->Bookmarked ? " style=\"display: none;\"" : "") . "><a class=\"PanelLink\" href=\"comments.php?DiscussionID=" . $Discussion->DiscussionID . "\">" . $Discussion->Name . "</a>"; if ($Discussion->NewComments > 0) { $sReturn .= " <small><strong>" . FormatPlural($Discussion->NewComments, "new comment", "new comments") . "</strong></small>"; } $sReturn .= "</li>"; } $sReturn = "<h2 id=\"BookmarkTitle\"" . ($OtherBookmarksExist || $ThisDiscussionIsBookmarked ? "" : " style=\"display: none;\"") . ">" . $Context->GetDefinition("Bookmarks") . "</h2>\r\n\t\t\t<ul class=\"LinkedList\" id=\"BookmarkList\"" . ($OtherBookmarksExist || $ThisDiscussionIsBookmarked ? "" : " style=\"display: none;\"") . ">" . $sReturn . "</ul>"; } $sReturn .= "<form name=\"frmBookmark\" action=\"\"><input type=\"hidden\" name=\"OtherBookmarksExist\" value=\"" . $OtherBookmarksExist . "\" /></form>"; if ($Count >= agPANEL_BOOKMARK_COUNT) { $sReturn .= "<div class=\"LinkedListFootNote\"><a href=\"./?View=YourBookmarks\">" . $Context->GetDefinition("ViewAll") . "</a></div>"; } $Panel->AddString($sReturn); } else { $Panel->AddString("<form name=\"frmBookmark\" action=\"\"><input type=\"hidden\" name=\"OtherBookmarksExist\" value=\"1\" /></form>"); } }
function TimeDiff($Time, $TimeToCompare = "") { if ($TimeToCompare == "") { $TimeToCompare = time(); } $Difference = $TimeToCompare - $Time; $Days = floor($Difference / 60 / 60 / 24); $Difference -= $Days * 60 * 60 * 24; $Hours = floor($Difference / 60 / 60); $Difference -= $Hours * 60 * 60; $Minutes = floor($Difference / 60); $Difference -= $Minutes * 60; $Seconds = $Difference; if ($Days > 7) { return date("M jS Y", $Time); } elseif ($Days > 0) { return FormatPlural($Days, "day ago", "days ago"); } elseif ($Hours > 0) { return FormatPlural($Hours, "hour ago", "hours ago"); } elseif ($Minutes > 0) { return FormatPlural($Minutes, "minute ago", "minutes ago"); } else { return FormatPlural($Seconds, "second ago", "seconds ago"); } }
function Render() { $this->Stop = $this->DetailedTimestamp(); $ExecutionTime = ForceFloat((double) $this->Stop - (double) $this->Start, 0, 4); $this->Context->Writer->Write("<div class=\"Timer\">The page was delivered in " . FormatPlural($ExecutionTime, "seconds", "seconds") . "</div>"); }
function Render() { if ($this->History && $this->PostBackAction == "") { $this->Context->Writer->Add("<div class=\"IpHistory\">\r\n\t\t\t\t<h1>" . $this->Context->GetDefinition("IpHistory") . "</h1>"); // Loop through the user's ip history $SharedCount = 0; $HistoryCount = count($this->History); if ($HistoryCount > 0) { for ($i = 0; $i < $HistoryCount; $i++) { $SharedCount = count($this->History[$i]["SharedWith"]); $this->Context->Writer->Add("<blockquote>\r\n\t\t\t\t\t\t\t<h2>" . $this->History[$i]["IP"] . "</h2>\r\n\t\t\t\t\t\t\t<small>(" . FormatPlural($this->History[$i]["UsageCount"], $this->Context->GetDefinition("time"), $this->Context->GetDefinition("times")) . ")</small>"); if ($SharedCount > 0) { $this->Context->Writer->Add("<h3>" . $this->Context->GetDefinition("IpAlsoUsedBy") . "</h3>\r\n\t\t\t\t\t\t\t\t<p>"); for ($j = 0; $j < $SharedCount; $j++) { $SharedUserName = $this->History[$i]["SharedWith"][$j]["Name"]; $SharedUserID = $this->History[$i]["SharedWith"][$j]["UserID"]; if ($j > 0) { $this->Context->Writer->Add(", "); } $this->Context->Writer->Add("<a href=\"account.php?u=" . $SharedUserID . "\">" . $SharedUserName . "</a>"); } $this->Context->Writer->Add("</p>"); } else { $this->Context->Writer->Add("<h3>" . $this->Context->GetDefinition("IpNotShared") . "</h3>"); } $this->Context->Writer->Add("</blockquote>"); } } else { $this->Context->Writer->Add("<blockquote>" . $this->Context->GetDefinition("NoIps") . "</blockquote>"); } $this->Context->Writer->Write("</div>"); } }