LoginSignup
2
2

More than 5 years have passed since last update.

モジュール外のページをXOOPSのテーマで表示する

Posted at

参考 http://www.xugj.org/modules/QandA/index.php?topic_id=228

XOOPS2のときは下記でOKでした。

<?php
include_once "../mainfile.php";
include_once XOOPS_ROOT_PATH."/header.php";
?>
<div>
  ここでHTML
</div>
<?php
include_once XOOPS_ROOT_PATH."/footer.php";
?>

XOOPS Cube Legacy2.1以降は下記のようにする必要があります。

<?php

function begin_special_page()
{
    require_once XOOPS_MODULE_PATH . "/legacy/kernel/Legacy_Module.class.php";

    $handler =& xoops_gethandler('module');
    $module =& $handler->getByDirname('legacy');

    $root =& XCube_Root::getSingleton();
    $root->mContext->mModule =& new Legacy_ModuleAdapter($module);
    $root->mContext->mModule->mXoopsModule =& $module;
    $root->mContext->mXoopsModule =& $module;
}

include_once "../mainfile.php";
include_once XOOPS_ROOT_PATH."/header.php";

begin_special_page();

?>
<div>
  ここでHTML
</div>
<?php

include_once XOOPS_ROOT_PATH."/footer.php";
?>
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2