Index: trunk/extensions/NewUserMessage/NewUserMessage.class.php |
— | — | @@ -53,8 +53,20 @@ |
54 | 54 | $dbw = wfGetDB( DB_MASTER ); |
55 | 55 | $dbw->begin(); |
56 | 56 | $good = true; |
| 57 | + |
| 58 | + $signs = wfMsgForContent('newusermessage-signs'); |
| 59 | + if (!wfEmptyMsg('newusermessage-signs', $signs)) { |
| 60 | + $pattern = '/^\* ?(.*?)$/m'; |
| 61 | + preg_match_all($pattern, $signs, $signsList, PREG_SET_ORDER); |
| 62 | + $rand = rand(0, count($signsList)-1); |
| 63 | + $sign = $signsList[$rand][1]; |
| 64 | + } |
57 | 65 | try { |
58 | | - $article->doEdit("{{{$templateTitleText}|$name}}", wfMsgForContent( 'newuseredit-summary' ), $flags); |
| 66 | + if (!wfEmptyMsg('newusermessage-signs', $signs)) { |
| 67 | + $article->doEdit("{{{$templateTitleText}|$name}}\n--" . $sign . "~~~~~" , wfMsgForContent( 'newuseredit-summary' ), $flags); |
| 68 | + } else { |
| 69 | + $article->doEdit("{{{$templateTitleText}|$name}}", wfMsgForContent( 'newuseredit-summary' ), $flags); |
| 70 | + } |
59 | 71 | } catch ( DBQueryError $e ) { |
60 | 72 | $good = false; |
61 | 73 | } |