Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin 3 Articles
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Integrate or bridge with MediaWiki
HolisticEarth
Join Date: Apr 2006
Posts: 14

 

Winnipeg, MB, CAN
Show Printable Version Email this Page Subscription
HolisticEarth HolisticEarth is offline 04-13-2006, 10:00 PM

Do you want to use vBulletin's user database with your MediaWiki? You might like this.

I have taken Kai Backman's MediaWiki authentication plugin idea, fixed coding errors, and expanded greatly on it.

Working on:
vBulletin 3.5.4 and MediaWiki 1.6.3

Features:
  • Allows you to run MediaWiki with your vBulletin user database
  • Disallows users with invalid username characters
  • Disallows users who are not part of specified usergroups
  • Sets users to sysop status in MediaWiki if they are part of a specified admin usergroup
  • Removes users from sysop status in MediaWiki if they no longer are a part of a specified admin usergroup
  • For same-database setups, allows easy installation

Possible Future Features:
These are possible features for inclusion in the how-to in the future. They have not been investigated for their feasibility, but are here to let you know they have been requested and I am thinking about them. If you know how to add the features, please let us know.
  • No-login required (automatic) integration
  • Option: User profile field points to, or has option to link to vBulletin profile
  • To register, link the user to vBulletin's registration script on the login pages

How to:
  1. Install Reynaldovb's Restrict usernames to alphanumeric and underscore plugin, and disallow both spaces and underscores
  2. Optional: On boards that already have existing users, somehow have their usernames changed so that they are only alphanumeric. This is required if you wish your users to be able to login and edit the wiki using their vBulletin username. The reason you have to do this is because MediaWiki has some Restrictions on what can go in a page title, and as usernames have to be passed as page titles, they also have to adhere to the same restrictions. If you do not change the usernames, I have included a check to not allow users to login if their username contains non-alphanumeric characters.
  3. Open your wiki/LocalSettings.php file
  4. Insert the following code at the end of the file, before the ?>:
    PHP Code:
    # vBulletin integration script
    require_once("AuthPlugin_vBulletin.php");
    // if vBulletin and MediaWiki are not installed on the same database
    // change these values to reflect your vBulletin database information
    $wgAuth = new AuthPlugin_vBulletin($wgDBserver$wgDBuser$wgDBpassword$wgDBname"vb_"); 
    If you are running vBulletin and MediaWiki in the same database, then it already uses the connection information.
    If you are not running vBulletin and MediaWiki in the same database, please change the strings to reflect your vBulletin database information.
    In either case, the last value is whatever your vBulletin table prefix is.
  5. Insert this code below the require_once( "includes/DefaultSettings.php" ); at the top of the LocalSettings.php file:
    PHP Code:
    # Disabling new user registrations
    $wgWhitelistAccount = array ( "sysop" => 1"developer" => );
    # Disabling anonymous edits
    $wgGroupPermissions['*']['createaccount'] = false;
    $wgGroupPermissions['*']['read'] = false;
    $wgGroupPermissions['*']['edit'] = false;
    $wgWhitelistRead = array ("Special:Userlogin"); 
    This prevents people from registering new accounts on the wiki, requiring people to register on vBulletin. It also prevents anonymous edits. This code may only work on MediaWiki 1.5.x and above, but I am unsure.
  6. Download the AuthPlugin_vBulletin.php file and put it in your main wiki directory, ie: /wiki/AuthPlugin_vBulletin.php

Please let me know if this was helpful, or if you can expand on this code.
Attached Files
File Type: php AuthPlugin_vBulletin.php (7.4 KB, 490 views)
Reply With Quote
  #22  
Old 06-06-2006, 06:10 PM
sub_ubi sub_ubi is offline
 
Join Date: Dec 2004
Posts: 177
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

HolisticEarth,

To overcome the username issue, did you look in to the possibility of

Quote:
Making any links to a user's page link to their user page on vBulletin. Theoretically, this would allow people to keep their usernames intact, while not interfering with the MediaWiki namespace.
from

http://meta.wikimedia.org/wiki/VBull...rs_Integration

If so, what did you think about it?
Reply With Quote
  #23  
Old 06-11-2006, 03:25 AM
Cyburbia's Avatar
Cyburbia Cyburbia is offline
 
Join Date: Feb 2002
Location: Ithaca, New York USA
Posts: 159
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm going to bump and ask the same thing.
Reply With Quote
  #24  
Old 06-13-2006, 01:33 AM
HolisticEarth HolisticEarth is offline
 
Join Date: Apr 2006
Location: Winnipeg, MB, CAN
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here I thought summer would come and I would have time to fiddle with things :/.

I have not tried it atm ... has anyone else tried merging the two more fully to use the vB sessions instead?
Reply With Quote
  #25  
Old 06-25-2006, 02:30 PM
yessir's Avatar
yessir yessir is offline
 
Join Date: Jul 2005
Location: Canada
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm not much of a coder but I can certainly test over the summer.

My forum is located in the web root, and I want to also toss my wiki into the web root. Does anyone see a problem with this?

Ideally the wiki is the landing page at www.mydomain. com. Or would I be better off dropping the wiki into a /wiki directory, or moving the forums (urgh) to /forum?

Also, has anyone tried this with vBSEO installed? Any potential .htaccess hacks required?

Thanks in advance.
Reply With Quote
  #26  
Old 06-28-2006, 12:45 AM
offline's Avatar
offline offline is offline
 
Join Date: Oct 2002
Location: Chattanooga, TN
Posts: 51
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I installed this but none of my users can login. Is there a log file or something telling me why this might not be working?

Thanks!
Reply With Quote
  #27  
Old 06-30-2006, 12:50 PM
thumbsucker thumbsucker is offline
 
Join Date: Dec 2005
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is off topic but I tried to install Wiki and got this error.

Anyone know what's wrong?

include all of the lines below when reporting installation problems.

PHP 4.3.11 installed
PHP server API is apache2handler; ok, using pretty URLs (index.php/Page_Title)
Have XML / Latin1-UTF-8 conversion support.
PHP's memory_limit is 32M. If this is too low, installation may fail!
Have zlib support; enabling output compression.
Neither Turck MMCache nor eAccelerator are installed, can't use object caching functions
GNU diff3 not found.
Found GD graphics library built-in, image thumbnailing will be enabled if you enable uploads.
Installation directory: /var/www/vhosts/mysite/httpdocs/mediawiki
Script URI path: /mediawiki
Environment checked. You can install MediaWiki.
Warning: $wgSecretKey key is insecure, generated with mt_rand(). Consider changing it manually.
Generating configuration file...

Database type: mysql
Parse error: parse error, unexpected $, expecting '}' in /var/www/vhosts/mysite/httpdocs/mediawiki/includes/Database.php on line 459
Reply With Quote
  #28  
Old 07-02-2006, 11:15 AM
mickmel mickmel is offline
 
Join Date: Feb 2002
Location: Atlanta, GA
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Will this work with vB 3.6.x and MW 1.6.7?
Reply With Quote
  #29  
Old 07-05-2006, 10:43 AM
Deimos Deimos is offline
 
Join Date: Oct 2002
Posts: 529
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm getting the same problem

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/xxx/public_html/wiki/AuthPlugin_vBulletin.php on line 90

I've double checked the login details for the database, all are ok
Reply With Quote
  #30  
Old 07-05-2006, 11:38 PM
thumbsucker thumbsucker is offline
 
Join Date: Dec 2005
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is support for this alive?

I filled in my DB info in the mediawiki config file but no one from vbulletincan login.
Reply With Quote
  #31  
Old 07-06-2006, 04:44 AM
HolisticEarth HolisticEarth is offline
 
Join Date: Apr 2006
Location: Winnipeg, MB, CAN
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't want to sound negative, but I dont have the time to support this ... it was a How-To because I dont have the time to make it a perfect add-on / hack / etc., and the old How-To was non-existant.

For vB 3.5.4 and MW 1.6.7, and my original installation method, my installation still works logging in and logging out. I'll try putting it in user.php instead of LocalSettings.php tomorrow and let you know how it works out...
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:25 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05567 seconds
  • Memory Usage 2,337KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete