× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
creating a user dossier
#1
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?
  Reply
#2
Does anyone have any tips?
  Reply
#3
Are you wanting to see information for The logged in user or for all users?
  Reply
#4
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?
  Reply
#5
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.
  Reply
#6
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?
  Reply
#7
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.
  Reply
#8
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);
}
?>
  Reply
#9
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
  Reply
#10
Mudmin, Brandin? Any thoughts on where I may have screwed up with this?
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)