Quote:
Originally Posted by Dragonsys
Try setting the include file a var:
Code:
if (file_exists($CWD.'/blockscript/detector.php')) {
$bs_detector_path = $CWD.'/blockscript/';
}
Then add this to the bottom of your PHP Code:
Code:
ob_start();
include($bs_detector_path.'detector.php');
$includedphp = ob_get_contents();
ob_end_clean();
Use the global_start hook, instead of init_startup
Unless you are using an external (to VB) file, $CWD should be the root VB folder, so you should not need to check it several times.
|
Thank you for the response! I'm a little confused, but is this what the code should end up looking as?
HTML Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<product productid="blockscript" active="1">
<title>BlockScript vBulletin Integration</title>
<description>BlockScript vBulletin Integration</description>
<version>1.0</version>
<url>http://www.blockscript.com/</url>
<versioncheckurl />
<dependencies />
<codes />
<templates />
<plugins>
<plugin active="1" executionorder="1">
<title>BlockScript vBulletin Integration</title>
<hookname>init_startup</hookname>
<phpcode><![CDATA[if (is_member_of($vbulletin->userinfo, array(1,2,3,4,8,17,19,20,26,15,22,16,14,18,21)))
{
if (file_exists($CWD.'/blockscript/detector.php')) {
$bs_detector_path = $CWD.'/blockscript/';
}
if (file_exists(CWD.'/blockscript/detector.php')) {
include_once(CWD.'/blockscript/detector.php');
} elseif (file_exists(CWD.'/../blockscript/detector.php')) {
include_once(CWD.'/../blockscript/detector.php');
} else {
include_once(CWD.'/../../blockscript/detector.php');
}
ob_start();
include($bs_detector_path.'detector.php');
$includedphp = ob_get_contents();
ob_end_clean();
}]]> </phpcode>
</plugin>
</plugins>
<phrases />
<options />
<helptopics />
<cronentries />
<faqentries />
</product>