Log in

View Full Version : vB Variables and MediaWiki


LanciaStratos
01-28-2006, 08:57 PM
Is there any way to get a logged-in user's usergroupid on my MediaWiki installation? I tried require_once('../forum/global.php'); but it returned errors. Is there another way to do this?

LanciaStratos
02-01-2006, 02:17 AM
Any ideas? Anyone...?

Hellcat
02-01-2006, 02:25 AM
What exactely do you want to do?

LanciaStratos
02-01-2006, 02:29 AM
I just want to prevent users in a certain usergroup from seeing a block of code in the Wiki's skin. In this case, I don't want to show ad code to forum subscribers.

Hellcat
02-01-2006, 02:45 AM
Hmm, for that just including the global.php (like you did it) should do the trick....

What errors are you getting?

LanciaStratos
02-01-2006, 02:56 AM
Here's the error message:


Warning: main(/home/gtplanet/public_html/guides/includes/init.php): failed to open stream: No such file or directory in /home/gtplanet/public_html/forum/global.php on line 20

Fatal error: main(): Failed opening required '/home/gtplanet/public_html/guides/includes/init.php' (include_path='.:/home/gtplanet/public_html/guides:/home/gtplanet/public_html/guides/includes:/home/gtplanet/public_html/guides/languages') in /home/gtplanet/public_html/forum/global.php on line 20

It's obviously looking for init.php in the wrong place, but I don't know how to change that? :confused:

Here's how I included the file in the beginning of my MediaWiki skin:

<?php
/**
* MonoBook nouveau
*
* Translated from gwicke's previous TAL template version to remove
* dependency on PHPTAL.
*
* @todo document
* @package MediaWiki
* @subpackage Skins
*/

if( !defined( 'MEDIAWIKI' ) )
die();

/** */
require_once('../forum/global.php');
require_once('includes/SkinTemplate.php');

/**

Marco van Herwaarden
02-01-2006, 08:17 AM
Try replacing:
require_once('../forum/global.php');
By:
chdir('../forum');
require_once('./global.php');
chdir('../guides');

LanciaStratos
02-20-2006, 03:40 AM
Sorry I couldn't get back to this thread sooner - I've been crazy busy. Anyway, thanks for your help Marco! However, the following code still seemed to return a similar error. :(

<?php
/**
* MonoBook nouveau
*
* Translated from gwicke's previous TAL template version to remove
* dependency on PHPTAL.
*
* @todo document
* @package MediaWiki
* @subpackage Skins
*/

if( !defined( 'MEDIAWIKI' ) )
die();

/** */
chdir('../forum');
require_once('./global.php');
chdir('../guides');
require_once('includes/SkinTemplate.php');

Fatal error: Call to a member function on a non-object in /home/gtplanet/public_html/forum/includes/functions.php on line 1008

Any other ideas?

Hammon
05-10-2006, 10:32 AM
I am trying to include vbulletin into the Content Management System Typo3 in exactly the same way and the same error appears.
Please let me know if anyone knows a solution how how to solve this.
I'm doing the same with e107 with the same result. I'm also interested in a solution.