Codechange: Klassen im Tabellenkopf eingefügt und via CSS dazugehörige Breitenangaben...
[wmmkf.git] / index.php
blob7089de91a4b57bd3bfed7e839f2a5624a7cba36c
1 <?php
2 ###############################################################################
3 # my little forum #
4 # Copyright (C) 2004 Alex #
5 # http://www.mylittlehomepage.net/ #
6 # #
7 # This program is free software; you can redistribute it and/or #
8 # modify it under the terms of the GNU General Public License #
9 # as published by the Free Software Foundation; either version 2 #
10 # of the License, or (at your option) any later version. #
11 # #
12 # This program is distributed in the hope that it will be useful, #
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15 # GNU General Public License for more details. #
17 # You should have received a copy of the GNU General Public License #
18 # along with this program; if not, write to the Free Software #
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #
20 ###############################################################################
22 include("inc.php");
24 if (!isset($_SESSION[$settings['session_prefix'].'user_id'])
25 && isset($_COOKIE['auto_login'])
26 && (isset($settings['autologin'])
27 && $settings['autologin'] == 1))
29 header("location: ". $settings['forum_address'] ."login.php?referer=index.php");
30 die('<a href="login.php?referer=index.php">further...</a>');
33 if (!empty($_SESSION[$settings['session_prefix'].'category'])
34 and $_SESSION[$settings['session_prefix'].'category'] > 0)
36 $qstrg[] = 'category='. intval($_SESSION[$settings['session_prefix'].'category']);
38 else if (!empty($_GET['category'])
39 and intval($_GET['category']) > 0)
41 $qstrg[] = 'category='. intval($_GET['category']);
43 if (!empty($_SESSION[$settings['session_prefix'].'page'])
44 and $_SESSION[$settings['session_prefix'].'page'] > 0)
46 $qstrg[] = 'page='. $_SESSION[$settings['session_prefix'].'page'];
48 else if (!empty($_GET['page'])
49 and intval($_GET['page']) > 0)
51 $qstrg[] = 'page='. intval($_GET['page']);
53 $qs = (!empty($qstrg) and is_array($qstrg)) ? '?'. implode('&', $qstrg) : '';
54 $qsl = (!empty($qstrg) and is_array($qstrg)) ? '?'. implode('&amp;', $qstrg) : '';
56 if (isset($_GET['update'])
57 && intval($_GET['update']) == 1
58 && isset($_SESSION[$settings['session_prefix'].'newtime']))
60 $_SESSION[$settings['session_prefix'].'newtime'] = time();
61 $update_result = mysql_query("UPDATE ".$db_settings['userdata_table']." SET last_login=last_login, last_logout=NOW(), registered=registered WHERE user_id='".$_SESSION[$settings['session_prefix'].'user_id']."'", $connid);
62 if (!empty($_SESSION[$settings['session_prefix'].'curr_view'])
63 and in_array($_SESSION[$settings['session_prefix'].'curr_view'], $possViews))
65 $targetView = processView2Filename($_SESSION[$settings['session_prefix'].'curr_view']);
67 else if (!empty($_COOKIE['curr_view'])
68 and in_array($_COOKIE['curr_view'], $possViews))
70 $targetView = processView2Filename($_COOKIE['curr_view']);
72 else
74 $targetView = processView2Filename($settings['standard']);
76 header("location: ".$settings['forum_address'].$targetView.$qs);
77 die('<a href="'. $targetView.$qsl .'">further...</a>');
80 if (!empty($_SESSION[$settings['session_prefix'].'user_view'])
81 and in_array($_SESSION[$settings['session_prefix'].'user_view'], $possViews))
83 $targetView = processView2Filename($_SESSION[$settings['session_prefix'].'user_view']);
85 else if (isset($_COOKIE['user_view'])
86 and in_array($_COOKIE['user_view'], $possViews))
88 $targetView = processView2Filename($_COOKIE['user_view']);
90 else
92 $targetView = processView2Filename($settings['standard']);
94 header("location: ".$settings['forum_address'].$targetView.$qs);
95 die('<a href="'. $targetView.$qsl .'">further...</a>');