<?php
/*
* Free IT Foundation
* Free Technology Serving Knowledge
* http://www.free-it-foundation.org
*
* This file is part of Knowledge Box.
*
* Knowledge Box is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Knowledge Box is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Knowledge Box. If not, see <http://www.gnu.org/licenses/>.
*/
// session
session_start ();
// base
if (!isset ($_SESSION [KBEV_SETTINGS_BASE]))
$_SESSION [KBEV_SETTINGS_BASE] = 1;
if (isset ($_GET ['kbid'])) {
$_SESSION [KBEV_SETTINGS_BASE] = (int) $_GET ['kbid'];
$_SESSION [KBEV_SESSION_EXECUTE] = false;
} else {
// is in search?
if (!isset ($_SESSION [KBEV_SESSION_EXECUTE]))
$_SESSION [KBEV_SESSION_EXECUTE] = false;
}
define ('KBEV_EXECUTE_SEARCH', (boolean) $_SESSION [KBEV_SESSION_EXECUTE]);
// search keywords
if (!isset ($_SESSION [KBEV_SEARCH_KEYWORDS]))
$_SESSION [KBEV_SEARCH_KEYWORDS] = array ();
// search text
if (!isset ($_SESSION [KBEV_SEARCH_TEXT]))
$_SESSION [KBEV_SEARCH_TEXT] = '';
// search field
if (!isset ($_SESSION [KBEV_SEARCH_FIELD]))
$_SESSION [KBEV_SEARCH_FIELD] = '';
// search sort field & direction
if (!isset ($_SESSION [KB_SEARCH_SORT_FIELD]))
$_SESSION [KB_SEARCH_SORT_FIELD] = '';
if (isset ($_GET ['sort']))
$_SESSION [KB_SEARCH_SORT_FIELD] = (int) $_GET ['sort'];
if (!isset ($_SESSION [KB_SEARCH_SORT_DIR]))
$_SESSION [KB_SEARCH_SORT_DIR] = '';
if (isset ($_GET ['dir']))
$_SESSION [KB_SEARCH_SORT_DIR] = $_GET ['dir'];
// search index
if (!isset ($_SESSION [KBEV_SEARCH_INDEX]))
$_SESSION [KBEV_SEARCH_INDEX] = 0;
if (isset ($_GET ['inx']))
$_SESSION [KBEV_SEARCH_INDEX] = (int) $_GET ['inx'];
// lang
if (!isset ($_SESSION [KBEV_SETTINGS_LANG]))
$_SESSION [KBEV_SETTINGS_LANG] = 'en';
if (isset ($_GET ['lang']))
$_SESSION [KBEV_SETTINGS_LANG] = (string) $_GET ['lang'];
// define settings
define ('KBEV_BASE', $_SESSION [KBEV_SETTINGS_BASE]);
define ('KBEV_LANG', $_SESSION [KBEV_SETTINGS_LANG]);
?>