Quote:
Originally Posted by Jennifer2010
Thank you for the response! I'm a little confused, but is this what the code should end up looking as?
|
Something like this:
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>global_start</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/';
ob_start();
include($bs_detector_path.'detector.php');
$includedphp = ob_get_contents();
ob_end_clean();
}
elseif (file_exists(CWD.'/../blockscript/detector.php')) {
$bs_detector_path = $CWD.'/../blockscript/';
ob_start();
include($bs_detector_path.'detector.php');
$includedphp = ob_get_contents();
ob_end_clean();
}
elseif {
$bs_detector_path = CWD.'/../../blockscript/';
ob_start();
include($bs_detector_path.'detector.php');
$includedphp = ob_get_contents();
ob_end_clean();
}
else {
$includedphp = "<!-- File Not Found -->";
}
vB_Template::preRegister('FORUMHOME',array('includedphp' => $includedphp));
}]]> </phpcode>
</plugin>
</plugins>
<phrases />
<options />
<helptopics />
<cronentries />
<faqentries />
</product>
if blockscript/detector.php is inside the VB path, then you should be able to use this (without all the different folder searches):
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>global_start</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/';
ob_start();
include($bs_detector_path.'detector.php');
$includedphp = ob_get_contents();
ob_end_clean();
}
else {
$includedphp = "<!-- File Not Found -->";
}
vB_Template::preRegister('FORUMHOME',array('includedphp' => $includedphp));
}]]> </phpcode>
</plugin>
</plugins>
<phrases />
<options />
<helptopics />
<cronentries />
<faqentries />
</product>
Then you need to register the variable, change FORUMHOME (in the above code) to the template which you plan on including this in.
Then in the template, where you want the included file to appear you put this:
Code:
{vb:raw includedphp}
All of this may need some tweaking to work perfectly, but hopefully it will get you started in the right direction