The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$archive_pages - Line: 2 - File: printthread.php(287) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/printthread.php(287) : eval()'d code 2 errorHandler->error
/printthread.php 287 eval
/printthread.php 117 printthread_multipage



UserSpice
creating a user dossier - Printable Version

+- UserSpice (https://userspice.com/forums)
+-- Forum: Support Center (https://userspice.com/forums/forumdisplay.php?fid=23)
+--- Forum: UserSpice 4.4 (https://userspice.com/forums/forumdisplay.php?fid=27)
+--- Thread: creating a user dossier (/showthread.php?tid=1397)

Pages: 1 2


creating a user dossier - LBC - 03-22-2019

Hi,

I am trying to create a sort of user dossier. I'd like it to contain the info from _admin_user.php but be presented like the account.php.
How would I go about this?

I know I need something like this line: ?view=user&id=<?=$v1->id?>'><?=$v1->username?>, to show the data from a particular user. But I can't figure out how to get it to work.

Any ideas?


RE: creating a user dossier - LBC - 03-24-2019

Does anyone have any tips?


RE: creating a user dossier - mudmin - 03-24-2019

Are you wanting to see information for The logged in user or for all users?


RE: creating a user dossier - LBC - 03-24-2019

Hello Mudmin, thank you for responding Smile

I would like to create a link in the _admin_user to the dossier of that user.

So that link opens a new page (the dossier) where all the info ( with possibly some more info gathered from the database) from that particular user is displayed like it is in the account.php

I created that link to the dossier, and when it opens it shows the ID of that user in the address bar, but I cannot seem to create the code to actually display the info of that ID (it just shows my own info, as I am logged in).

Does that make any sense?


RE: creating a user dossier - mudmin - 03-24-2019

Ok. Sure. So let's walk through that.

Let's say you have a page called dossier.php and you are calling that page as dossier.php?id=3 (the user's id).

Your code would look like this...
https://pastebin.com/yUut6CbR

So what I did there is grabbed the id from the URL and did a query of the users table where the user id was that number. If you have your data stored in a different table, just change the table in the infoQ query.

Then I made a table to show all the data. If you only want to echo out certain data, you don't need the foreach loop. You can just do echo $info->columname;

Hope that helps.


RE: creating a user dossier - LBC - 03-25-2019

Yes! That totally works Smile)
Thank you Mudmin!

On another note...my users are suddenly not redirected properly to their usersc/account.php
As an Admin I get redirected fine, but as a user I am not.

Any idea what the problem could be?


RE: creating a user dossier - mudmin - 03-25-2019

Can you check your database under settings and redirect_uri_after_login?
If that still has usersc/account.php (or users/account.php) then check this file...
usersc/scripts/custom_login_script.php and see if anything is happening in there that would cause an issue.


RE: creating a user dossier - LBC - 03-25-2019

I changed the redirect after login to a member_index page through the User Settings in the Dashboard. That works fine.
I have checked the file you mentioned and that says the standard thing (as I did not touch that):

<?php
if(hasPerm([2],$user->data()->id)){
  Redirect::to($us_url_root.'users/admin.php');
}else{
Redirect::to($us_url_root.$settings->redirect_uri_after_login);
}
?>


RE: creating a user dossier - LBC - 03-26-2019

I have my website on another domain as well and on that one the redirect for users works fine. I must have changed something somewhere, so I cross checked account.php, custom_login_script.php, nav.php, navigation.php and they all seem fine. I also looked at all the settings in the dashboard and the problem does not seem to be there either. Neither has it to do with cookies..or so it seems.

I am at a loss   Undecided


RE: creating a user dossier - LBC - 03-28-2019

Mudmin, Brandin? Any thoughts on where I may have screwed up with this?