Index: trunk/extensions/SocialProfile/SocialProfile.php |
— | — | @@ -4,12 +4,22 @@ |
5 | 5 | * This line must be present before any global variable is referenced. |
6 | 6 | */ |
7 | 7 | if ( !defined( 'MEDIAWIKI' ) ) { |
8 | | - die(); |
| 8 | + die( |
| 9 | + 'This is the setup file for the SocialProfile extension to MediaWiki.' . |
| 10 | + 'Please see http://www.mediawiki.org/wiki/Extension:SocialProfile for' . |
| 11 | + ' more information about this extension.' |
| 12 | + ); |
9 | 13 | } |
10 | 14 | |
11 | 15 | /** |
12 | | - * This is the *main* (but certainly not the only) loader file for SocialProfile extension. |
| 16 | + * This is the loader file for the SocialProfile extension. You should include |
| 17 | + * this file in your wiki's LocalSettings.php to activate SocialProfile. |
13 | 18 | * |
| 19 | + * If you want to use the UserWelcome extension (bundled with SocialProfile), |
| 20 | + * the <topusers /> tag or the user levels feature, there are some other files |
| 21 | + * you will need to include in LocalSettings.php. The online manual has more |
| 22 | + * details about this. |
| 23 | + * |
14 | 24 | * For more info about SocialProfile, please see http://www.mediawiki.org/wiki/Extension:SocialProfile. |
15 | 25 | */ |
16 | 26 | $dir = dirname( __FILE__ ) . '/'; |
— | — | @@ -210,9 +220,26 @@ |
211 | 221 | require_once( "$IP/extensions/SocialProfile/SystemGifts/SystemGifts.php" ); // SystemGifts (awards functionality) loader file |
212 | 222 | require_once( "$IP/extensions/SocialProfile/UserActivity/UserActivity.php" ); // UserActivity - recent social changes |
213 | 223 | |
214 | | -# Schema changes |
| 224 | +// Hooked functions |
| 225 | +$wgHooks['CanonicalNamespaces'][] = 'wfSocialProfileRegisterCanonicalNamespaces'; |
215 | 226 | $wgHooks['LoadExtensionSchemaUpdates'][] = 'efSocialProfileSchemaUpdates'; |
216 | 227 | |
| 228 | +/** |
| 229 | + * Register the canonical names for our custom namespaces and their talkspaces. |
| 230 | + * |
| 231 | + * @param $list Array: array of namespace numbers with corresponding |
| 232 | + * canonical names |
| 233 | + * @return Boolean: true |
| 234 | + */ |
| 235 | +function wfSocialProfileRegisterCanonicalNamespaces( &$list ) { |
| 236 | + $list[NS_USER_WIKI] = 'UserWiki'; |
| 237 | + $list[NS_USER_WIKI_TALK] = 'UserWiki_talk'; |
| 238 | + $list[NS_USER_PROFILE] = 'User_profile'; |
| 239 | + $list[NS_USER_PROFILE_TALK] = 'User_profile_talk'; |
| 240 | + return true; |
| 241 | +} |
| 242 | + |
| 243 | +// Schema changes |
217 | 244 | function efSocialProfileDBUpdate( $updater, $label, $file ) { |
218 | 245 | if ( $updater === null ) { |
219 | 246 | global $wgExtNewTables; |
— | — | @@ -224,9 +251,10 @@ |
225 | 252 | } |
226 | 253 | |
227 | 254 | function efSocialProfileSchemaUpdates( $updater = null ) { |
| 255 | + global $wgDBtype; |
| 256 | + |
228 | 257 | $dir = dirname( __FILE__ ); |
229 | 258 | $dbExt = ''; |
230 | | - global $wgDBtype; |
231 | 259 | |
232 | 260 | if ( $wgDBtype == 'postgres' ) { |
233 | 261 | $dbExt = '.postgres'; |
— | — | @@ -308,20 +336,4 @@ |
309 | 337 | |
310 | 338 | if( !defined( 'NS_USER_PROFILE_TALK' ) ) { |
311 | 339 | define( 'NS_USER_PROFILE_TALK', 203 ); |
312 | | -} |
313 | | - |
314 | | -$wgHooks['CanonicalNamespaces'][] = 'wfSocialProfileRegisterCanonicalNamespaces'; |
315 | | -/** |
316 | | - * Register the canonical names for our custom namespaces and their talkspaces. |
317 | | - * |
318 | | - * @param $list Array: array of namespace numbers with corresponding |
319 | | - * canonical names |
320 | | - * @return Boolean: true |
321 | | - */ |
322 | | -function wfSocialProfileRegisterCanonicalNamespaces( &$list ) { |
323 | | - $list[NS_USER_WIKI] = 'UserWiki'; |
324 | | - $list[NS_USER_WIKI_TALK] = 'UserWiki_talk'; |
325 | | - $list[NS_USER_PROFILE] = 'User_profile'; |
326 | | - $list[NS_USER_PROFILE_TALK] = 'User_profile_talk'; |
327 | | - return true; |
328 | 340 | } |
\ No newline at end of file |