-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathe_url.php
85 lines (74 loc) · 2.28 KB
/
e_url.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
<?php
/*
* CookBook - an e107 plugin by Tijn Kuyper (http://www.tijnkuyper.nl)
*
* Released under the terms and conditions of the
* Apache License 2.0 (see LICENSE file or http://www.apache.org/licenses/LICENSE-2.0)
*
* Friendly URL configuration
*/
if (!defined('e107_INIT')) { exit; }
class cookbook_url
{
function config()
{
$config = array();
// Individual recipe
$config['id'] = array(
'alias' => 'cookbook',
'regex' => '^{alias}/id/(.*)$',
'sef' => '{alias}/id/{r_id}/{r_name_sef}',
'redirect' => '{e_PLUGIN}cookbook/index.php?p=id&id=$1',
);
// All recipes in a specific category
$config['category'] = array(
'alias' => 'cookbook',
'regex' => '^{alias}/category/(.*)$',
'sef' => '{alias}/category/{c_id}/{c_name_sef}',
'redirect' => '{e_PLUGIN}cookbook/index.php?p=category&category=$1',
);
// Overview of all recipes split by category
$config['categories'] = array(
'alias' => 'cookbook',
'regex' => '^{alias}/categories(.*)$',
'sef' => '{alias}/categories/',
'redirect' => '{e_PLUGIN}cookbook/index.php?p=categories',
);
// Individual keyword
$config['keyword'] = array(
'alias' => 'cookbook',
'regex' => '^{alias}/keyword/(.*)$',
'sef' => '{alias}/keyword/{keyword}',
'redirect' => '{e_PLUGIN}cookbook/index.php?p=keyword&keyword=$1',
);
// Overview of all keywords (tagcloud)
$config['keywords'] = array(
'alias' => 'cookbook',
'regex' => '^{alias}/keywords(.*)$',
'sef' => '{alias}/keywords/',
'redirect' => '{e_PLUGIN}cookbook/index.php?p=keywords',
);
// Recently added recipes
$config['latest'] = array(
'alias' => 'cookbook',
'regex' => '^{alias}/latest(.*)$',
'sef' => '{alias}/latest/',
'redirect' => '{e_PLUGIN}cookbook/index.php?p=latest',
);
// Recently added recipes
$config['bookmarks'] = array(
'alias' => 'cookbook',
'regex' => '^{alias}/bookmarks(.*)$',
'sef' => '{alias}/bookmarks/',
'redirect' => '{e_PLUGIN}cookbook/index.php?p=bookmarks',
);
// Overview of all recipes
$config['index'] = array(
'alias' => 'cookbook',
'regex' => '^{alias}/?(.*)$',
'sef' => '{alias}/',
'redirect' => '{e_PLUGIN}cookbook/index.php',
);
return $config;
}
}