Difference between revisions of "Extension:Wikia.php"
From Organic Design wiki
({{php}} {{Category:Extensions|Wikia}}) |
("Object" namespace added to represent external instances) |
||
Line 9: | Line 9: | ||
$wgUseDatabaseMessages = true; | $wgUseDatabaseMessages = true; | ||
+ | # Objects are just like normal Templates but represent an associated external instance of some kind | ||
+ | $wgExtraNamespaces = array( | ||
+ | 100 => 'Object', | ||
+ | 101 => 'Object talk' | ||
+ | ); | ||
+ | |||
+ | # Include the LocalSettings file for the domain, or default to OD | ||
$settings = '/var/www/settings'; | $settings = '/var/www/settings'; | ||
$domains = '/var/www/domains'; | $domains = '/var/www/domains'; | ||
Line 14: | Line 21: | ||
$extensions = dirname(__FILE__); | $extensions = dirname(__FILE__); | ||
$domain = $_SERVER['SERVER_NAME']; | $domain = $_SERVER['SERVER_NAME']; | ||
− | |||
− | |||
if (!is_file("$domains/$domain")) $domain = 'www.organicdesign.co.nz'; | if (!is_file("$domains/$domain")) $domain = 'www.organicdesign.co.nz'; | ||
include("$domains/$domain"); | include("$domains/$domain"); | ||
− | |||
$wgLocalInterwiki = $wgSitename; | $wgLocalInterwiki = $wgSitename; | ||
Revision as of 10:18, 26 June 2007
<?php
- This is our included LocalSettings code common to all the wikis on the OD/Wikia familyTemplate:Php
- - Licenced under LGPL (http://www.gnu.org/copyleft/lesser.html)
- - Author: http://www.organicdesign.co.nz/nad
- - Started: 2007-06-20, see article history
$wgArticlePath = '/$1'; $wgScriptPath = '/wiki'; $wgUseDatabaseMessages = true;
- Objects are just like normal Templates but represent an associated external instance of some kind
$wgExtraNamespaces = array(
100 => 'Object', 101 => 'Object talk' );
- Include the LocalSettings file for the domain, or default to OD
$settings = '/var/www/settings'; $domains = '/var/www/domains'; $files = '/var/www/files'; $extensions = dirname(__FILE__); $domain = $_SERVER['SERVER_NAME']; if (!is_file("$domains/$domain")) $domain = 'www.organicdesign.co.nz'; include("$domains/$domain"); $wgLocalInterwiki = $wgSitename;
- Pass an array with regexp keys and article-title values to setup domain-based default pages
function domainRedirect($list) { $d = $_SERVER['SERVER_NAME']; $t = $_REQUEST['title']; if (empty($t)) $t = ereg_replace('^/',,$_SERVER['PATH_INFO']); if (empty($t) || $t == 'Main_Page') foreach ($list as $regexp => $title) if (ereg($regexp,$d)) header("Location: $wgServer/$title") && die; }
?>