欢迎大家赞助一杯啤酒🍺 我们准备了下酒菜:Formal mathematics/Isabelle/ML, Formal verification/Coq/ACL2/Agda, C++/Lisp/Haskell
Extension:SocialProfile
SocialProfile extension will incorporate a social profile, user board, and basic profile information into MediaWiki, specifically Avatars, Friending, Foeing, User Board, Board Blast, basic Profile Information, User Levels rank system, Awards and Gifts. The package also notifies users via email when other users request them as a friend or foe and/or sends them a message. The package was developed by Wikia, Inc.
SocialProfile consists of 7 components:
- SystemGifts — awards functionality
- UserBoard — user-to-user messages
- UserGifts — gifting functionality
- UserProfile — social profile pages
- UserRelationship — friend/foe relationships
- UserStats — statistics, such as the User Levels system
- UserWelcome — <userWelcome/> parser hook for displaying social info on a wiki page
目录 |
Install
获得代码
svn co http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/SocialProfile/ SocialProfile
上传 SocialProfile 到 extensions 目录下
修改 LocalSettings.php 增加以下内容
#SocialProfile require_once("extensions/SocialProfile/UserWelcome/UserWelcome.php"); require_once("extensions/SocialProfile/SocialProfile.php"); $wgExtraNamespaces[NS_USER_PROFILE] = 'User_profile'; $wgExtraNamespaces[NS_USER_WIKI] = 'UserWiki'; $wgUserProfileDisplay['friends'] = true; $wgUserProfileDisplay['foes'] = true; $wgUserBoard = true; $wgUserProfileDisplay['board'] = true; $wgUserProfileDisplay['stats'] = true; $wgUserStatsPointValues['edit'] = 50;
require_once("extensions/SocialProfile/UserStats/EditCount.php"); // Necessary edit counter // The actual user level definitions -- key is simple: 'Level name' => points needed $wgUserLevels = array( 'Recruit' => 0, 'Apprentice' => 1200, 'Private' => 1750, 'Corporal' => 2500, 'Sergeant' => 5000, 'Gunnery Sergeant' => 10000, 'Lieutenant' => 20000, 'Captain' => 35000, 'Major' => 50000, 'Lieutenant Commander' => 75000, 'Commander' => 100000, 'Colonel' => 150000, 'Brigadier' => 250000, 'Brigadier General' => 350000, 'Major General' => 500000, 'Lieutenant General' => 650000, 'General' => 800000, 'General of the Army' => 1000000, );
创建数据表
cd $MediaWiki maintenance 目录下 执行 php update.php // 这个功能很 cool :)
转移目录
mv extensions/SocialProfile/avatars ../../images mv extensions/SocialProfile/awards ../../images
上传头像时图片大小超过100kb会出现: // 调大些, extensions/SocialProfile/UserProfile/SpecialUploadAvatar.php 如-quality 120 , 120kb
Warning: Invalid argument supplied for foreach() in extensions/SocialProfile/UserStats/UserStatsClass.php on line 519
Issue
Relationship requests 时, 接受, 拒绝两个按钮都不起作用?
108行 报错: 缺少对象
作者的回复:
Works for me (MediaWiki 1.17alpha (r70714), PHP 5.3.0, newest version of SocialProfile). Make sure that you're using the newest version of SocialProfile and 1.16 release of MediaWiki, that jQuery is available and that all the paths are correct ($wgUserProfileDirectory, $wgUserBoardScripts, $wgUserProfileScripts and $wgUserRelationshipScripts). --Jack Phoenix (Contact) 13:27, 11 August 2010 (UTC)
加入
$wgUserProfileDirectory = "extensions/SocialProfile/UserProfile"; $wgUserProfileScripts = "/extensions/SocialProfile/UserProfile"; $wgUserBoardScripts = "/extensions/SocialProfile/UserBoard"; $wgUserRelationshipScripts = "/extensions/SocialProfile/UserRelationship";
问题解决
升级 PHP 5.1.2 (cgi-fcgi) 到 5.2.14 (cgi-fcgi) 并升级 Lighttpd
- Example URL: index.php?title=Special:AddRelationship&user=Pean&rel_type=1 (for adding as friend)
- Example URL: index.php?title=Special:AddRelationship&user=Pean&rel_type=2 (for adding as foe)
发送加好友请求响应非常慢?
消息系统有些混乱.有 user board 和 board-to-board, 不明白, 为何搞两套?
<div class="user-page-message-box-button"> <input type="button" value="发送" class="site-button" onclick="javascript:send_message();" /> </div>
这种方式消息发不出去.
礼物无法发送出去 ?
Tips
在页面上隐藏加为仇敌的链接, 只保留加为好友链接
$wgUserProfileDisplay['foes'] = false;
extensions\SocialProfile\UserProfile\UserProfilePage.php // 约524行
//'<a href="' . $add_relationship->escapeFullURL( 'user=' . $user_safe . '&rel_type=2' ) . '" rel="nofollow">' . wfMsg( 'user-add-foe' ) . '</a>',
Plan
- 维护中、英文两个版本
- 完善和加入更多社区功能
Links
<discussion>characters_max=300</discussion>