forked from rica-carv/eforum
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathe_url.php
More file actions
126 lines (108 loc) · 3.78 KB
/
e_url.php
File metadata and controls
126 lines (108 loc) · 3.78 KB
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<?php
/*
* e107 Bootstrap CMS
*
* Copyright (C) 2008-2015 e107 Inc (e107.org)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
* IMPORTANT: Make sure the redirect script uses the following code to load class2.php:
*
* if (!defined('e107_INIT'))
* {
* require_once(__DIR__.'/../../class2.php');
* }
*
*/
if (!defined('e107_INIT')) { exit; }
// v2.x Standard - Simple mod-rewrite module.
class eforum_url // plugin-folder + '_url'
{
function config()
{
$config = array();
/*
$config['rules'] = array(
'regex' => '^forum/rules/?',
'sef' => 'forum/rules',
'redirect' => '{e_PLUGIN}forum/forum.php?f=rules',
'legacy' => '{e_PLUGIN}forum/forum.php?f=rules',
);
*/
$config['newposts'] = array(
'regex' => '^eforum/newposts/?',
'sef' => 'eforum/newposts',
'redirect' => '{e_PLUGIN}eforum/eforum_newposts.php',
'legacy' => '{e_PLUGIN}eforum/eforum_newposts.php',
);
/*
$config['track'] = array(
'regex' => '^forum/track/?',
'sef' => 'forum/track',
'redirect' => '{e_PLUGIN}forum/forum.php?f=track',
'legacy' => '{e_PLUGIN}forum/forum.php?f=track',
);
$config['markread'] = array(
'sef' => '^forum/markread/{forum_id}',
'regex' => 'forum/markread/([\d]*)',
'redirect' => '{e_PLUGIN}forum/forum.php?f=mfar&id=$1',
'legacy' => '{e_PLUGIN}forum/forum.php?f=mfar&id={forum_id}'
);
$config['new'] = array(
'regex' => '^forum/new$/?',
'sef' => 'forum/new',
'redirect' => '{e_PLUGIN}forum/forum.php?new',
'legacy' => '{e_PLUGIN}forum/forum.php?new'
);
$config['post'] = array(
'regex' => '^forum/post/?',
'sef' => 'forum/post/',
'redirect' => '{e_PLUGIN}forum/forum_post.php',
'legacy' => '{e_PLUGIN}forum/forum_post.php',
);
// only create url - parsed above.
$config['move'] = array(
'sef' => 'forum/post/?f=move&id={thread_id}',
'legacy' => '{e_PLUGIN}forum/forum_post.php?f=move&id={thread_id}'
);
$config['split'] = array(
'sef' => 'forum/post/?f=split&id={thread_id}&post={post_id}',
'legacy' => '{e_PLUGIN}forum/forum_post.php?f=split&id={thread_id}&post={post_id}'
);
$config['topic'] = array(
'regex' => 'forum\/([^\/]*)\/([\d]*)(?:\/|-)([\w-]*)/?\??(.*)',
// 'regex' => '^forum/(.*)/(\d*)(?:-|/)([\w-]*)/?\??(.*)',
'sef' => 'forum/{forum_sef}/{thread_id}/{thread_sef}/',
'redirect' => '{e_PLUGIN}forum/forum_viewtopic.php?id=$2&$4'
);
$config['topic-canonical'] = array(
'regex' => 'forum\/([^\/]*)\/([\d]*)(?:\/|-)([\w-]*)/?\??(.*)',
// 'regex' => '^forum/(.*)/(\d*)(?:-|/)([\w-]*)/?\??(.*)',
'sef' => 'forum/{forum_sef}/{thread_id}/?p={thread_page}',
'redirect' => '{e_PLUGIN}forum/forum_viewtopic.php?id=$2&$4'
);
/*
$config['subforum'] = array(
'regex' => '^forum/(.*)/(.*)$',
'sef' => 'forum/{parent_sef}/{forum_sef}',
'redirect' => '{e_PLUGIN}forum/forum_viewforum.php?sef=$2',
'legacy' => '{e_PLUGIN}forum/forum_viewforum.php?id={forum_id}'
);
*/
/*
$config['index'] = array(
'regex' => '^forum\/?$', // matched against url, and if true, redirected to 'redirect' below.
'sef' => 'forum', // used by e107::url(); to create a url from the db table.
'redirect' => '{e_PLUGIN}forum/forum.php', // file-path of what to load when the regex returns true.
'legacy' => '{e_PLUGIN}forum/forum.php',
);
$config['forum'] = array(
'regex' => '^forum\/([^\/]*)\/?\??([^\/]*)?$',
'sef' => 'forum/{forum_sef}/',
'redirect' => '{e_PLUGIN}forum/forum_viewforum.php?sef=$1&$2',
'legacy' => '{e_PLUGIN}forum/forum_viewforum.php?id={forum_id}'
);
*/
return $config;
}
}