]> projects.mako.cc - scuttle/blobdiff - templates/bookmarks.tpl.php
updated scuttle to add archive.org wayback links
[scuttle] / templates / bookmarks.tpl.php
index ab35787766c1a9c1b7ba7e89ff6b0c2e4a67ab8d..fa40561b56c47e42873a44612741336ff2beeb8f 100644 (file)
@@ -10,16 +10,12 @@ if (count($bookmarks) > 0) {
 ?>
 
 <p id="sort">
-    <?php echo T_("Sort by:"); ?>
-    <a href="?sort=date_desc"><?php echo T_("Date"); ?></a><span> / </span>
-    <a href="?sort=title_asc"><?php echo T_("Title"); ?></a><span> / </span>
-    <?php
-    if (!isset($hash)) {
-    ?>
+  <?php echo T_("Sort by:"); ?>
+  <a href="?sort=date_desc"><?php echo T_("Date"); ?></a><span> / </span>
+  <a href="?sort=title_asc"><?php echo T_("Title"); ?></a><span> / </span>
+  <?php if (!isset($hash)): ?>
     <a href="?sort=url_asc"><?php echo T_("URL"); ?></a>
-    <?php
-    }
-    ?>
+  <?php endif; ?>
 </p>
 <ol<?php echo ($start > 0 ? ' start="'. ++$start .'"' : ''); ?> id="bookmarks">
 
@@ -93,6 +89,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;
@@ -104,7 +106,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?