-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.php
54 lines (49 loc) · 4.01 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
###############################################################################
# my little forum #
# Copyright (C) 2004-2008 Alex #
# http://www.mylittlehomepage.net/ #
# Copyright (C) 2009-2019 H. August #
# https://www.projekt-mlf.de/ #
# #
# This program 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 2 #
# of the License, or (at your option) any later version. #
# #
# This program 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 this program; if not, write to the Free Software #
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #
###############################################################################
include("inc.php");
if (!isset($_SESSION[$settings['session_prefix'].'user_id']) && isset($_COOKIE['auto_login']) && isset($settings['autologin']) && $settings['autologin'] == 1) {
header("location: login.php?referer=index.php");
die('<a href="login.php?referer=index.php">further...</a>');
}
$qs = (isset($_GET['category'])) ? "?category=". intval($_GET['category']) : "";
if (isset($_GET['update']) && isset($_SESSION[$settings['session_prefix'].'newtime'])) {
$_SESSION[$settings['session_prefix'].'newtime'] = time();
$update_result = mysqli_query($connid, "UPDATE ". $db_settings['userdata_table'] ." SET last_login=last_login, last_logout=NOW(), registered=registered WHERE user_id=". intval($_SESSION[$settings['session_prefix'].'user_id']));
if (empty($_GET['view'])) { header("location: forum.php".$qs); die('<a href="forum.php'. $qs .'">further...</a>'); }
else if (isset($_GET['view']) && $_GET['view']=="board") { header("location: board.php".$qs); die('<a href="board.php'. $qs .'">further...</a>'); }
else if (isset($_GET['view']) && $_GET['view']=="mix") { header("location: mix.php".$qs); die('<a href="mix.php'. $qs .'">further...</a>'); }
}
if (isset($_SESSION[$settings['session_prefix'].'user_view'])) {
if ($_SESSION[$settings['session_prefix'].'user_view'] == "board") { header("location: board.php".$qs); die('<a href="board.php'. $qs .'">further...</a>'); }
else if ($_SESSION[$settings['session_prefix'].'user_view'] == "mix") { header("location: mix.php".$qs); die('<a href="mix.php'. $qs .'">further...</a>'); }
else { header("location: forum.php".$qs); die('<a href="forum.php'. $qs .'">further...</a>'); }
} else if (isset($_COOKIE['user_view'])) {
if ($_COOKIE['user_view'] == "board") { header("location: board.php".$qs); die('<a href="board.php'. $qs .'">further...</a>'); }
else if ($_COOKIE['user_view'] == "mix") { header("location: mix.php".$qs); die('<a href="mix.php'. $qs .'">further...</a>'); }
else { header("location: forum.php".$qs); die('<a href="forum.php'. $qs .'">further...</a>'); }
} else {
if ($settings['standard'] == "board") { header("location: board.php".$qs); die('<a href="board.php'. $qs .'">further...</a>'); }
else if ($settings['standard'] == "mix") { header("location: mix.php".$qs); die('<a href="mix.php'. $qs .'">further...</a>'); }
else { header("location: forum.php".$qs); die('<a href="forum.php'. $qs .'">further...</a>'); }
}
?>