Merge branch 'extended-cookie'
[scuttle] / index.php
index f89e64ead537ea543dc5f674c64d12a7200e437b..2a9d8aba01f1b95d35c6a520e6596ad760b401b3 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1,7 +1,6 @@
 <?php
 /***************************************************************************
-Copyright (c) 2004 - 2006 Scuttle project
-http://sourceforge.net/projects/scuttle/
+Copyright (c) 2004 - 2010 Marcus Campbell
 http://scuttle.org/
 
 This program is free software; you can redistribute it and/or modify
@@ -19,18 +18,16 @@ along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 ***************************************************************************/
 
-require_once('header.inc.php');
+require_once 'header.inc.php';
 $bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
 $templateservice =& ServiceFactory::getServiceInstance('TemplateService');
-$userservice =& ServiceFactory::getServiceInstance('UserService');
-$cacheservice =& ServiceFactory::getServiceInstance('CacheService');
+$userservice     =& ServiceFactory::getServiceInstance('UserService');
+$cacheservice    =& ServiceFactory::getServiceInstance('CacheService');
 
 $tplvars = array();
-if (isset($_GET['action'])){
-    if ($_GET['action'] == "logout") {
-        $userservice->logout($path);
-        $tplvars['msg'] = T_('You have now logged out');
-    }
+if (isset($_GET['action']) && 'logout' == $_GET['action']) {
+  $userservice->logout($path);
+  $tplvars['msg'] = T_('You have now logged out');
 }
 
 // Header variables
@@ -53,26 +50,16 @@ if ($usecache) {
 
 // Pagination
 $perpage = getPerPageCount();
-if (isset($_GET['page']) && intval($_GET['page']) > 1) {
-    $page = $_GET['page'];
-    $start = ($page - 1) * $perpage;
-} else {
-    $page = 0;
-    $start = 0;
-}
-
-$dtend = date('Y-m-d H:i:s', strtotime('tomorrow'));
-$dtstart = date('Y-m-d H:i:s', strtotime($dtend .' -'. $defaultRecentDays .' days'));
 
-$tplVars['page'] = $page;
-$tplVars['start'] = $start;
+$tplVars['page']     = 0;
+$tplVars['start']    = 0;
 $tplVars['popCount'] = 30;
 $tplVars['sidebar_blocks'] = array('recent');
 $tplVars['range'] = 'all';
 $tplVars['pagetitle'] = T_('Store, share and tag your favourite links');
 $tplVars['subtitle'] = T_('Recent Bookmarks');
-$tplVars['bookmarkCount'] = $start + 1;
-$bookmarks =& $bookmarkservice->getBookmarks($start, $perpage, NULL, NULL, NULL, getSortOrder(), NULL, $dtstart, $dtend);
+$tplVars['bookmarkCount'] = 1;
+$bookmarks =& $bookmarkservice->getBookmarks(0, $perpage, NULL, NULL, NULL, getSortOrder(), NULL);
 $tplVars['total'] = $bookmarks['total'];
 $tplVars['bookmarks'] =& $bookmarks['bookmarks'];
 $tplVars['cat_url'] = createURL('tags', '%2$s');
@@ -84,4 +71,3 @@ if ($usecache) {
     // Cache output if existing copy has expired
     $cacheservice->End($hash);
 }
-?>
\ No newline at end of file

Benjamin Mako Hill || Want to submit a patch?