static content to xoops - the second way

static contentThis is another easy way to add static content to xoops without too much work. When you have already read the article about the easiest way to add static content to XOOPS, you might be interested to get another possibility. Here are the steps to create your “own module” and to include your static content and you will find a zip version to download at the end of article. The advantage of this way is, that you can have a link in mainmenu and that you can set blocks in blockadministration on the sites of your “new module”. It will be registered like a normal module.

I. Fire up your ftp-client and create a folder you want to name your “new module” within the folder /modules/ of your XOOPS installation. In my example I will use the name of folder “xoops-static-content”.

II. Now, open your preferred editor or a simple text-editor and create a file called “index.html” with the following content:

<script>history.go(-1);</script>

This will prevent your folder to be accessed directly via browser. (When you do not want to have an index.php eg. in case that you want no entry within mainmenu).

III. Then create another file called “xoops_version.php” with the content:

Copy and paste the source may cause problems, for wp does not display code stuff correct here! Just download the small file you will find at the end of article and extract to your computer!

< _ ?_ php
$modversion['name'] = "static content"; // name of module which will be displayed in moduladmin
$modversion['version'] = 1.0; // create a version for your module
$modversion['description'] = "add static content to xoops"; // put a description here
$modversion['author'] = "michael hokamp aka studioC"; // here is the place for the author
$modversion['credits'] = "xoopsfactory.com"; // give credits to xoops, your mum, or any other :-)
$modversion['license'] = "GPL see LICENSE"; // want to license your creation?
$modversion['official'] = 0; // no, it isn't is it?
$modversion['image'] = "images/logo.png"; // want to have a logo in moduladmin
$modversion['dirname'] = "xoops-static-content"; // here the name of folder which is !!! important !!! to spell exactly
$modversion['hasAdmin'] = 0; // no, we havn't
$modversion['adminpath'] = ""; // so we have no path to admin
$modversion['hasMain'] = 1; // of course :-)
$modversion['sub'][1]['name'] = "example content"; // displaying submenu entries? when you want, this is the name of sublink
$modversion['sub'][1]['url'] = "example-content.php"; // this is the file which is displayed as submenu
// have fun and happy xoopsing!
_?_>

(using “_” here within php open and close!)

IV. Create a file called index.php with the following content:

<_ ?_php
include("../../mainfile.php");
include(XOOPS_ROOT_PATH."/header.php");
// the following will overwrite xoops default when uncommented
// $xoopsTpl->assign(’xoops_pagetitle’, ‘Add a pagetitle here and uncomment when you want to use this feature’);
// $xoopsTpl->assign(’xoops_meta_description’, ‘Add your meta description here and uncomment when you want to use this feature’);
_?_>

<h2>Pagetitle</h2>

<p>Here is the place to add you content.</p>

<_ ?_php
include(XOOPS_ROOT_PATH.”/footer.php”);
_?_>

V. When you have saved the file save same file again as “example-content.php” so that there are 2 files (same content though).

VI. Upload the four files into the folder you created for this.

VII. You should now be able to install this like any other xoops module!

VIII. Do it!

IX. Now add more files when you want! Add them in xoops_version to submenu entries and update module or just link to content from theme.html or a block. Within blocksadministration you should be able to set custom blocks on your module.

X. Have FUN!

Download example files when you want to play with it here!
ZIP version of xoops-static-content.





Leave a Reply

You must be logged in to post a comment.


SITES of the MONTH : 08/2005: linux-gamers.net - fireworks.verno.ru | 09/2005: viapontedinona.it
10/2005: RF Online Base | 11/2005: FREE-EOS | 12/2005: Asian Car Styling | 01/2006: DSLnachPankow.de
02/2006: Roma Victor Camp | 03/2006: NABUUR.COM | 04/2006: Styling+Design-Noord | 05/2006: VETOFISH
06/2006: Utah Antique Machinery News | 07/2006: lebuccaneer.com | 08/2006: Top-logiciel
09/2006: Concrete Connections | 10/2006: Fios Uniao | 11/2006: Casafree Maroc | 12/2006: Ainpg.com
1/2007: Parent Solo


xoopsfactory.com/blog powered by WordPress | Entries (RSS) | Comments (RSS)
Kugelschreiber, Buntstifte und mehr