Making a New Color Scheme
February 14, 2016How Permission Levels Work
September 2, 2016Upgrading from UserSpice 3.x to 4.0
What will not break...
Anything that is UserSpice related. All the pages for administrating anything. All of the pages that come with UserSpice will work. They'll work because they're all new. Your database will work fine, however it will not work immediately if you try to roll back to version 3.x (There is help for that below). Anything you coded in PHP will work fine as well. Your big change is how you connect to the database. We'll cover that too.
What will break...
UserSpice 4 was completely rewritten from the ground up to be more efficient, more secure, and more object-oriented. Most of the functions of UserSpice 3 and UserCake have been replicated in one way or another, there just might be a different way of doing things. So, what will break? Much of that depends on how you were using UserSpice. If you created your own project and used UserSpice just to control access and page security, pretty much nothing will break, but here are the most common things to look out for.
1. There is a new way of looking for the "logged in user." If you were doing things to echo out the user's code using the old UserSpice functionif(isUserLoggedIn()) {
You need to switch to the more OOP style of
if($user->isLoggedIn()) {
You need to bring your database connection with you. By default UserSpice uses a database class that is object-oriented. If your site used a bunch of mysqli queries, then you need to bring that "connection" over to UserSpice. I would suggest creating it in a separate file in /users/includes/frontend and including it in your header. If you need help with this, just ask in the forums, but it will look something like this...
$mysqli = new mysqli($db_host, $db_user, $db_pass, $db_name);
Rolling back your database
Ideally, you backed up your database because we told you to do that a few times. However, if you didn't, you can still make UserSpice 4.x database work with your old installation. Just do these two things...
1. Put the database prefix (usually uc_) back on your tables. Add it to users, permissions, permission_page_matches, user_permission_matches, and pages. 2. In the users table, rename the column username to user_name. That's it. There was a lot to do to convert your database to 4.x style, but it's simple to roll it back. You can even make use of the other information that has been added to your tables.