Mailing List Archive

patch for wikiSettings.php
Here's a patch for wikiSettings.php that fixes the problem of variables
being used before they are defined. See my previous post for some of the
rationale for this patch.

This fix makes the code actually work, so the pages end up being in the
colours assigned here. But we don't really want multicoloured pages, so
I've changed most of the colours to #FFFFFF so that there is no effective
change of page colouring.

This patch also fixes the problem of using $wikiCharset before it is
defined. I've just used "iso-8859-1" and "Latin-1" instead.

Zundark


*** wikiSettings.php.old Tue Feb 26 18:17:10 2002
--- wikiSettings.php Wed Apr 10 17:46:38 2002
***************
*** 21,33 ****
$wikiDBconnection = ""; # global variable to hold the current DB
# connection; should be empty initially.

! # Namespace backgrounds
$wikiNamespaceBackground = array () ;
! $wikiNamespaceBackground[$wikiTalk] = "#eeFFFF" ;
! $wikiNamespaceBackground["user_talk"] = $wikiNamespaceBackground["talk"] ;
! $wikiNamespaceBackground["wikipedia_talk"] = $wikiNamespaceBackground["talk"] ;
! $wikiNamespaceBackground[$wikiUser] = "#FFeeee" ;
! $wikiNamespaceBackground[$wikiWikipedia] = "#eeFFee" ;
$wikiNamespaceBackground["log"] = "#FFFFcc" ;
$wikiNamespaceBackground["special"] = "#eeeeee" ;

--- 21,30 ----
$wikiDBconnection = ""; # global variable to hold the current DB
# connection; should be empty initially.

! # Namespace backgrounds. (Those with variable indices are assigned later.)
$wikiNamespaceBackground = array () ;
! $wikiNamespaceBackground["user_talk"] = "#FFFFFF" ;
! $wikiNamespaceBackground["wikipedia_talk"] = "#FFFFFF" ;
$wikiNamespaceBackground["log"] = "#FFFFcc" ;
$wikiNamespaceBackground["special"] = "#eeeeee" ;

***************
*** 41,48 ****
include_once ( "wikiLocalSettings.php" ) ;

# Initialize list of available character encodings to the default if none was set up.
! if ( ! isset ( $wikiEncodingCharsets ) ) $wikiEncodingCharsets = array($wikiCharset);
! if ( ! isset ( $wikiEncodingNames ) ) $wikiEncodingNames = array($wikiCharset); # Localised names

#
# This file loads up the default English message strings
--- 38,47 ----
include_once ( "wikiLocalSettings.php" ) ;

# Initialize list of available character encodings to the default if none was set up.
! if ( ! isset ( $wikiEncodingCharsets ) )
! $wikiEncodingCharsets = array("iso-8859-1");
! if ( ! isset ( $wikiEncodingNames ) )
! $wikiEncodingNames = array("Latin-1"); # Localised names

#
# This file loads up the default English message strings
***************
*** 54,59 ****
--- 53,68 ----
include_once ( "wikiText" . ucfirst ( $wikiLanguage ) . ".php" ) ;
}

+ # More namespace backgrounds, now that the required variables have
+ # been defined. We must be careful not to overwrite any values that
+ # have been assigned elsewhere.
+ if ( ! isset ( $wikiNamespaceBackground[$wikiTalk] ) )
+ $wikiNamespaceBackground[$wikiTalk] = "#FFFFFF" ;
+ if ( ! isset ( $wikiNamespaceBackground[$wikiUser] ) )
+ $wikiNamespaceBackground[$wikiUser] = "#FFFFFF" ;
+ if ( ! isset ( $wikiNamespaceBackground[$wikiWikipedia] ) )
+ $wikiNamespaceBackground[$wikiWikipedia] = "#FFFFFF" ;
+
# Functions

# Is there any reason to localise this function? Ever?