11
EDITED SO YOU CAN HAVE THE INFORMATION FOUND AT
https://xoops.org/modules/smartfaq/faq.php?faqid=280Quote:
Don't reinvent the wheel, use an existing module.
With the module repository you will find some very good modules.
If you want to display your own html content here's an idea...
Sometimes it is preferable to display your own html content in a module and not a block. This can be achieved very easily with just 2 files and a new module folder.
The following is adapted from a module called mypage by JackJ http://www.macambridge.com
create 2 php files as follows
1- index.php
2- xoops_version.php
index.php contains
include("../../mainfile.php");
include(XOOPS_ROOT_PATH."/header.php");
$xoopsOption['show_rblock'] = 1;
?>
your html goes here ...
include(XOOPS_ROOT_PATH."/footer.php");
?>
And xoops_version.php contains
$modversion['name'] = "mypage";//name of module
$modversion['version'] = 1.01;
$modversion['description'] = "My Module";
$modversion['author'] = "";
$modversion['credits'] = "";
$modversion['help'] = "";
$modversion['license'] = "GPL see LICENSE";
$modversion['official'] = 0;
$modversion['image'] = "whatever.gif";
$modversion['dirname'] = "mypage";//name of directory on server
// Admin things
$modversion['hasAdmin'] = 0;
$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/ipboard/";
$modversion['sub'][2]['name'] = _MI_MYPAGE_SMNAME2;
$modversion['sub'][2]['url'] = "../../modules/weblog/";
$modversion['sub'][2]['name'] = _MI_MYPAGE_MYPHPFILE;//ANY PHP FILE IN SAME FOLDER AS MODULE
$modversion['sub'][2]['url'] = "myphpfile.php";
?>
- The $modversion lines are not needed--but if used they add the submenus that appear in your main menu when the page is loaded.
- define this text _MI_MYPAGE_SMNAME1 in: (this text can be different as long as it matches the language defines)
- language defines language/english/global.php i.e.
- define("_MI_MYPAGE_SMNAME1","Forum");//whatever you wish
- define("_MI_MYPAGE_SMNAME2","User Journals");
Then create a directory in your modules folder, call it anything you wish, but make sure it matches these lines:
$modversion['name'] = "mypage";//name of module
$modversion['dirname'] = "mypage";//name of directory
Upload into the folder:
index.php (With any HTML content added)
and xoops_version.php
and any image file named in: $modversion['image'] = "whatever.gif";
Then go to admin and install the module
You can do this multiple times, just call them different names as above.
See also this FAQ HERE
--- Additional details submitted by Misatbt on 19-Dec-2004 06:35
Quote:
- language defines language/english/global.php i.e.
for me better use modinfo.php then global.php
Misa
This solution was found by the original poster, Tapioca, on FAQ...
BS