vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   Integration with vBulletin - Patch to vbWikiStandard for vb 3.7 & mediaWiki 1.12 (https://vborg.vbsupport.ru/showthread.php?t=184903)

Michael Morris 07-09-2008 10:00 PM

Patch to vbWikiStandard for vb 3.7 & mediaWiki 1.12
 
The following is a hack of an existing plugin the author abandoned and which stopped working when vbulletin upgraded to 3.7 and mediaWiki changed to version 1.12 - the two of which happen to be the latest versions of their respective software. The file change below will allow the hack to work with vb 3.7 and Media Wiki 1.12. If you are using older versions of either I would recommend using the elfMage's product in it's original form.

You will need to start by installing MediaWiki seperately and then uploading vbWikiStandard and following its instructions. Here is a link to that product.

https://vborg.vbsupport.ru/showthread.php?t=136242

Note the requirements are a bit higher - mediaWiki 1.12 requires PHP 5. This mod has only been tested on vb 3.7

Once you have completed the instructions of that product open file arcane_vbulletin_core.php - its part of the vbWiki package and find this code:

PHP Code:

// Include vBulletin Engine
    
if ($g_vbWiki_StyleId_Override 0)
    {
        
define('VB_AREA''Forum');
        require_once(
'./includes/init.php');
        
$vbulletin->options['styleid'] = $g_vbWiki_StyleId_Override;
        
$vbulletin->options['allowchangestyles'] = false;                    // ignore user styles
        
$vbulletin->userinfo['styleid'] = 0;
    }
    
    require_once(
'./global.php');
    require_once(
'./includes/functions_login.php');
    require_once(
"./includes/functions.php");                // vbdate
    
require_once("./includes/functions_forumdisplay.php");
    require_once(
"./includes/functions_newpost.php");
    require_once(
"./includes/adminfunctions.php" ); 

Replace with this code.

PHP Code:

    require_once('./global.php');

    if ((empty(
$_SESSION['wsUserID']) || empty($_SESSION['wsUserName']) || empty($_SESSION['wsToken'])) 
        && !empty(
$_COOKIE[$wgDBname.'_'.$wgDBprefix.'UserName']))
    {
        
$_SESSION array_merge$_SESSION$db->query_first("SELECT 
            user_id AS wsUserID,
            user_name AS wsUserName,
            user_token AS wsToken
            FROM "
.$wgDBname.".".$wgDBprefix."user
            WHERE user_name = '"
.addslashes($_COOKIE[$wgDBname.'_'.$wgDBprefix.'UserName'])."' LIMIT 1"));
    } 

I have tested this for 2 weeks on EN World, a site that gets about 22,000 hits / day and it appears stable. We've had a few isolated instances of users stating they are getting logged off, but I believe that's because they are running cookie blockers.

Do not attempt using this hack with vbWikiPro - for optimization I removed the loading of several libraries pro requires. If there is enough interest in this bridge still I will consider wholly rewriting the bridge to tighten up integration further. In the interim though this seems to work.

I will provide what support I can but be warned the original hack has been abandoned and outside the changes I've made in this mod your guess is as good as mine.

jlew24asu 07-10-2008 12:21 PM

any screenshots? this sounds interesting.

Michael Morris 07-10-2008 12:22 PM

Here's ENWorld's wiki

http://www.enworld.org/wiki/index.php

That said the original product has screenshots.

nexialys 07-10-2008 12:47 PM

and for the Pro version, any idea ?!... ;)

Dismounted 07-10-2008 02:13 PM

Michael, we require all mods to be in files, could you please do this? You can simply put the instructions into a text file and attach it.

Thanks,
Dismounted

Michael Morris 07-10-2008 02:20 PM

I can this evening. I'm on a work computer at the moment.

Dismounted 07-10-2008 02:31 PM

That will be fine.

Michael Morris 07-10-2008 07:25 PM

As requested the instructions file has been uploaded.

Quantnet 07-11-2008 01:02 AM

Quote:

Originally Posted by nexialys (Post 1571903)
and for the Pro version, any idea ?!... ;)

I"m running the pro version on Vb 3.7.2 for over a year.
That said, I haven't updated my mediawiki to the latest version since I don't know if it's worth it.

Smitty 07-11-2008 01:19 AM

Quote:

Originally Posted by Quantnet.org (Post 1572418)
I"m running the pro version on Vb 3.7.2 for over a year.
That said, I haven't updated my mediawiki to the latest version since I don't know if it's worth it.

3.7.2 hasn't been out for a year. I'm using the pro version as well, though, and have upgraded to vB 3.7.2 (last weekend). Using Mediawiki 1.11.0

Q-v-n-s-Q 07-11-2008 01:58 AM

i don't have mediawiki install :(

Michael Morris 07-11-2008 03:35 AM

<a href="https://www.mediawiki.org" target="_blank">http://www.mediawiki.org</a>

mokonzi 07-11-2008 04:23 AM

I've been running the vbWiki Pro for a while, but didn't realise there was a lite version of the script.

What is the chance of being able to create a backwards compatibility for this script?

redlabour 07-11-2008 05:05 AM

Quote:

Originally Posted by mokonzi (Post 1572495)
I've been running the vbWiki Pro for a while, but didn't realise there was a lite version of the script.

What is the chance of being able to create a backwards compatibility for this script?

vBWiki is dead and will not longer be supported or saled. Search for a Alternative!

BTW - nice Idea - but in fact that vBWiki is dead i believe this "Bridge" is useless. A Importer from vBWiki -> MediaWiki will make more Sense.

Michael Morris 07-11-2008 05:11 AM

vbWiki *is* mediaWiki. All the bridge does is keep the user names in sync.

mokonzi 07-11-2008 05:19 AM

Thanks Michael. So it should work if I uninstall vbWikiPro? I'll test this over the weekend and let you know my results.

@ redlabour, I'm well aware vbWikiPro is dead, hence my question.

Michael Morris 07-11-2008 12:25 PM

Instead of replacing the above code try inserting this underneath the above code for pro. I can't test it because I don't have pro - but it might work. Worth a shot.

PHP Code:

 if ((empty($_SESSION['wsUserID']) || empty($_SESSION['wsUserName']) || empty($_SESSION['wsToken'])) 
        && !empty(
$_COOKIE[$wgDBname.'_'.$wgDBprefix.'UserName']))
    {
        
$_SESSION array_merge$_SESSION$db->query_first("SELECT 
            user_id AS wsUserID,
            user_name AS wsUserName,
            user_token AS wsToken
            FROM "
.$wgDBname.".".$wgDBprefix."user
            WHERE user_name = '"
.addslashes($_COOKIE[$wgDBname.'_'.$wgDBprefix.'UserName'])."' LIMIT 1"));
    } 


Jon_Simmonds 07-11-2008 06:41 PM

Quote:

Originally Posted by Michael Morris (Post 1572761)
Instead of replacing the above code try inserting this underneath the above code for pro. I can't test it because I don't have pro - but it might work. Worth a shot.

PHP Code:

 if ((empty($_SESSION['wsUserID']) || empty($_SESSION['wsUserName']) || empty($_SESSION['wsToken'])) 
        && !empty(
$_COOKIE[$wgDBname.'_'.$wgDBprefix.'UserName']))
    {
        
$_SESSION array_merge$_SESSION$db->query_first("SELECT 
            user_id AS wsUserID,
            user_name AS wsUserName,
            user_token AS wsToken
            FROM "
.$wgDBname.".".$wgDBprefix."user
            WHERE user_name = '"
.addslashes($_COOKIE[$wgDBname.'_'.$wgDBprefix.'UserName'])."' LIMIT 1"));
    } 


will let you know how I get on with that over the weekend - thanks :)

Arkidas 07-13-2008 11:31 AM

It doesn't work. Anyway I'm not really having a lot of problems with vbwiki pro + media wiki 1.12 + vB 3.7.1. The only issue I'm having is that the search and quick links drop down menus wont work. Do you know how to fix them?

tazzarkin 07-13-2008 11:40 AM

Quote:

Originally Posted by Arkidas (Post 1574165)
It doesn't work. Anyway I'm not really having a lot of problems with vbwiki pro + media wiki 1.12 + vB 3.7.1. The only issue I'm having is that the search and quick links drop down menus wont work. Do you know how to fix them?

------------------------------

Actually, they work fine for me (vbwikipro + mw 1.12 + vb 3.7.1). Could it be the specific style you're using?

tazzarkin 07-13-2008 11:53 AM

Quote:

Originally Posted by redlabour (Post 1572519)
BTW - nice Idea - but in fact that vBWiki is dead i believe this "Bridge" is useless. A Importer from vBWiki -> MediaWiki will make more Sense.

mediawiki 1.12 is still alive. And this is a bridge to vbulletin. I think redlabour is a little confused.

Quote:

Originally Posted by mokonzi (Post 1572539)
@ redlabour, I'm well aware vbWikiPro is dead, hence my question.

Actually, vbWikiPro is working quite well for me with mw 1.12 + vb 3.7.1 My only problem was with a cookies/login issue, but there is an easy fix on nuhit.com (FIX FOR vbWikiPRO ONLY):

Quote:

Originally Posted by kremer4
Think I got it, edit the file "/vbWiki/vbWiki_Auth.php"

Put // infront of the following lines

$user->logout();
global $wgEnableParserCache, $wgParser, $wgOut, $wgCachePages;

So it should be

//$user->logout();
//global $wgEnableParserCache, $wgParser, $wgOut, $wgCachePages;

Let me know if this works for you. I also made one other change but I don't think it's related. If this does not work then I'll post the other change I made.
However, after using this fix, it doesn't clear the cookies completely and it makes it look like the user is still logged in when he's really not. But it does seem to work other than that.

By the way, I really hope that Michael Morris can make this integration better as he stated up above,
Quote:

Originally Posted by Michael Morris (Post 1572527)
If there is enough interest in this bridge still I will consider wholly rewriting the bridge to tighten up integration further.

I really hope that you can keep improving this. Thank you again for keeping this alive!! I'm still using vbWikiPro, but I would love to have this as an alternative.

Arkidas 07-13-2008 09:11 PM

I was referring to Simmonds possible fix for vbwiki pro.

MikeH2911 07-14-2008 10:08 PM

Just used this patch with mediawiki 1.12 and vb 3.7.2 forums are working fine, wiki is working fine but any attempts to view the wiki whilst logged in results in me being logged out from both. Any ideas why?

iRO Wiki 07-15-2008 08:37 PM

Same thing is happening to me on our test install, logged in on the forums, then if I try going to the wiki, it redirects to the forums and logs me out...

Michael Morris 07-16-2008 06:37 AM

cookies must be enabled for this patch to work. I haven't been able to get it to work when cookies are disabled.

The underlying problem is vbulletin stores session information in the database whereas wiki stores it in $_SESSION. vbulletin doesn't even use $_SESSION.

sinucello 07-17-2008 05:27 AM

Hi,
Quote:

Originally Posted by tazzarkin (Post 1574171)
By the way, I really hope that Michael Morris can make this integration better as he stated up above,

you`re using a commercial add-on for vBulletin that costs $60 USD and are hoping for an indipendant programmer here on vb.org to fix this product? That doesn`t sound like NuHIT offers a reliable, well supported solution.

At the moment I`m using this solution
http://www.mediawiki.org/wiki/Extens...rs_Integration
which offers no skin support. So vBWiki Pro would be interesting for me but not if I it keeps me from updating MediaWiki and vBulletin because I have to wait ages until they officially support the latest versions.

Maybe someone can comment on this.

Thanks and all the best,
Sacha

Smitty 07-17-2008 06:03 AM

Quote:

Originally Posted by sinucello (Post 1577435)
That doesn`t sound like NuHIT offers a reliable, well supported solution.

NuHIT is for all intents and purposes gone. There's still a web site and I *think* they'll still take someones money, but essentially the products have been abandoned. This is no secret and has been discussed in other threads. I bought the pro package quite a while back. It's still working for me.

sinucello 07-17-2008 07:03 AM

Hi Smitty,

thanks for the info.

best,
Sacha

iRO Wiki 07-22-2008 05:38 PM

Quote:

Originally Posted by Michael Morris (Post 1576561)
cookies must be enabled for this patch to work. I haven't been able to get it to work when cookies are disabled.

The underlying problem is vbulletin stores session information in the database whereas wiki stores it in $_SESSION. vbulletin doesn't even use $_SESSION.

As far as I know, cookies are enabled. The issue is, when we log into the forum, then browse to the wiki, it redirects back to the forum logout page...

rinkrat 07-29-2008 12:47 AM

Works for me thanks

GoodOmens 07-29-2008 12:59 PM

I get the following "Warning: array_merge() [function.array-merge]: Argument #1 is not an array" regarding

Code:

$_SESSION = array_merge( $_SESSION, $db->query_first(....

RRicart 07-30-2008 01:04 AM

Warning: require_once(mysante2/public_html/atrwiki/SpecialPage.php) [function.require-once]: failed to open stream: No such file or directory in /home/mysante2/public_html/members/forums/vbWiki/vbWiki_Userlogin.php on line 14

Fatal error: require_once() [function.require]: Failed opening required 'mysante2/public_html/atrwiki/SpecialPage.php' (include_path='.:/home/mysante2/public_html/members/include/') in /home/mysante2/public_html/members/forums/vbWiki/vbWiki_Userlogin.php on line 14

I get this error.

cosy 07-31-2008 10:35 PM

plz for PRO version plzzz

Michael Morris 08-01-2008 04:42 PM

Quote:

Originally Posted by GoodOmens (Post 1586642)
I get the following "Warning: array_merge() [function.array-merge]: Argument #1 is not an array" regarding

Code:

$_SESSION = array_merge( $_SESSION, $db->query_first(....

My guess without looking into it deeply is that sessions are disabled. $_SESSION is a superglobal and should be present after session_start(); is called (which mediaWiki does). If it isn't present then PHP was unable to start a session. In the absense of sessions I'm unsure how to go about bridging this.

Eventually I will write a new bridge - the code above is a bit of a kludge to get things to work - passed along in the hopes in might be useful.

GoodOmens 08-03-2008 11:20 PM

Interesting adding session start before the mege_array function fixed the problem.

I wonder why it's not being called before?

TheGreatTK 08-06-2008 02:55 PM

W00t! This fixed the logout problems everybody on my board was having!

Thanks a lot, Michael!

Rein Masamuri 08-08-2008 12:22 PM

Well I have it set up, but now the users will not log off of the wiki when they log out of the forums.
I have vbWikiStandard and the pro fix doesn't seem to work...

chris1979 08-09-2008 06:23 PM

Hmm. I paid for the vbwikipro product and can't get it from their members area. :down:

I might have to use this free version instead.

domaino 08-12-2008 11:05 PM

Hi Michael,

Would love to be able to use this hack but unfortunately, whenever I go to access my wiki it comes up with the following:

Warning: require_once(public_html/forum/vbWiki/vbWiki_Init.php) [function.require-once]: failed to open stream: No such file or directory in /home/domaino/public_html/wiki/LocalSettings.php on line 126

Fatal error: require_once() [function.require]: Failed opening required 'public_html/forum/vbWiki/vbWiki_Init.php' (include_path='/home/domaino/public_html/wiki:/home/domaino
/public_html/wiki/includes:/home/domaino/public_html/wiki/languages:.:
/usr/lib/php:/usr/local/lib/php') in /home/domaino/public_html/wiki/LocalSettings.php on line 126

Any ideas where I'm going wrong?

Thanks in advance,
domaino :)

Rein Masamuri 08-13-2008 01:19 AM

Quote:

Originally Posted by domaino (Post 1597352)
Hi Michael,

Would love to be able to use this hack but unfortunately, whenever I go to access my wiki it comes up with the following:

Warning: require_once(public_html/forum/vbWiki/vbWiki_Init.php) [function.require-once]: failed to open stream: No such file or directory in /home/domaino/public_html/wiki/LocalSettings.php on line 126

Fatal error: require_once() [function.require]: Failed opening required 'public_html/forum/vbWiki/vbWiki_Init.php' (include_path='/home/domaino/public_html/wiki:/home/domaino
/public_html/wiki/includes:/home/domaino/public_html/wiki/languages:.:
/usr/lib/php:/usr/local/lib/php') in /home/domaino/public_html/wiki/LocalSettings.php on line 126

Any ideas where I'm going wrong?

Thanks in advance,
domaino :)


I had the same problem. Double check your paths, you're probably pointing to the wrong one.

Does anyone know how to do sysops stuff with this bridge? Is a regular user on the forums a regular user on the wiki, and admin on the forums a sysop on the wiki?


All times are GMT. The time now is 04:59 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01799 seconds
  • Memory Usage 1,866KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (4)bbcode_php_printable
  • (14)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete