Difference between revisions of "Extension:NewUserMessage.php"

From Organic Design wiki
(another quicky from suppoer desk idea)
 
(oops its in SVN now)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
<?php
+
{{svn|http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/NewUserMessage}}
# Extension:NewUserMessage{{Category:Extensions|NewUserMessage}}{{php}}
 
# - Licenced under LGPL (http://www.gnu.org/copyleft/lesser.html)
 
# - Author: [http://www.organicdesign.co.nz/nad User:Nad]{{Category:Extensions created with Template:Extension}}
 
# - Started: 2007-10-15
 
 
 
if (!defined('MEDIAWIKI')) die('Not an entry point.');
 
 
 
define('NewUserMessage_VERSION','1.0.0, 2007-10-15');
 
 
 
$wgNewUserMessageTemplate = 'MediaWiki:NewUserMessage';
 
 
 
$wgHooks['AddNewAccount'][] = 'wfCreateNewUserMessage';
 
$wgExtensionCredits['other'][] = array(
 
        'name'        => "NewUserMessage",
 
        'author'      => "[http://www.organicdesign.co.nz/User:Nad User:Nad]",
 
        'description' => "Add a message to newly created user's talk pages",
 
        'url'        => "http://www.mediawiki.org/wiki/Extension:NewUserMessage",
 
        'version'    => NewUserMessage_VERSION
 
        );
 
 
 
# Add the template message if the users talk page doesn't already exist
 
function wfCreateNewUserMessage($user) {
 
        global $wgNewUserMessageTemplate;
 
$name = $user->getName();
 
$talk = $user->getTalkPage();
 
if (!$talk->exists()) {
 
$article = new Article($talk);
 
$article->insertNewArticle('{'.'{'."$wgNewUserMessageTemplate|$name}}",false,false,true,false);
 
}
 
return true;
 
}
 
?>
 

Latest revision as of 21:52, 12 May 2008

Info.svg This code is in our Git repository here.

Note: If there is no information in this page about this code and it's a MediaWiki extension, there may be something at mediawiki.org.