]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
Minor refactoring
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>
Fri, 21 Nov 2008 17:25:23 +0000 (17:25 +0000)
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>
Fri, 21 Nov 2008 17:25:23 +0000 (17:25 +0000)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@171 b3834d28-1941-0410-a4f8-b48e95affb8f

.htaccess
index.php
templates/bookmarks.tpl.php

index 03aea7edf3894150a3c3dd110f69675a92302eec..cfe39b9529cd59880b418918a05b8c8d9b587fa1 100644 (file)
--- a/.htaccess
+++ b/.htaccess
@@ -1,5 +1,7 @@
-# this file is used if you configure your scuttle for nice urls
+#####################################
+# the first part of this file is used if you configure your scuttle for nice urls
 # (see $cleanurls in config.inc.php)
+#####################################
 
 #Options +FollowSymlinks
 #RewriteEngine On
@@ -30,3 +32,11 @@ RewriteRule ^([^/]+)/?(.*) $1.php?query=$2 [L,QSA]        #option 1
 #RewriteRule ^([^/]+)/?(.*)       $1.php/$2       [L]     #option 2
 
 </IfModule>
+
+
+#####################################
+# This second part is used to speed-up the application
+#####################################
+
+
+
index d98006f4a1fa9ee141938a07f73da467eaa9fd4f..a72f1f9da8a79d92074753c46240fea83b1123ac 100644 (file)
--- a/index.php
+++ b/index.php
 
 require_once('header.inc.php');
 
+
+/* Service creation: only useful services are created */
 $bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
 $templateservice =& ServiceFactory::getServiceInstance('TemplateService');
 $userservice =& ServiceFactory::getServiceInstance('UserService');
 $cacheservice =& ServiceFactory::getServiceInstance('CacheService');
 
+/* Managing possible inputs */
+isset($_GET['action']) ? define('GET_ACTION', $_GET['action']): define('GET_ACTION', '');
+isset($_GET['page']) ? define('GET_PAGE', $_GET['page']): define('GET_PAGE', 0);
+isset($_GET['sort']) ? define('GET_SORT', $_GET['sort']): define('GET_SORT', '');
+//isset($_GET['popup']) ? define('GET_POPUP', $_GET['popup']): define('GET_SORT', '');
+
+
+// Logout action
 $tplvars = array();
-if (isset($_GET['action'])){
-       if ($_GET['action'] == "logout") {
-               $userservice->logout();
-               $tplvars['msg'] = T_('You have now logged out');
-       }
+if (GET_ACTION == "logout") {
+       $userservice->logout();
+       $tplvars['msg'] = T_('You have now logged out');
 }
 
+
 // Header variables
 $tplVars['loadjs'] = true;
 $tplVars['rsschannels'] = array(
@@ -54,8 +63,8 @@ if ($usecache) {
 
 // Pagination
 $perpage = getPerPageCount();
-if (isset($_GET['page']) && intval($_GET['page']) > 1) {
-       $page = $_GET['page'];
+if (intval(GET_PAGE) > 1) {
+       $page = GET_PAGE;
        $start = ($page - 1) * $perpage;
 } else {
        $page = 0;
index 5567d7b3b027179b574e30477e1673b03f8c1a49..e95f787f5b46eda0adbebd4e14e4acddb8e4dda0 100644 (file)
@@ -1,9 +1,13 @@
 <?php
+
+/* Service creation: only useful services are created */
 $userservice =& ServiceFactory::getServiceInstance('UserService');
 $bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
 $tagservice =& ServiceFactory::getServiceInstance('TagService');
 $cdservice =& ServiceFactory::getServiceInstance('CommonDescriptionService');
 
+
+
 $logged_on_userid = $userservice->getCurrentUserId();
 $currentUser = $userservice->getCurrentUser();
 $currentUsername = $currentUser[$userservice->getFieldName('username')];