Please do not rate this article as it has yet to be completed, however if you have any comments on it feel free to submit them.
Introduction
This document was created in order to be a guide for users to create their own modules and submit to an administrator for consideration of being placed on the site. This guide was made with the assumption that you have some moderate PHP, MySQL, and HTML knowledge.
Globals
string SNAME (DerangedMinds.net)
SNAME contains the value of the site name, by default the value “DerangedMinds.net” is assigned.
string SURL (http://www.derangedminds.net)
SURL contains the site url without the ending slash, this must not contain an ending slash due to possible errors. By defualt the value “
http://www.derangedminds.net” is assigned.
string DEF_STYLE (default.css)
DEF_STYLE contains the default CSS file (contains site formatting along with the template files) for the site, the default value is “default.css”.
int SITE_ON (1)
SITE_ON contains information that tells weather the site status is “on” or “off”, if the site is turned off (value of 0) a construction page will be displayed as well as a form to allow admins to login, if the site is turned on (value of 1) the site will be displayed normally.
string ADMINMAIL (webmaster@derangedminds.net)
ADMINMAIL contains the webmaster's email, this is used to send bug reports, user reports, and various other things to the webmaster.
System Variables
Variable Description
$smarty Smarty templating engine
$admin_mail Webmaster's email
$ext Server file extensions (serves no purpose)
$sess_name Session name [security check] (obsolete)
$oldest Oldest age to register
$youngest Youngest age to register
$lang_dir Directory for language files
$username Current username(if any)
$_SESSION['level'] Current userlevel(if any)
$_SESSION['username'] Current username(if any)
$_SESSION['ip'] Current IP address
$_SESSION['ref'] Current Referrer (if any)
$_SESSION['nav'] Current navigation panel (obsolete)
$_SESSION['theme'] Current theme is DEF_STYLE by default
$_SESSION['language'] Current language (English by default)
Smarty Variables
sname Site name
surl Site url (without ending slash)
site_on Site status (1 for on 0 for off)
meta_desc Meta tag “Description” value
meta_tag Meta tag “Keywords” value
vote_on Is voting system on? (0 by default)
pics_norm Number of pictures free user can have
pics_prem Number of pictures premium user can have
fet_mem Featured member box
usersonline Users Online box
forum_p Latest forum posts box
theme Site theme being used
captcha Weather or not to use captcha image at login
user_name Current username (if any)
inval Number of incorrect login attempts
user_level Current user level (if any)
user_online_show Show online users box? (1 by default)
User Levels
Level Description
0 Banned users – These users cannot login and have no privileges
1 Regular users – These users have privileges of newly registered members
2 Premium users – These are the same a level 1's but with more privileges
8 Moderators – These have the same as level 2's but may also edit/ban members, edit/delete forum topics, edit/delete comments.
9 Administrators– These have full control and access to the site.
Be Sure to include
Creating a module
To create a module start by creating a directory and naming it. The directory name should be the same as the module's name which you are creating.
Now you'll want to create two more sub-directories, name one “files” and the other “sql” (both without quotes).
Now your directory tree should be similar to this:
my_module--|
|----files
|
|----sql
Now you may create a readme, although this is optional it is highly recommended to explain what your module does and what it includes. You may use whatever format for the readme you like however I have included a simple template below.
Module “readme” template
Name : Reset Stuff
SQL : Yes
Public Pages: Yes
Admin Pages : No
Description:
This is used to allow admins (level 9 only) to
reset various site features.
Installation:
Upload the folder "reset_stuff" into the modules
directory, then activate it via the "modules"
section of the admin panel.