GBM Documentation

Basic Software Layout

I will list here the various common files and folders to be found in the basic installation of the GBM software. Please keep in mind that this will change as code is updated / added to the projet, so this may not always be 100% accurate; however, we'll do our best to make sure that it doesn't get to be too far out of date.

Directory Structure

ROOT_DIR

DIRECTORIES
-- content
user_uploaded or otherwise content, for such items as the download module
-- gbm-functions
core software functions and template parsing utils. also contains config file
-- gbm-themes
theme directory storage - put your custom theme in this directory
-- images
image store for core software imagery
BASE FILES
-- modules.ini
-- index.php
-- locked.php
-- validate_email.php
MODULES (includes both a .php and a .ini file)
-- admin_add_cats
-- admin_add_items
-- admin_add_member
-- admin_add_news
-- admin_del_cats
-- admin_del_items
-- admin_del_member
-- admin_del_news
-- admin_edit_item
-- admin_edit_member
-- admin_requests
-- admin_reset_pass
-- change_pass
-- downloads
-- edit_profile
-- items
-- logout
-- members
-- news
-- requests
-- signup
-- summary
-- updateitemcache
-- user_login_stat
-- validate_registration

Module Definition

Currently, it is quite easy to add a new module to the GBM software. It simply requires a few basic parameters be met in the module file itself, and that a .ini file is created with specific parameters for it.
With that, it can be added to the modules.ini file so that it is incorporated into your dynamically generated menu, and is accessible to the user through the software.

THE PHP FILE(S)

In your module's .php file, (that which is to be executed when the user requests it by the link in your menu,) the only true requirement is this:

Any output which is to be displayed to the user, must be called from within a function called "run_module".

With that said, you can process any code you like from outside that function, or even execute things once the module is loaded and not necessarily run, but only content that it output from within the run_module function will be properly incorporated into your site's template.

THE INI FILE

There are only a couple parameters currently required in the ini file, and adding more doesn't (at the moment) allow you to easily access the parameters you set from within the application. This is something that we have planned to add in the future, but currently you may have to implement yourself if you require further configuration parameters for your module.

Here are the base items that are required of your module's .ini file:

[module_id]
module_name = "Add New Category"

[module_perms]
domain = "admin"

Set 'module_name' to whatever you would like displayed for the link to your module in the site navigation menu.
Set 'domain' to one of 'public', 'member', or 'admin' in order to restrict access to it to one of those three groups. If you restrict it to 'member', anyone with a username / password for the site will have access to it once they log in. Similary, if you choose 'admin', only a user with an administration bit will have access to that module. (Currently there is not a more restrictive option for choosing what admins / what members have access to a module.)

MODULES.INI

When adding to the modules.ini file, you have some more customization that you can do. Optionally, if you are using the default menu parsing function, you can add different link groupings to the menu, by simply adding another [Group] tag and following that up with module file definitions, such as with the [Guild Site] example below:

[default]
default = "summary.php"
default_ini = "summary.ini"

[Guild Site]
summary = "summary.php"
summary_ini = "summary.ini"
members = "members.php"
members_ini = "members.ini"
downloads = "downloads.php"
downloads_ini = "downloads.ini"

Please note that the [default] tag determines which module is loaded when the user first visits the site. Thus, I would suggest that you make sure that whichever module you set this to, it is publicly accessible. (Also, make sure you DO NOT DELETE THIS MODULE DEFINITION. Things will get very hairy if you do.)