- how to get frontend username inside plugin code

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
mikemcvey
Forum Members
Forum Members
Posts: 61
Joined: Tue May 02, 2006 4:08 am

- how to get frontend username inside plugin code

Post by mikemcvey »

Hi,

I am writing a download plugin and want to be able to track downloads by FrontEndUsers - username.
I know the username is in the page template and in the gCms object but unsure how to access them.

Any ideas?

Mike
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: - how to get frontend username inside plugin code

Post by calguy1000 »

Code: Select all

global $gCms;
$feu =& $gCms->modules['FrontEndUsers']['object'];
echo $feu->LoggedInName();
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
mikemcvey
Forum Members
Forum Members
Posts: 61
Joined: Tue May 02, 2006 4:08 am

Re: - how to get frontend username inside plugin code

Post by mikemcvey »

Calguy thanks :)

I had just found another thread which had something similiar...
but you where too fast!

Thanks.. your posts on the forum are very helpful.

Cheers

Mike
mikemcvey
Forum Members
Forum Members
Posts: 61
Joined: Tue May 02, 2006 4:08 am

Re: - how to get frontend username inside plugin code

Post by mikemcvey »

Any chance of helpng me out to get the username - email - name etc?

I had a quicl look in the api but maybe I will have to qury the db myself to the get info.

Mike
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: - how to get frontend username inside plugin code

Post by calguy1000 »

print_r( $feu->GetUserProperties( $feu->LoggedInId() ) );
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
mikemcvey
Forum Members
Forum Members
Posts: 61
Joined: Tue May 02, 2006 4:08 am

Re: - how to get frontend username inside plugin code

Post by mikemcvey »

thanks!
Post Reply

Return to “Developers Discussion”