| Warning: Beta |
| This page/script has been classified as beta. This means it is not fully developed or documented and is not ready for public use. There is also a risk that any future (final) versions will NOT be backwards compatible with this one. However, interest has been expressed in seeing this project in it's current state so so I am putting it up for anyone to play with. |
Comments
for exmaple
how can i add new field to the table users for example the customer Age : 23
and to be shown in the admin/users.php
how can I do that ?
I where I should change in the classes and where too ?
Answer
You'll need to change the /admin/users.php file as well as the two classes that handle account/user management: /includes/Account.class.php and /admin/includes/Account.php
The easiest way to edit them would be to search those files for "email" and when you see any code handling the "email" field, add the code to handle your "age" field following it. Also remember to add an "age" field to the database.
okay...
aha okay I did that thanks you
and if I want to add new table...?
what is the easiest way ?
Answer
For your "age" field, I would recommend just editing the existing "users" table and creating a new column for your info there.
Just logged in
Hi,
Can you recommend a good way to find out how long ago a user logged in?
I would like to display a message immediately after a user logs in or redirect the user.
Answer
$login->info['accessed']was created with that in mind. The field exists in the database and the info is pulled when they log in. However, I don't believe I actually ever got around to having the script update that timestamp when they log in (so I think it's always null).
You would need to edit Login.singleton.php and I think edit the set() function to update that field 'accessed' field whenever it's run:
$db->update(TABLE_USERS, array('accessed'=>"NOW()"), 'user_id="'.$this->info['user_id'].'"');That's untested and off the top of my head, but it should give you an idea where to start.
Great Stuff
All your classes are great. I'm curious though - do you see using something like your homegrown scripts or using an MVC framework like Codeigniter, Zend, or CakePHP as a better choice?
I've never used a framework and am interested in trying but looking for input on whether you may think they are restrictive or beneficial...
Answer - Framework/Library philosophy
If you are a developer or you are wanting to become a programmer/developer I would recommend starting to collect/write your own library of "script snips." If it's something you write you'll (1) learn/understand it better and (2) be able to quickly make custom changes later on (especially if you comment/document it well). What you see on this site are some examples from my library that I've used/modified for a wide variety of projects.
That said, there's nothing wrong with using someone else's framework. If you are just starting out they tend to be more polished and less prone to bugs. The downside is you can end up spending hours going through documentation and still not understand what something does. If you find a framework you like and you can easily use the documentation to make it do what you want, don't be afraid to use it.