This forum is archived. Posts are preserved for historical reference. For current help, join us on Discord.

Change Username login

In New to UserSpice? · Started by rdlook04 on 2016-10-26 10:16 pm · 74022 views · 32 replies

umm. when i try to install userspice. it show a error.

System Requirement Check

We're sorry, but your PHP version is out of date. Please update to PHP 5.5.0 or later to continue. PHP Website

Yep. That's the problem. I'm guessing you're using 5.3. Who is your hosting provider? Is there a place in your cpanel to change to PHP 5.6?
is a intranet, is using php 5.4.45, already ask for a change of the version.
ok. imposible the update, in the intranet exist anothers apps, that maybe get a error after the update
Welllll, your best bet is going to be userspice 3. Here's the deal. Version 3.3 is a little more polished, but it changed the directory structure a little bit, so I never wrote a way to update 3.3 to 4.0. 3.2 works great and can be upgraded. Note that these aren't officially supported and they are not object oriented/pdo, although you can easily include the userspice 4 classes in manually if you want to do your queries, etc.

https://userspice.org/UserSpice3.2.0.zip

https://userspice.org/UserSpice33.zip

If you use 3.2 and your intranet gets updated, you can install...

https://userspice.org/us3to4.zip
Bad news. You need php 5.5 because of the bcrypt encryption in UserSpice 3.2/3.3.

That leaves https://userspice.org/UserSpice2.5.6.zip although you can still update that all the way to 4.1.8b with a little trouble if you need to.
ok.. allready apply some css on this and looks the same like 4.x,

but i dont understand on this how to call some DB info by ID, on the 4.x is pretty easy but on this

i do <?php echo $loggedInUser->username ?>, and gets me the username (on the table id=1 and user_name=admin), but i try to call anothers fields like "sign_up_stamp", "active", some customs fields and i cant find the place to declare them.

mud if you give me a hint please.
So there's good news. Even though UserSpice 3 wasn't actually using the classes that we use in UserSpice 4, I included them. In fact, you can feel free to grab the latest versions of them from version 4.1.8c if you want.

What makes this particularly good is that you can write all your code in UserSpice 4/5 style and if you upgrade, everything will work. Since it's already included, here's how you would do a query...

Instantiate the database - only needs to be done once per page...can be done in the header
$db = DB::getInstance();

Write a query to search all users and only bring back the one that is logged in.
$findUserQ = $db->query("SELECT * FROM uc_users where id = ?",array($loggedInUser->user_id));
$u = $findUserQ->first();

Echo out whatever db field you want to echo out by putting the column name after the ->
echo $u->last_activation_request;

I hope that helps.
mudmin. i am using UserSpice2.5.6.zip. is the only one that work on this old server :D

so i have to get the classes from the 4x ? for this ?

i just try and get Fatal error: Class 'DB' not found in . i have to declare this on func.php . right ?
I just tested this. I would copy all the userspice 4 classes into the models folder

Then edit models/config.php

Right after the line
require_once("funcs.php");

Add
require_once("Config.php");
require_once("Cookie.php");
require_once("DB.php");
require_once("Hash.php");
require_once("Input.php");
require_once("Redirect.php");
require_once("Session.php");
require_once("Token.php");
require_once("Validate.php");

And that SHOULD do it.
i just try , and get this Fatal error: Class 'Config' not found in C:\xampp1\htdocs\userspice2\models\DB.php on line 27..

is because the pdo ?
my bad. db doesnt include config.php. all ready did it. but the text change to "Notice: Trying to get property of non-object in "
Sorry...I tried that on my system and I think it may have worked because I was already attached to the database.

You might have to go in your config.php and setup your globals manually... try adding this to config.php (with your credentials).

$GLOBALS['config'] = array(
'mysql' => array('host' => 'YOUR_HOST',
'username' => 'YOUR_DB_USERNAME',
'password' => 'YOUR_DB_PW',
'db' => 'YOUR_DB_NAME',
),
'remember' => array(
'cookie_name' => 'pmqesoxiw318374csb',
'cookie_expiry' => 604800 //One week, feel free to make it longer
),
'session' => array(
'session_name' => 'user',
'token_name' => 'token',
)
);
‹ Prev12