Coder Profile - Show off your skills, get a coder profile.
 
 
 
Module Development guide for Derangedminds
Web Development
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.


Posted By Darkvengance
Please login to rate coding articles.

Click here to register a free account with us.
Comments
Please login to post comments.
Page 1 of 1
More Articles By This Author
Module Development guide for Derangedminds
Recently Posted "Web Development" Articles
Website Optimization
How to use Memcache on Windows
PHP Sessions = Member Database Cache
Speed Up Delivery of your JavaScript Libraries
A cool tool ^^
AJAX - When to use it?
Introduction To PHP
[PHP] XML
HTML vs XHTML
[PHP] XML: HTML DOM Basics
Recently Rated "Web Development" Articles
Website Optimization
How to use Memcache on Windows
Preventing raw PHP leaks on Apache
When to use OOP in PHP
AJAX - When to use it?
Speed Up Delivery of your JavaScript Libraries
[PHP] XML
A cool tool ^^
HTML vs XHTML
Introduction To PHP
source codes Categories articles
Browse All
Business & E-Commerce (1)
Databases (1)
Design & Creativity (1)
Internet & Web Sites (1)
Life In General (2)
Operating Systems (3)
Other (2)
Programming (48)
Security (10)
Software Development (5)
Web Development (15)
search Search Inside
Web Development
 
 
Part of the MyPingle Network
Development Blog :: Make A Donation :: Contact Me
Terms & Conditions :: Privacy Policy :: Documents
Version 1.44.00
Copyright © 2007 - 2008, Scott Thompson, All Rights Reserved