]> projects.mako.cc - scuttle/blobdiff - templates/bookmarks.tpl.php
updated readme with information on a series of bugs I know exist
[scuttle] / templates / bookmarks.tpl.php
index c79655ea229d87fb2c6e2ed31423275583beaf19..743a7c25a22b8deccd9b7fa3bc48412b6ce8c5dd 100644 (file)
@@ -1,10 +1,22 @@
 <?php
-$userservice     =& ServiceFactory::getServiceInstance('UserService');
-$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
+$sf = new ServiceFactory();
+$userservice     =& $sf->getServiceInstance('UserService');
+$bookmarkservice =& $sf->getServiceInstance('BookmarkService');
 
 $logged_on_userid = $userservice->getCurrentUserId();
 $this->includeTemplate($GLOBALS['top_include']);
 
+# define variables
+if (!isset($currenttag)) {
+    $currenttag = NULL;
+}
+if (!isset($user)) {
+    $user = NULL;
+}
+if (!isset($userid)) {
+    $userid = NULL;
+}
+
 include 'search.inc.php';
 if (count($bookmarks) > 0) {
 ?>
@@ -89,6 +101,12 @@ if (count($bookmarks) > 0) {
 
         $address = filter($row['bAddress']);
         
+        // Internet Archive WayBack Links
+        $archive_link = '';
+        if ($GLOBALS["archive_links"]) { 
+            $archive_link = ' - <a href="' . $GLOBALS['archive_base_url'] . "/" . date("YmdHis", strtotime($row['bDatetime'])) . "/" . $address . '">' . T_('Archived Link') . '</a>';
+        }
+        
         // Redirection option
         if ($GLOBALS['useredir']) {
             $address = $GLOBALS['url_redir'] . $address;
@@ -100,7 +118,11 @@ if (count($bookmarks) > 0) {
         if ($row['bDescription'] != '') {
             echo '<div class="description">'. filter($row['bDescription']) ."</div>\n";
         }
-        echo '<div class="meta">'. date($GLOBALS['shortdate'], strtotime($row['bDatetime'])) . $cats . $copy . $edit ."</div>\n";
+        if ($row['bDatetime'] == $row['bModified']) {
+            echo '<div class="meta">'. date($GLOBALS['shortdate'], strtotime($row['bDatetime'])) . $cats . $copy . $edit . $archive_link ."</div>\n";
+        } else {
+            echo '<div class="meta"><span id="date-updated">updated: '. date($GLOBALS['shortdate'], strtotime($row['bModified'])) . '</span>, <span id="date-original">original: '. date($GLOBALS['shortdate'], strtotime($row['bDatetime'])) . "</span>" . $cats . $copy . $edit . $archive_link ."</div>\n";
+        }
         echo "</li>\n";
     }
     ?>

Benjamin Mako Hill || Want to submit a patch?