forked from e107inc/youtube
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathe_url.php
58 lines (44 loc) · 2.06 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
<?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("../../class2.php");
* }
*
*/
if (!defined('e107_INIT')) { exit; }
// v2.x Standard - Simple mod-rewrite module.
class youtube_url // plugin-folder + '_url'
{
function config()
{
$config = array();
$config['item'] = array(
'alias' => 'videos', // default alias '_blank'. {alias} is substituted with this value below. Allows for customization within the admin area.
'regex' => '^{alias}\/(.*)\/(.*)\/(.*)\/$', // matched against url, and if true, redirected to 'redirect' below.
'sef' => '{alias}/{youtube_sef}/{hash}/{title}/', // used by e107::url(); to create a url from the db table.
'redirect' => '{e_PLUGIN}youtube/youtube.php?cat=$1&id=$2', // file-path of what to load when the regex returns true.
);
$config['cat'] = array(
'alias' => 'videos', // default alias '_blank'. {alias} is substituted with this value below. Allows for customization within the admin area.
'regex' => '^{alias}\/(.*)\/$', // matched against url, and if true, redirected to 'redirect' below.
'sef' => '{alias}/{youtube_sef}/', // used by e107::url(); to create a url from the db table.
'redirect' => '{e_PLUGIN}youtube/youtube.php?cat=$1', // file-path of what to load when the regex returns true.
);
$config['index'] = array(
'alias' => 'videos',
'regex' => '^{alias}\/?(.*)$', // matched against url, and if true, redirected to 'redirect' below.
'sef' => '{alias}', // used by e107::url(); to create a url from the db table.
'redirect' => '{e_PLUGIN}youtube/youtube.php$1', // file-path of what to load when the regex returns true.
);
return $config;
}
}