c3d2-wiki/Interner_Namespace_für_Medi...

53 lines
2.1 KiB
Plaintext
Raw Normal View History

2006-12-18 14:54:01 +01:00
[[Kategorie:Wissen]][[Kategorie:Mediawiki]]
2006-12-18 14:42:44 +01:00
==Patch um unbekannte Namespaces zu verstecken==
<pre>
Index: includes/SpecialRecentchanges.php
===================================================================
--- includes/SpecialRecentchanges.php (revision 18244)
+++ includes/SpecialRecentchanges.php (working copy)
@@ -17,6 +17,7 @@
global $wgUser, $wgOut, $wgRequest, $wgUseRCPatrol;
global $wgRCShowWatchingUsers, $wgShowUpdatedMarker;
global $wgAllowCategorizedRecentChanges ;
+ global $wgCanonicalNamespaceNames;
$fname = 'wfSpecialRecentchanges';
# Get query parameters
@@ -155,6 +156,7 @@
# Namespace filtering
$hidem .= is_null( $namespace ) ? '' : ' AND rc_namespace' . ($invert ? '!=' : '=') . $namespace;
+ $hidem .= ' AND rc_namespace IN (0,'.join( ',', array_map( 'intval', array_keys($wgCanonicalNamespaceNames) ) ).')';
// This is the big thing!
Index: includes/Revision.php
===================================================================
--- includes/Revision.php (revision 18244)
+++ includes/Revision.php (working copy)
@@ -165,6 +165,8 @@
* @static
*/
private static function loadFromConds( &$db, $conditions ) {
+ global $wgCanonicalNamespaceNames;
+ array_push( $conditions, 'page_namespace IN (0,'.join( ',', array_map( 'intval', array_keys($wgCanonicalNamespaceNames) ) ).')' );
$res = Revision::fetchFromConds( $db, $conditions );
if( $res ) {
$row = $res->fetchObject();
</pre>
2006-12-18 14:52:39 +01:00
==Erstellen einer Kopie von index.php für den internen Bereich==
In dieser Kopie fügt man lediglich ein require für die LocalSettings des internen Bereichs hinzu
<pre>
--- index.php 2006-11-14 15:52:25.000000000 +0000
+++ index_intern.php 2006-11-23 22:32:14.000000000 +0000
@@ -2,6 +2,7 @@
# Initialise common code
require_once( './includes/WebStart.php' );
+require_once( 'LocalSettingsIntern.php' );
# Initialize MediaWiki base class
require_once( "includes/Wiki.php" );
</pre>