:/: That class and the framework that were just posted are probably too complex for the OP.. I'm under the impression that @
Danny just wants to get something working right now, but I suggest learning modern PHP, and for that matter, programming in general.
So, @
Danny, what exactly did you try, and why is your site broken due to your database structure? What is
$setParam supposed to do, anyway?
Rant: And my two cents- that CMS or framework or w.e you're showing me is using global and deprecated functions, and some of the worst programming I've ever seen. If you do plan on learning PHP, don't learn from that system you're using. Copying data from all over the place and coupling that data into one object is just silly.. It's garbage. I mean, if you want data from
$_CONFIG- use
$_CONFIG to retrieve that data!! But, there is no sense in having a
global $_CONFIG variable in the first place! I also see people do things like `
$user = $_POST['user']`- If you're not going to change data from one variable, why would anyone copy it to another variable? I mean, What's wrong with simply referencing
$_POST['user']? For one, it's more clear the data is from the client, and poses a danger as all user input does, where the variable
$user is smaller and easier to type, but that won't stop anyone from spending hours trying to find the source of a vulnerability in one's code. The tiny bit of time one might spend typing a few extra characters is made up for by the amount of time saved trying to figure out what the hell one did to get into the mess they are in. Similar with the framework you are using, assigning data from several different places into one giant object doesn't save anyone time when it comes time to change data. You first need to ask yourself, where does 'status' come from? You might check
$_CONFIG, or perhaps the
$user object, before you figure out it comes from
$core. All of those are
globals, too, so something in the lost Jurassic Park code has the authority to change any of those variables to a tyrannosaurus rex at the worst possible time.
Sorry.. I was just reminded why I was driven away from the PHP programming society. I feel your pain though, at one time I was unlucky enough to have been a beginner programmer learning PHP 4.
Finally, a shot in the dark here, if your problem is this line:
$this->setParams('online', $users->getInfo($SESSION['users']['online']));
Perhaps you forgot an underscore in
$_SESSION
Try this:
$this->setParams('online', $users->getInfo($_SESSION['users']['online']));
If that line is your problem, and the said problem wasn't solved by my shot in the dark, I would need to know what
$users->getInfo actually does, and what
$_SESSION['users']['online'] actually is.