Index: trunk/extensions/NewUserMessage/NewUserMessage.php |
— | — | @@ -12,10 +12,23 @@ |
13 | 13 | if (!defined('MEDIAWIKI')) |
14 | 14 | die('Not an entry point.'); |
15 | 15 | |
16 | | -define('NEWUSERMESSAGE_VERSION','1.1, 2008-05-05'); |
| 16 | +define('NEWUSERMESSAGE_VERSION','1.1.1, 2008-05-13'); |
17 | 17 | |
| 18 | +// Specify a template to wrap the new user message within |
18 | 19 | $wgNewUserMessageTemplate = 'MediaWiki:NewUserMessage'; |
19 | 20 | |
| 21 | +// Set the username of the user that makes the edit on user talk pages. If |
| 22 | +// this user does not exist, the new user will show up as editing user. |
| 23 | +$wgNewUserMessageEditor = 'Admin'; |
| 24 | + |
| 25 | +// Sepcify whether or not the new user message creation should show up in recent changes |
| 26 | +$wgNewUserSupressRC = false; |
| 27 | + |
| 28 | +// Should the new user message creation be a minor edit? |
| 29 | +$wgNewUserMinorEdit = true; |
| 30 | + |
| 31 | + |
| 32 | + |
20 | 33 | $wgExtensionMessagesFiles['NewUserMessage'] = dirname(__FILE__) . '/NewUserMessage.i18n.php'; |
21 | 34 | $wgHooks['AddNewAccount'][] = 'wfCreateNewUserMessage'; |
22 | 35 | |
— | — | @@ -28,15 +41,11 @@ |
29 | 42 | 'url' => 'http://www.mediawiki.org/wiki/Extension:NewUserMessage', |
30 | 43 | ); |
31 | 44 | |
32 | | -// Set the username of the user that makes the edit on user talk pages. If |
33 | | -// this user does not exist, the new user will show up as editing user. |
34 | | -$wgNewUserMessageEditor = 'Admin'; |
35 | | - |
36 | 45 | /* |
37 | 46 | * Add the template message if the users talk page doesn't already exist |
38 | 47 | */ |
39 | 48 | function wfCreateNewUserMessage($user) { |
40 | | - global $wgNewUserMessageTemplate; |
| 49 | + global $wgNewUserMessageTemplate, $wgNewUserMinorEdit, $wgNewUserSupressRC; |
41 | 50 | |
42 | 51 | $name = $user->getName(); |
43 | 52 | $talk = $user->getTalkPage(); |
— | — | @@ -57,7 +66,11 @@ |
58 | 67 | $wgUser = $parkedWgUser; |
59 | 68 | } |
60 | 69 | |
61 | | - $article->doEdit('{'.'{'."$wgNewUserMessageTemplate|$name}}", false, EDIT_MINOR); |
| 70 | + $flags = 0; |
| 71 | + if ($wgNewUserMinorEdit) $flags = $flags | EDIT_MINOR; |
| 72 | + if ($wgNewUserSupressRC) $flags = $flags | EDIT_SUPPRESS_RC; |
| 73 | + |
| 74 | + $article->doEdit('{'.'{'."$wgNewUserMessageTemplate|$name}}", false, $flags); |
62 | 75 | $wgUser = $parkedWgUser; |
63 | 76 | } |
64 | 77 | |