Difference between revisions of "Extension:NewUserMessage.php"
From Organic Design wiki
(another quicky from suppoer desk idea) |
m |
||
Line 7: | Line 7: | ||
if (!defined('MEDIAWIKI')) die('Not an entry point.'); | if (!defined('MEDIAWIKI')) die('Not an entry point.'); | ||
− | define(' | + | define('NEWUSERMESSAGE_VERSION','1.0.0, 2007-10-15'); |
$wgNewUserMessageTemplate = 'MediaWiki:NewUserMessage'; | $wgNewUserMessageTemplate = 'MediaWiki:NewUserMessage'; | ||
Line 17: | Line 17: | ||
'description' => "Add a message to newly created user's talk pages", | 'description' => "Add a message to newly created user's talk pages", | ||
'url' => "http://www.mediawiki.org/wiki/Extension:NewUserMessage", | 'url' => "http://www.mediawiki.org/wiki/Extension:NewUserMessage", | ||
− | 'version' => | + | 'version' => NEWUSERMESSAGE_VERSION |
); | ); | ||
Revision as of 00:15, 15 October 2007
<?php
- Extension:NewUserMessage
- - Licenced under LGPL (http://www.gnu.org/copyleft/lesser.html)
- - Author: User:NadCategory: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' => "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; } ?>