2015-01-23 15:26:23 -08:00
|
|
|
<?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'))
|
|
|
|
* {
|
2021-01-21 09:38:38 -08:00
|
|
|
* require_once(__DIR__.'/../../class2.php');
|
2015-01-23 15:26:23 -08:00
|
|
|
* }
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (!defined('e107_INIT')) { exit; }
|
|
|
|
|
2015-06-07 18:15:23 -07:00
|
|
|
// v2.x Standard - Simple mod-rewrite module.
|
|
|
|
// https://moz.com/blog/11-best-practices-for-urls
|
2015-01-23 15:26:23 -08:00
|
|
|
|
|
|
|
class faqs_url // plugin-folder + '_url'
|
|
|
|
{
|
|
|
|
function config()
|
|
|
|
{
|
|
|
|
$config = array();
|
|
|
|
|
2015-01-28 02:29:26 -08:00
|
|
|
$config['index'] = array(
|
2015-06-16 15:14:39 -07:00
|
|
|
'alias' => 'faqs',
|
|
|
|
'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.
|
2015-01-28 02:29:26 -08:00
|
|
|
'redirect' => '{e_PLUGIN}faqs/faqs.php', // file-path of what to load when the regex returns true.
|
|
|
|
|
|
|
|
);
|
2015-03-31 06:26:06 -07:00
|
|
|
|
2015-06-07 18:15:23 -07:00
|
|
|
$config['item'] = array(
|
2015-06-16 15:14:39 -07:00
|
|
|
'alias' => 'faqs',
|
|
|
|
'regex' => '^{alias}/(\d*)-(.*)$',
|
|
|
|
'sef' => '{alias}/{faq_id}-{faq_sef}', // {faq_info_sef} is substituted with database value when parsed by e107::url();
|
2015-06-07 18:15:23 -07:00
|
|
|
'redirect' => '{e_PLUGIN}faqs/faqs.php?id=$1'
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
$config['search'] = array(
|
2015-06-16 15:14:39 -07:00
|
|
|
'alias' => 'faqs',
|
|
|
|
'regex' => '^{alias}/\?srch=(.*)$', // matched against url, and if true, redirected to 'redirect' below.
|
|
|
|
'sef' => '{alias}/', // used by e107::url(); to create a url from the db table.
|
2015-06-07 18:15:23 -07:00
|
|
|
'redirect' => '{e_PLUGIN}faqs/faqs.php?srch=$1', // file-path of what to load when the regex returns true.
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
2015-03-31 06:26:06 -07:00
|
|
|
$config['tag'] = array(
|
2015-06-16 15:14:39 -07:00
|
|
|
'alias' => 'faqs',
|
|
|
|
'regex' => '^{alias}/tag/(.*)$',
|
|
|
|
'sef' => '{alias}/tag/{tag}', // {faq_info_sef} is substituted with database value when parsed by e107::url();
|
2015-03-31 06:26:06 -07:00
|
|
|
'redirect' => '{e_PLUGIN}faqs/faqs.php?tag=$1'
|
|
|
|
);
|
2015-06-07 18:15:23 -07:00
|
|
|
|
|
|
|
|
2015-01-28 02:29:26 -08:00
|
|
|
$config['category'] = array(
|
2015-06-16 15:14:39 -07:00
|
|
|
'alias' => 'faqs',
|
|
|
|
'regex' => '^{alias}/(.*)$',
|
|
|
|
'sef' => '{alias}/{faq_info_sef}', // {faq_info_sef} is substituted with database value when parsed by e107::url();
|
2015-01-28 02:29:26 -08:00
|
|
|
'redirect' => '{e_PLUGIN}faqs/faqs.php?cat=$1'
|
2015-01-23 15:26:23 -08:00
|
|
|
);
|
2015-03-31 06:26:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-23 15:26:23 -08:00
|
|
|
return $config;
|
|
|
|
}
|
|
|
|
|
2015-01-28 02:29:26 -08:00
|
|
|
|
|
|
|
|
2015-01-23 15:26:23 -08:00
|
|
|
}
|