/
index.php
89 lines (76 loc) · 3.45 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<?php
///////////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2017 Phorum Development Team //
// http://www.phorum.org //
// //
// This program is free software. You can redistribute it and/or modify //
// it under the terms of either the current Phorum License (viewable at //
// phorum.org) or the Phorum License that was distributed with this file //
// //
// 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. //
// //
// You should have received a copy of the Phorum License //
// along with this program. //
///////////////////////////////////////////////////////////////////////////////
define('phorum_page','index');
include_once( "./common.php" );
include_once( "./include/format_functions.php" );
if(!phorum_check_read_common()) {
return;
}
// check for markread
if (!empty($PHORUM["args"][1]) && $PHORUM["args"][1] == 'markread' && $PHORUM["DATA"]["LOGGEDIN"]){
// setting all posts read
if(isset($PHORUM["forum_id"])){
unset($PHORUM['user']['newinfo']);
phorum_db_newflag_allread($PHORUM["forum_id"]);
if($PHORUM['cache_newflags']) {
$newflagkey = $PHORUM["forum_id"]."-".$PHORUM['user']['user_id'];
phorum_cache_remove('newflags', $newflagkey);
phorum_cache_remove('newflags_index', $newflagkey);
}
}
// redirect to a fresh list of the current folder without markread in url
if(isset($PHORUM["args"][2]) && !empty($PHORUM["args"][2])) {
$folder_id = (int)$PHORUM["args"][2];
$dest_url = phorum_get_url(PHORUM_INDEX_URL, $folder_id);
} else {
$dest_url = phorum_get_url(PHORUM_INDEX_URL);
}
phorum_redirect_by_url($dest_url);
exit;
}
// somehow we got to a forum in index.php
if(!empty($PHORUM["forum_id"]) && $PHORUM["folder_flag"]==0){
$dest_url = phorum_get_url(PHORUM_LIST_URL);
phorum_redirect_by_url($dest_url);
exit;
}
// add feed urls
if (isset($PHORUM['use_rss']) && $PHORUM['use_rss'])
{
$PHORUM['DATA']['FEEDS'] = array(
array(
'URL' => phorum_get_url(PHORUM_FEED_URL, $PHORUM['vroot'], 'type='.$PHORUM['default_feed']),
'TITLE' => $PHORUM['DATA']['FEED'] . ' ('. strtolower($PHORUM['DATA']['LANG']['Threads']) . ')'
),
array(
"URL" => phorum_get_url(PHORUM_FEED_URL, $PHORUM['vroot'], 'replies=1', 'type='.$PHORUM['default_feed']),
"TITLE" => $PHORUM['DATA']['FEED'] . ' (' . strtolower($PHORUM['DATA']['LANG']['Threads'].' + '.$PHORUM['DATA']['LANG']['replies']) . ')'
)
);
}
if ( isset( $PHORUM["forum_id"] ) ) {
$parent_id = (int)$PHORUM["forum_id"];
} else {
$parent_id = 0;
}
if(!isset($PHORUM["use_new_folder_style"]) || $PHORUM["use_new_folder_style"]){
include_once "./include/index_new.php";
} else {
include_once "./include/index_classic.php";
}
?>