0
|
1 |
<?php
|
|
2 |
/*
|
|
3 |
* Decir
|
|
4 |
* Version 0.1
|
|
5 |
* Copyright (C) 2007 Dan Fuhry
|
|
6 |
* common.php - Loader and common basic functions
|
|
7 |
*
|
|
8 |
* This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
|
|
9 |
* as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
|
|
10 |
*
|
|
11 |
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
|
|
12 |
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
|
|
13 |
*/
|
|
14 |
|
|
15 |
if(!defined('DECIR_ROOT'))
|
|
16 |
{
|
|
17 |
$_GET['title'] = 'null';
|
|
18 |
header('HTTP/1.1 403 Forbidden');
|
|
19 |
require('../includes/common.php');
|
|
20 |
die_friendly('Access denied', '<p>This script cannot be run outside of Enano.</p>');
|
|
21 |
}
|
|
22 |
|
|
23 |
require('constants.php');
|
|
24 |
|
|
25 |
$html = ' <!-- Decir\'s updated namespace extractor function -->
|
|
26 |
<script type="text/javascript">
|
|
27 |
function strToPageID(string)
|
|
28 |
{
|
|
29 |
var ret;
|
|
30 |
for(var i in namespace_list)
|
|
31 |
if(namespace_list[i] != \'\')
|
|
32 |
if(namespace_list[i] == string.substr(0, namespace_list[i].length))
|
|
33 |
ret = [string.substr(namespace_list[i].length), i];
|
|
34 |
|
|
35 |
if ( ret )
|
|
36 |
return ret;
|
|
37 |
|
|
38 |
return [string, \'Article\'];
|
|
39 |
}
|
|
40 |
</script>
|
|
41 |
';
|
|
42 |
|
|
43 |
$template->add_header($html);
|
|
44 |
|
|
45 |
?>
|