Lautaro
👽 Chevereto Freak
CBUS
Chevereto Basic User System
v1.0.0
Chevereto Basic User System
v1.0.0
Back when I was developing the AUS mod, I was also working on the version 2.o of the mod which was pretty much a complete rewritten version of it. Unfortunately due to many events in my life I had to stop the development and could not continue with it. Today I bring to you the AUS 2.0 development renamed to CBUS and made completely open to everyone on this community. Chevereto V3 is a few months from coming, so, in the meantime feel free to play with this mod.
Current Features:
- user registration
- user login
- account module
Changelog:
[11-12-13]
- base code (register, login, account)
Sources:
http://lautaroangelico.com/chevereto/CBUS/
======================================================================
How to Integrate
How to Integrate
1.- Create the new tables:
chv_users = http://lautaroangelico.com/chevereto/CBUS/sql/chv_users.txt
chv_usersimg = http://lautaroangelico.com/chevereto/CBUS/sql/chv_usersimg.txt
2.- Download the CBUS main class http://lautaroangelico.com/chevereto/CBUS/classes/class.cbus.user.txt and change the file extension to php.
3.- Upload the class file in /includes/classes/
4.- Edit your template's pages_config.php file and add the following pages:
PHP:
'signup' => array('live' => true, 'title' => 'Sign Up'),
'login' => array('live' => true, 'title' => 'Log In'),
'account' => array('live' => true, 'title' => 'Account'),
'logout' => array('live' => true, 'title' => ''),
Note: I did not add a title to the logout page so it wouldn't show in the footer.
5.- Download each one of the pages from http://lautaroangelico.com/chevereto/CBUS/pages/ , change the file extensions to php and upload them.
6.- Open /includes/classes/class.upload.php. In line 287 you will see:
PHP:
$this->image_info['image_date'] = date('Y-m-d H:i:s', time());
PHP:
$dB->cbus_assignImage($this->image_info['image_id']);
7.- Open /includes/classes/class.db.php and add the following method:
PHP:
/**
* cbus_assignImage
* assigns an uploaded image to a user
*
* @param int $image_id
* @return boolean
*/
public function cbus_assignImage($image_id) {
if(!check_value($_SESSION['cbus_userid']) || !$_SESSION['cbus_valid']) return;
$query = $this->query("INSERT INTO chv_usersimg (image_id,user_id) VALUES (?,?)", array($image_id,$_SESSION['cbus_userid']));
if($query) return true;
}
======================================================================
You can use the CBUS classe's method getUserImages() to get an array with the user's images (use it in the account page). With the data from the array you can use Chevereto's functions to build the url's and display the images.
As you can see, the modification is still very simple, but I will be spending a little time everyday developing it and posting the progress.
NOTE: this is not for a production site, it's a modification in development.