Back to vBulletin 4.x Add-ons

Mediawiki Edits in Postbit & Profile
Mod Version: 1.0.0, by ndahiya

vB Version: 4.0.1 Rating: (0 vote - 0 average) Installs: 12
Released: 23 Jan 2010 Last Update: 23 Jan 2010 Downloads: 62
Supported DB Changes Uses Plugins Template Edits Re-usable Code  

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
in that thread.

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>
Add Below:
Code:
<dt>{vb:rawphrase total_wikiedits}</dt> <dd>{vb:raw post.wikiedits}</dd>
2. memberinfo_block_aboutme
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>
Insert Below (change the wiki path to your own: i use /home/):
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

File Type: %1$s product-mediawiki-editcount.xml (3.2 KB, 64 downloads)


vblts.ru supports vBulletin®, 2022-2024