This is the basics for creating a xoops module while being able to use permissions such as access rights:
Create a folder in the modules directory:
ex:
mkdir /home/user/public_html/modules/newdirectory
Then, add the pages you want viewable in that directory such as:
Create a default
index.php for the module
<?php
include("../../mainfile.php");
include(XOOPS_ROOT_PATH."/header.php");
$xoopsOption['show_rblock'] = 1;
?>
<!-- Start add html/php here -->
<!-- End of add html/php -->
<?php
include(XOOPS_ROOT_PATH."/footer.php");
?>
You will also want to add
xoops_version.php so the module may be installed:
<?php
$modversion['name'] = "name of module";//name of module
$modversion['version'] = 1.0;
$modversion['description'] = "description of module";
$modversion['author'] = "Your Name";
$modversion['credits'] = "Company Name";
$modversion['help'] = "";
$modversion['license'] = "GPL see LICENSE";
$modversion['official'] = 0;
$modversion['image'] = "logo.gif";
$modversion['dirname'] = "module-folder-name";//name of directory on server
// Admin things
$modversion['hasAdmin'] = 1;
$modversion['adminpath'] = "";
// Menu/Sub Menu
$modversion['hasMain'] = 1;//make 0 to not have this appear in main menu
$modversion['sub'][1]['name'] = _MI_MYPAGE_SMNAME1;
$modversion['sub'][1]['url'] = "../../modules/module-folder-name/link1.php";
$modversion['sub'][2]['name'] = _MI_MYPAGE_SMNAME2;
$modversion['sub'][2]['url'] = "../../modules/module-folder-name/link2.php";
$modversion['sub'][2]['name'] = _MI_MYPAGE_MYPHPFILE;
$modversion['sub'][2]['url'] = "link3.php";//ANY PHP FILE IN SAME FOLDER AS MODULE
?>
Then you may install as a module, and change permissions in blocks/groups.