Say you wanted to add a column called avatar to the jos_users table.
1. Add it to jos_users in the database via phpmyadmin or anyway you like.
2. Add your variable to the class JUser in libraries/joomla/user/user.php after any of the other class variables.
var $avatar = null;
3. Add your variable to the class JTableUser in libraries/joomla/database/table/user.php after any of the other class variables.
var $avatar = null;
Now just log out and back in and your variable will be available in your user variable
//gets the user variable $user =& JFactory::getUser();
//prints out the user variable echo "<pre>";print_r($user);echo "</pre>";
By PHPin24 @ 2009-12-09 14:14:41
|