Interner Namespace für Mediawiki: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Sven (Diskussion | Beiträge) (initial release) |
Sven (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
||
Zeile 35: | Zeile 35: | ||
$row = $res->fetchObject(); | $row = $res->fetchObject(); | ||
</pre> | |||
==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> | </pre> |
Version vom 18. Dezember 2006, 13:52 Uhr
Patch um unbekannte Namespaces zu verstecken
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();
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
--- 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" );