User Information Changes

Ask all your questions about the script here.
nootkan
New
Posts: 3
Joined: Sun Feb 19, 2017 11:13 pm

User Information Changes

Postby nootkan » Mon Feb 20, 2017 12:43 am

Was wondering if there was a way to change the user information in this:

Code: Select all

$qls->user_info['last_login'] - The UNIX timestamp of the last time they logged in
to show the actual time and date instead of the unix timestamp?

Also wondering where I would change the

Code: Select all

$qls->user_info['active']
to say something other than "yes"? Thanks in advance. Really liking this script as I work my way through it.
User avatar
Douglas
Site Admin
Posts: 625
Joined: Sat Oct 27, 2007 11:29 pm
Location: BC, Canada
Contact:

Re: User Information Changes

Postby Douglas » Mon Feb 20, 2017 8:15 am

Hello, yes what you're asking is entirely possible. For the unix timestamp, I recommend looking up tutorials on PHP's date() function.

https://www.w3schools.com/php/php_date.asp

For the other, you just need to use logic statements, maybe something like this?

Code: Select all

if ($qls->user_info['active'] == 'yes') {
  $changed = 'Active';
}
else {
  $changed = 'Not Active';
}

print 'User status: ' . $changed;


Does that make sense?
nootkan
New
Posts: 3
Joined: Sun Feb 19, 2017 11:13 pm

Re: User Information Changes

Postby nootkan » Mon Feb 20, 2017 1:34 pm

Thanks Douglas, unfortunately I am not fluent in php and don't know where to make those changes you recommend. I've looked through most of the files and thought it may be in qls.class.php or security.class.php but didn't find any references to

Code: Select all

$qls->user_info['last_login']
or

Code: Select all

$qls->user_info['active']
.

I can copy and paste php into files if I know where to place the php code but I don't understand what most of the code is saying unfortunately. It is not from a lack of trying though. I've been trying to teach myself php for over 5 years now and it just hasn't completely clicked yet. Might be my age and lack of math skills that is holding me back but I keep trying.
User avatar
Douglas
Site Admin
Posts: 625
Joined: Sat Oct 27, 2007 11:29 pm
Location: BC, Canada
Contact:

Re: User Information Changes

Postby Douglas » Sun Mar 05, 2017 6:39 pm

Sorry for the delayed reply, I've been busy.

The code I posted would go on any page where you have the authentication header at the top. I believe I explain how to set up secured pages in the user guide. Just wrap it in PHP tags (<?php ?>) and everything will be good to go! For the date, please read the page I linked, it is a very simple example.

Return to “Support”

Who is online

Users browsing this forum: No registered users and 1 guest