|
Mediawiki Edits in Postbit & Profile
This hack enables better integration between MediaWiki and vBulletin.
This hack displays a user's total edits made in mediawiki in their posts and on their profile page (similar to vBulletin post count). Release Info: v1.0.0: Initial Release Requirements: * MediaWiki * MediaWiki/vBulletin Single Sign-On integration hack. If there is a problem making it work with vb4, please also see Post 112 Spoiler (click to open)
Hi,
I was able to get this to work in vb 4.0.0 (mediawiki 1.14) by editing AuthPlugin_vBSSO.php by adding 3 chdir commands twhere the scripts are called <<<<< define('THIS_SCRIPT', 'wiki'); chdir ('/home/sitename/www/forums'); require_once( CWD . '/global.php'); chdir ('/home/sitename/www/forums'); require_once( CWD . '/includes/functions.php'); chdir ('/home/sitename/www/w/includes'); <<<<< the second chdir is redundant, i think, but just to be safe. ![]() so far working, but will see how stable it is. ndahiya Close
To install: * Add the product using the attached product file. * Perform the 2 simple template edits outlined below. Template Edits: 1. postbit_legacy or postbit Find: Code:
<dt>{vb:rawphrase 'posts'}</dt> <dd>{vb:raw post.posts}</dd>
Code:
<dt>{vb:rawphrase total_wikiedits}</dt> <dd>{vb:raw post.wikiedits}</dd>
Find: Code:
<vb:if condition="$prepared['lastposturl']">
<dl class="stats">
<dt>{vb:rawphrase last_post}</dt>
<dd><a href="{vb:raw prepared.lastposturl}">{vb:raw prepared.lastposttitle}</a> {vb:raw prepared.lastpostdate} <span class="time">{vb:raw prepared.lastposttime}</span></dd>
</dl>
</vb:if>
Code:
<dl class="stats">
<dt>{vb:rawphrase total_wikiedits}</dt><dd><a href="/home/Special:Contributions/{vb:raw userinfo.username}"> {vb:raw userinfo.wikiedits} </a>
</dd>
</dl>
Thats it! Notes: 1. This hack assumes that your mediawiki install uses a "mw_" table prefix in the same database as vbulletin. If this is not the case, do a search/replace in the product XML file before you install it. 2. If mediawiki is installed in a different database, then replace "mw_user" with "wikidatabase.mw_user" (make sure that the forums' database user has access to the other db). --- This hack is broadly based off AngelBlue's hack hack for a previous release. --- ndahiya Download
|
|||||||||