Minor refactoring
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@171 b3834d28-1941-0410-a4f8-b48e95affb8f
This commit is contained in:
parent
9d22fdc36f
commit
49dec69230
3 changed files with 31 additions and 8 deletions
12
.htaccess
12
.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)
|
# (see $cleanurls in config.inc.php)
|
||||||
|
#####################################
|
||||||
|
|
||||||
#Options +FollowSymlinks
|
#Options +FollowSymlinks
|
||||||
#RewriteEngine On
|
#RewriteEngine On
|
||||||
|
@ -30,3 +32,11 @@ RewriteRule ^([^/]+)/?(.*) $1.php?query=$2 [L,QSA] #option 1
|
||||||
#RewriteRule ^([^/]+)/?(.*) $1.php/$2 [L] #option 2
|
#RewriteRule ^([^/]+)/?(.*) $1.php/$2 [L] #option 2
|
||||||
|
|
||||||
</IfModule>
|
</IfModule>
|
||||||
|
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
# This second part is used to speed-up the application
|
||||||
|
#####################################
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
19
index.php
19
index.php
|
@ -21,19 +21,28 @@
|
||||||
|
|
||||||
require_once('header.inc.php');
|
require_once('header.inc.php');
|
||||||
|
|
||||||
|
|
||||||
|
/* Service creation: only useful services are created */
|
||||||
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
|
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
|
||||||
$templateservice =& ServiceFactory::getServiceInstance('TemplateService');
|
$templateservice =& ServiceFactory::getServiceInstance('TemplateService');
|
||||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||||
$cacheservice =& ServiceFactory::getServiceInstance('CacheService');
|
$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();
|
$tplvars = array();
|
||||||
if (isset($_GET['action'])){
|
if (GET_ACTION == "logout") {
|
||||||
if ($_GET['action'] == "logout") {
|
|
||||||
$userservice->logout();
|
$userservice->logout();
|
||||||
$tplvars['msg'] = T_('You have now logged out');
|
$tplvars['msg'] = T_('You have now logged out');
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Header variables
|
// Header variables
|
||||||
$tplVars['loadjs'] = true;
|
$tplVars['loadjs'] = true;
|
||||||
$tplVars['rsschannels'] = array(
|
$tplVars['rsschannels'] = array(
|
||||||
|
@ -54,8 +63,8 @@ if ($usecache) {
|
||||||
|
|
||||||
// Pagination
|
// Pagination
|
||||||
$perpage = getPerPageCount();
|
$perpage = getPerPageCount();
|
||||||
if (isset($_GET['page']) && intval($_GET['page']) > 1) {
|
if (intval(GET_PAGE) > 1) {
|
||||||
$page = $_GET['page'];
|
$page = GET_PAGE;
|
||||||
$start = ($page - 1) * $perpage;
|
$start = ($page - 1) * $perpage;
|
||||||
} else {
|
} else {
|
||||||
$page = 0;
|
$page = 0;
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/* Service creation: only useful services are created */
|
||||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||||
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
|
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
|
||||||
$tagservice =& ServiceFactory::getServiceInstance('TagService');
|
$tagservice =& ServiceFactory::getServiceInstance('TagService');
|
||||||
$cdservice =& ServiceFactory::getServiceInstance('CommonDescriptionService');
|
$cdservice =& ServiceFactory::getServiceInstance('CommonDescriptionService');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$logged_on_userid = $userservice->getCurrentUserId();
|
$logged_on_userid = $userservice->getCurrentUserId();
|
||||||
$currentUser = $userservice->getCurrentUser();
|
$currentUser = $userservice->getCurrentUser();
|
||||||
$currentUsername = $currentUser[$userservice->getFieldName('username')];
|
$currentUsername = $currentUser[$userservice->getFieldName('username')];
|
||||||
|
|
Loading…
Reference in a new issue