IPB - 在自定义页面中包含模板

时间:2015-03-15 18:48:39

标签: php templates template-engine ipb

我愿意拥有使用与我的IP.Board相同模板的自定义页面,但我想避免使用任何插件来实现相同的目标。
目前我有:

<?PHP
//define( 'IPS_ENFORCE_ACCESS', TRUE ); // Important so it does not redirect to forums
define( 'IPB_THIS_SCRIPT', 'public' );
require_once( 'initdata.php' );
require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' );
require_once( IPS_ROOT_PATH . 'sources/base/ipsController.php' );

$ipbRegistry    = ipsRegistry::instance();
$ipbRegistry->init();

$output = $ipbRegistry->getClass('output');
$output->addContent("<h1>Well, this is a test! </h1>");
$output->setTitle("Test page");
$output->sendOutput();

这段代码实际上效果不错。它输出自定义页面,也有IP.Board模板,但模板是默认模板,而不是我在论坛上使用的模板。
如何在我的自定义页面中包含IP.Board模板? 可能我在我的脚本中缺少一些调用,有些调用应该使用的安装模板? 我愿意使用的自定义页面位于同一目录和同一域中。

对于MyBB,它的工作原理如下:

<?PHP
require "global.php";

// Some simple calls to initialize and set variables used below
// -------------------------------------------------------------
// Output HTML + required code from MyBB previously defined
echo "<!doctype html>
{$mybb_header}
<body>
<p>Some content</p>
{$mybb_footer}
</body>
</html>";

0 个答案:

没有答案