🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Some More Progress

posted in Rarely Spoken
Published January 15, 2005
Advertisement
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;   }
Previous Entry Current Progress
Next Entry CMS Progress
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement

Latest Entries

4E6 PyGame

1404 views

4E5

1138 views

Happy Yesterday!

1093 views

Another Game

1305 views

Merry Christmas!

1073 views

Hello There

1072 views

Yay!

1088 views
Advertisement