Development: Getting Started

Interested contributing to WebDKP? Find the latest development progress here.
User avatar
Site Admin
Posts: 1163
Joined: Sat Nov 18, 2006 1:00 am
Location: CA
PostPosted: Tue Mar 11, 2008 10:44 pm
So you've just setup your development environment and your ready to start coding!

Great! :D

But theres a lot of directories in there - where to start first? :shock:

Well, you're in the right place - I'll be covering that here.

Main Folders
First off, i'd like to mention the folder structure. WebDKP is split into 3 main folders at the root level:

config/ - used for configure settings. You'll only use this during setup

core/ - Contains the overall site engine, templating system, security system, and more. The core directory does not contain any WebDKP specific code but is instead a generic engine. While your developing you'll probably never need to modify any files in the core directory.

site/ - The site folder contains all of the WebDKP specific code. Its here that you'll find the dkp libraries, the visual theme, and all of the specific pages of the site.

The location of some notable pieces of code:

Site Theme, Layouts, and CSS: site/themes/default
Specific DKP Pages: site/control and site/control/dkp
DKP Libraries and Classes: site/lib/dkp
Core JS Files: site/webroot/js

Getting Started: CodeBehind Pages
WebDKP is built on top of a development engine called TextSide.

TextSide is a Engine that I've spent the better part of a year developing that really helps speed up creating PHP based websites. It creates a generic framework that you can build your site in, providing lots of handy, built in features.

I've exhaustively documented how to develop sites using this engine.

Most development that you do will be with files called "CodeBehind pages". This is just a fancy name for php based page that is served up within the framework. These files provide an easy way for you to fit content into the current theme and easily separate your html from your php source. You'll find these files in the site\control directory. Every page in WebDKP is actually a CodeBehind page.

I really recommend that you check out the TextSide Docs on CodeBehind Pages.

I've included tutorials on:

Creating a Simple CodeBehind Page

Managing CodeBehind Page Resources (images, templates, etc.)

Using Templates

Using 'View Handlers' to control where content is displayed on a CodeBehind Page

Generating and Handling Events

Using AJAX with your CodeBehind Pages

Go ahead and try following a few tutorials to see how things work. The engine makes it very easy to create new pages.

The WebDKP Library
Most of the core logic for WebDKP is contained in a central WebDKP Library. This is a set of core classes that implement most of the DKP rules and provide an interface that the CodeBehind pages use.

For example, this includes classes to represent guilds, players, dkp tables, history entries, and more. It also includes classes for parsing uploaded lua files and generating lua files from the current database.

You'll find the WebDKP Library at site/lib/dkp/

Since most of the logic is contained here, your CodeBehind pages will often make calls to classes in this library to either update a dkp table, or get dkp data to display.

Most of these functions can be found in site/lib/dkp/dkpUpdater.php.

I'd like to note that a lot of the calculations for dkp can be tricky and that you shouldn't update the functions in the dkpUpdater class unless you fully understand what you are doing. This is especially true for anything related to zerosum.

Starting to Code
If you'd like to contribute to the WebDKP project, the next thing to do is take a look at the Development Task List. See if there is any tasks that you'd be interested in and start poking around in the code.

If you have any questions on the source, or a pointer of where to get started, feel free to leave a post :)

Good luck everyone, and happy coding!


Return to Development

Who is online

Users browsing this forum: No registered users and 1 guest