Jump to content

Recommended Posts

Posted

I would like to see the code used in the admin for the menu - user part. Does anyone know where to look for that?

Posted

I did not find what i was looking for in there. I guess I searched in wrong area...

What I need is a way to show a user's name which created a page.

$user is only reffering to the current user (guest or logged in).

But I need a way to show the name independent of logged in or not.

I know I can do this:

$myid = $child->get(created_users_id); echo $myid;

But I do not know exactly how to access that page to get the name of the user.

Think I have found the answer in the API... (sorry). I hope this is the fastest way to do this though:

$myname = $users->get("id=$myid"); echo $myname->name;
Posted

all you need is:

echo $child->createdUser->name;

assuming you have already set $child to the page in question.

For the current page:

echo $page->createdUser->name;
Posted (edited)
echo $page->createdUser->name;

Adrian beat me to it...OK, so am slow...nothing new there  ;)

Edited by kongondo
  • Like 1
Posted

heyyyy,

that's even more easy then I thought. Can't believe I was goign for the difficult road. Thanks so much!

So, where did you all found this code - where to look?

Again sorry - I had to look under $page, while I was searching under $user/$users/$roles...

Posted (edited)

......Again sorry - I had to look under $page, while I was searching under $user/$users/$roles...

Or you can use the search box on the cheatsheet page...

Edited by kongondo
Posted

But as always - everyone is friendly enough to help. I will study the cheatsheet more - don't want to see any of you loose ;)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...