Index: trunk/extensions/LiquidThreads/i18n/Lqt.i18n.php |
— | — | @@ -213,6 +213,7 @@ |
214 | 214 | 'prefs-lqt' => 'Threaded discussion', |
215 | 215 | 'lqt-preference-display-depth' => 'Maximum reply depth to show:', |
216 | 216 | 'lqt-preference-display-count' => 'Maximum number of replies to show:', |
| 217 | + 'lqt-preference-custom-signatures' => 'Show custom user signatures', |
217 | 218 | |
218 | 219 | // E-mail notification |
219 | 220 | 'lqt-enotif-subject-reply' => '{{SITENAME}} discussion - Reply: $1', |
Index: trunk/extensions/LiquidThreads/LiquidThreads.php |
— | — | @@ -140,6 +140,7 @@ |
141 | 141 | $wgDefaultUserOptions['lqtnotifytalk'] = true; |
142 | 142 | $wgDefaultUserOptions['lqtdisplaydepth'] = 3; |
143 | 143 | $wgDefaultUserOptions['lqtdisplaycount'] = 10; |
| 144 | +$wgDefaultUserOptions['lqtcustomsignatures'] = true; |
144 | 145 | |
145 | 146 | // API |
146 | 147 | $wgAutoloadClasses['ApiQueryLQTThreads'] = "$dir/api/ApiQueryLQTThreads.php"; |
Index: trunk/extensions/LiquidThreads/classes/View.php |
— | — | @@ -29,6 +29,7 @@ |
30 | 30 | static $stylesAndScriptsDone = false; |
31 | 31 | |
32 | 32 | static $userSignatureCache = array(); |
| 33 | + static $boringSignatureCache = array(); |
33 | 34 | |
34 | 35 | function __construct( &$output, &$article, &$title, &$user, &$request ) { |
35 | 36 | $this->article = $article; |
— | — | @@ -1217,7 +1218,29 @@ |
1218 | 1219 | $name = $user->getName(); |
1219 | 1220 | $uid = $user->getId(); |
1220 | 1221 | } |
| 1222 | + |
| 1223 | + if ( $this->user->getOption( 'lqtcustomsignatures' ) ) { |
| 1224 | + return $this->getUserSignature( $user, $uid, $name ); |
| 1225 | + } else { |
| 1226 | + return $this->getBoringSignature( $user, $uid, $name ); |
| 1227 | + } |
| 1228 | + } |
| 1229 | + |
| 1230 | + function getBoringSignature( $user, $uid, $name ) { |
| 1231 | + if ( isset( self::$boringSignatureCache[$name] ) ) { |
| 1232 | + return self::$boringSignatureCache[$name]; |
| 1233 | + } |
1221 | 1234 | |
| 1235 | + $msg = ($uid > 0) ? 'signature' : 'signature-anon'; |
| 1236 | + |
| 1237 | + $sig = wfMsgExt( $msg, 'parseinline', array($name, $name) ); |
| 1238 | + |
| 1239 | + self::$boringSignatureCache[$name] = $sig; |
| 1240 | + |
| 1241 | + return $sig; |
| 1242 | + } |
| 1243 | + |
| 1244 | + function getUserSignature( $user, $uid, $name ) { |
1222 | 1245 | if ( isset( self::$userSignatureCache[$name] ) ) { |
1223 | 1246 | return self::$userSignatureCache[$name]; |
1224 | 1247 | } |
Index: trunk/extensions/LiquidThreads/classes/Hooks.php |
— | — | @@ -151,6 +151,14 @@ |
152 | 152 | global $wgEnableEmail; |
153 | 153 | wfLoadExtensionMessages( 'LiquidThreads' ); |
154 | 154 | |
| 155 | + // Whether or not to show user signatures |
| 156 | + $preferences['lqtcustomsignatures'] = |
| 157 | + array( |
| 158 | + 'type' => 'toggle', |
| 159 | + 'label-message' => 'lqt-preference-custom-signatures', |
| 160 | + 'section' => 'lqt', |
| 161 | + ); |
| 162 | + |
155 | 163 | if ($wgEnableEmail) { |
156 | 164 | $preferences['lqtnotifytalk'] = |
157 | 165 | array( |
— | — | @@ -176,7 +184,6 @@ |
177 | 185 | 'section' => 'lqt', |
178 | 186 | ); |
179 | 187 | |
180 | | - // Display depth and count |
181 | 188 | $preferences['lqtdisplaycount'] = |
182 | 189 | array( |
183 | 190 | 'type' => 'int', |