Jump to content
  • Advertisement
Sign in to follow this  
  • entries
    43
  • comments
    51
  • views
    32370

Some More Progress

Sign in to follow this  
Colin Jeanne

338 views

I've made a few changes to the SessionManager class. First, I renamed IsSet() to Exists() since after reviewing PHP's documentation I realized that isset() isn't a function but a language feature and thus a reserved word. I've also added a function Destroy() to unset session variables.

I've added three functions to my QueryResult class which I guess I just forgot to write initially: GetNumRows(), GetAffectedRows(), and GetNumFields(). Each of these functions is just a simple wrapper for mysql_* counterpart.

I've written a number of functions to work with the central user database and help with managing logins and logouts and have also been working on the main admin module. While working on the admin module I realized that there was a flaw in my initial design document: I originally only required 2 different functions to be provided with each module but now I am requiring 3. The third function is called when the module is unregistered and allows the module to drop any tables that it has created. I've also decided to keep the $_REQUEST array separate from the array of virtual directories since things seem easier to work with like that.

And so I leave you with the current content generation function for my admin module:


//The main content generation function
function GenerateContent($module, $url_array, $parameters) {
if (count($url_array) == 0) {
return false;
}

switch ($url_array[0]) {
case "modules":
//Display a list of all installed modules with the option to
//unregister any module except for 'admin'
return DisplayModuleAdmin($parameters);
break;

case "members":
if (count($url_array) == 1) {
//Print memberlist, first page only
return DisplayMemberList('');
} else {
switch ($url_array[1]) {
case "profiles":
//Make sure there is at least one more parameter
if (count($url_array) == 2) {
return false;
}

//Display the user's profile whether the data is a UID or
//a username
return DisplayProfile($url_array[2]);
break;

default:
//$url_array[1] might be a number and thus a page number
return DisplayMemberList($url_array, $parameters);
break;
}
}
break;
}

return false;
}

Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!