From fb08fb31767a82a3c0ba13504744ac4982affe7d Mon Sep 17 00:00:00 2001 From: Tom Gilder Date: Thu, 6 Oct 2005 14:20:45 +0000 Subject: [PATCH] Added support for separate noarticletextanon --- includes/Article.php | 6 +++--- includes/EditPage.php | 4 +++- includes/OutputPage.php | 2 +- languages/Language.php | 1 + 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index 6775cff7ce..cf4c713f7a 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -105,7 +105,7 @@ class Article { } wfProfileOut( $fname ); $wgOut->setRobotpolicy( 'noindex,nofollow' ); - return wfMsg( 'noarticletext' ); + return wfMsg( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon' ); } else { $this->loadContent( $noredir ); # check if we're displaying a [[User talk:x.x.x.x]] anonymous talk page @@ -2421,7 +2421,7 @@ class Article { * @access public */ function info() { - global $wgLang, $wgOut, $wgAllowPageInfo; + global $wgLang, $wgOut, $wgAllowPageInfo, $wgUser; $fname = 'Article::info'; if ( !$wgAllowPageInfo ) { @@ -2437,7 +2437,7 @@ class Article { # first, see if the page exists at all. $exists = $page->getArticleId() != 0; if( !$exists ) { - $wgOut->addHTML( wfMsg('noarticletext') ); + $wgOut->addHTML( wfMsg( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon' ) ); } else { $dbr =& $this->getDB( DB_SLAVE ); $wl_clause = array( diff --git a/includes/EditPage.php b/includes/EditPage.php index 88100c236e..d64bb14602 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1315,13 +1315,15 @@ END * @return string HTML */ function getDiff() { + global $wgUser; + require_once( 'DifferenceEngine.php' ); $oldtext = $this->mArticle->fetchContent(); $newtext = $this->mArticle->replaceSection( $this->section, $this->textbox1, $this->summary, $this->edittime ); $oldtitle = wfMsg( 'currentrev' ); $newtitle = wfMsg( 'yourtext' ); - if ( $oldtext != wfMsg( 'noarticletext' ) || $newtext != '' ) { + if ( $oldtext != wfMsg( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon' ) || $newtext != '' ) { $difftext = DifferenceEngine::getDiff( $oldtext, $newtext, $oldtitle, $newtitle ); } diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 2c960bd8b7..0c24e8967d 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -687,7 +687,7 @@ class OutputPage { if( is_string( $source ) ) { if( strcmp( $source, '' ) == 0 ) { - $source = wfMsg( 'noarticletext' ); + $source = wfMsg( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon' ); } $rows = $wgUser->getOption( 'rows' ); $cols = $wgUser->getOption( 'cols' ); diff --git a/languages/Language.php b/languages/Language.php index f4fadf814d..a3aa0c8e55 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -707,6 +707,7 @@ If you are here by mistake, just click your browser's '''back''' button.", 'talkpagetext' => '', 'anontalkpagetext' => "----''This is the discussion page for an anonymous user who has not created an account yet or who does not use it. We therefore have to use the numerical [[IP address]] to identify him/her. Such an IP address can be shared by several users. If you are an anonymous user and feel that irrelevant comments have been directed at you, please [[Special:Userlogin|create an account or log in]] to avoid future confusion with other anonymous users.'' ", 'noarticletext' => 'There is currently no text in this page, you can [[{{ns:special}}:Search/{{PAGENAME}}|search for this page title]] in other pages or [{{fullurl:{{NAMESPACE}}:{{PAGENAME}}|action=edit}} edit this page].', +'noarticletextanon' => '{{int:noarticletext}}', 'clearyourcache' => "'''Note:''' After saving, you may have to bypass your browser's cache to see the changes. '''Mozilla / Firefox / Safari:''' hold down ''Shift'' while clicking ''Reload'', or press ''Ctrl-Shift-R'' (''Cmd-Shift-R'' on Apple Mac); '''IE:''' hold ''Ctrl'' while clicking ''Refresh'', or press ''Ctrl-F5''; '''Konqueror:''': simply click the ''Reload'' button, or press ''F5''; '''Opera''' users may need to completely clear their cache in ''Tools→Preferences''.", 'usercssjsyoucanpreview' => "Tip: Use the 'Show preview' button to test your new CSS/JS before saving.", 'usercsspreview' => "'''Remember that you are only previewing your user CSS, it has not yet been saved!'''", -- 2.20.1