From c503774b28c18d99a228c7a97dad6d37d55c0d92 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Fri, 9 Apr 2004 07:02:29 +0000 Subject: [PATCH] Moved MAG_XXXX constants to MagicWord.php, changed canonical name for NS 4 to "MetaNamespace" --- includes/MagicWord.php | 43 +++++++++++++++++++++++++++++++ includes/Namespace.php | 4 +-- includes/Title.php | 10 ++++---- languages/Language.php | 58 +++--------------------------------------- 4 files changed, 54 insertions(+), 61 deletions(-) diff --git a/includes/MagicWord.php b/includes/MagicWord.php index 57e79b88ac..0861e63673 100644 --- a/includes/MagicWord.php +++ b/includes/MagicWord.php @@ -13,6 +13,49 @@ /*private*/ $wgMagicFound = false; +define("MAG_REDIRECT", 0); +define("MAG_NOTOC", 1); +define("MAG_START", 2); +define("MAG_CURRENTMONTH", 3); +define("MAG_CURRENTMONTHNAME", 4); +define("MAG_CURRENTDAY", 5); +define("MAG_CURRENTDAYNAME", 6); +define("MAG_CURRENTYEAR", 7); +define("MAG_CURRENTTIME", 8); +define("MAG_NUMBEROFARTICLES", 9); +define("MAG_CURRENTMONTHNAMEGEN", 10); +define("MAG_MSG", 11); +define("MAG_SUBST", 12); +define("MAG_MSGNW", 13); +define("MAG_NOEDITSECTION", 14); +define("MAG_END", 15); +define("MAG_IMG_THUMBNAIL", 16); +define("MAG_IMG_RIGHT", 17); +define("MAG_IMG_LEFT", 18); +define("MAG_IMG_NONE", 19); +define("MAG_IMG_WIDTH", 20); +define("MAG_IMG_CENTER", 21); +define("MAG_INT", 22); +define("MAG_FORCETOC", 23); +define("MAG_SITENAME", 24); +define("MAG_NS", 25); +define("MAG_LOCALURL", 26); +define("MAG_LOCALURLE", 27); +define("MAG_SERVER", 28); + +$wgVariableIDs = array( + MAG_CURRENTMONTH, + MAG_CURRENTMONTHNAME, + MAG_CURRENTDAY, + MAG_CURRENTDAYNAME, + MAG_CURRENTYEAR, + MAG_CURRENTTIME, + MAG_NUMBEROFARTICLES, + MAG_CURRENTMONTHNAMEGEN, + MAG_SITENAME, + MAG_SERVER +); + class MagicWord { /*private*/ var $mId, $mSynonyms, $mCaseSensitive, $mRegex; /*private*/ var $mRegexStart, $mBaseRegex, $mVariableRegex; diff --git a/includes/Namespace.php b/includes/Namespace.php index a5bb448026..37e580bde7 100644 --- a/includes/Namespace.php +++ b/includes/Namespace.php @@ -34,8 +34,8 @@ define("NS_HELP_TALK", 13); NS_TALK => "Talk", NS_USER => "User", NS_USER_TALK => "User_talk", - NS_WIKIPEDIA => "Wikipedia", - NS_WIKIPEDIA_TALK => "Wikipedia_talk", + NS_WIKIPEDIA => "MetaNamespace", + NS_WIKIPEDIA_TALK => "MetaNamespace_talk", NS_IMAGE => "Image", NS_IMAGE_TALK => "Image_talk", NS_MEDIAWIKI => "MediaWiki", diff --git a/includes/Title.php b/includes/Title.php index 18bec83643..8b86a2431e 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -58,14 +58,14 @@ class Title { static $trans; $fname = "Title::newFromText"; wfProfileIn( $fname ); - + # Note - mixing latin1 named entities and unicode numbered # ones will result in a bad link. if( !isset( $trans ) ) { global $wgInputEncoding; $trans = array_flip( get_html_translation_table( HTML_ENTITIES ) ); if( strcasecmp( "utf-8", $wgInputEncoding ) == 0 ) { - $trans = array_map( "utf8_encode", $trans ); + $trans = array_map( "utf8_encode", $trans ); } } @@ -73,7 +73,7 @@ class Title { wfDebugDieBacktrace( "Called with object instead of string." ); } $text = strtr( $text, $trans ); - + $text = wfMungeToUtf8( $text ); @@ -82,8 +82,8 @@ class Title { $t = new Title(); $t->mDbkeyform = str_replace( " ", "_", $text ); - $t->mDefaultNamespace = $defaultNamespace; - + $t->mDefaultNamespace = $defaultNamespace; + wfProfileOut( $fname ); if ( !is_object( $t ) ) { var_dump( debug_backtrace() ); diff --git a/languages/Language.php b/languages/Language.php index a1f583c3aa..e00866cb37 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -11,56 +11,6 @@ # files for examples. # -#-------------------------------------------------------------------------- -# Constants -#-------------------------------------------------------------------------- - -# Magic words -define("MAG_REDIRECT", 0); -define("MAG_NOTOC", 1); -define("MAG_START", 2); -define("MAG_CURRENTMONTH", 3); -define("MAG_CURRENTMONTHNAME", 4); -define("MAG_CURRENTDAY", 5); -define("MAG_CURRENTDAYNAME", 6); -define("MAG_CURRENTYEAR", 7); -define("MAG_CURRENTTIME", 8); -define("MAG_NUMBEROFARTICLES", 9); -define("MAG_CURRENTMONTHNAMEGEN", 10); -define("MAG_MSG", 11); -define("MAG_SUBST", 12); -define("MAG_MSGNW", 13); -define("MAG_NOEDITSECTION", 14); -define("MAG_END", 15); -define("MAG_IMG_THUMBNAIL", 16); -define("MAG_IMG_RIGHT", 17); -define("MAG_IMG_LEFT", 18); -define("MAG_IMG_NONE", 19); -define("MAG_IMG_WIDTH", 20); -define("MAG_IMG_CENTER", 21); -define("MAG_INT", 22); -define("MAG_FORCETOC", 23); -define("MAG_SITENAME", 24); -define("MAG_NS", 25); -define("MAG_LOCALURL", 26); -define("MAG_LOCALURLE", 27); -define("MAG_SERVER", 28); - -$wgVariableIDs = array( - MAG_CURRENTMONTH, - MAG_CURRENTMONTHNAME, - MAG_CURRENTDAY, - MAG_CURRENTDAYNAME, - MAG_CURRENTYEAR, - MAG_CURRENTTIME, - MAG_NUMBEROFARTICLES, - MAG_CURRENTMONTHNAMEGEN, - MAG_SITENAME, - MAG_SERVER -); - - - #-------------------------------------------------------------------------- # Language-specific text #-------------------------------------------------------------------------- @@ -768,7 +718,7 @@ Please log in again after you receive it.", "blockedtitle" => "User is blocked", "blockedtext" => "Your user name or IP address has been blocked by $1. The reason given is this:
''$2''

You may contact $1 or one of the other -[[{{ns4}}:Administrators|administrators]] to discuss the block. +[[{{ns:4}}:Administrators|administrators]] to discuss the block. Note that you may not use the \"email this user\" feature unless you have a valid email address registered in your [[Special:Preferences|user preferences]]. @@ -1011,7 +961,7 @@ to first check if such a file exists.

To view or search previously uploaded images, go to the list of uploaded images. Uploads and deletions are logged on the " . -"upload log. +"upload log.

Use the form below to upload new image files for use in illustrating your articles. On most browsers, you will see a \"Browse...\" button, which will @@ -1026,8 +976,8 @@ This may take some time if you have a slow internet connection. for drawings and other iconic images, and OGG for sounds. Please name your files descriptively to avoid confusion. To include the image in an article, use a link in the form -[[image:file.jpg]] or [[image:file.png|alt text]] -or [[media:file.ogg]] for sounds. +[[{{ns:6}}:file.jpg]] or [[{{ns:6}}:file.png|alt text]] +or [[{{ns:-2}}:file.ogg]] for sounds.

Please note that as with wiki pages, others may edit or delete your uploads if they think it serves the encyclopedia, and you may be blocked from uploading if you abuse the system.", -- 2.20.1