display user profile as part of my plugin page in moodle - plugins

I'm creating a moodle local plugin and I need to display the current user's profile page as part of my page and add my data after that.
is there any API that give me the profile page (with all additional fields) so I will be able to show it in my page?

You can use global variable $USER. You will find all the records of current logged in user in $USER and display according to your requirement.

Related

User specific redirect on login, in Joomla

I'm looking for a way to redirect each user that logs in to a different page. I do photography and want my clients to be able to log in then be redirected to a page that displays their pictures only. Additionally, that specific user will be the only one to be able to view that page. I know you can redirect all users after logging in to a specific page and hide certain content from those not logged in but that is not what I'm looking for... it needs to be user specific. I'm new to Joomla and looking for a way to achieve this.
If you install FLEXIcontent CCK and use that for content creation -
it enables you to set up individual pages per user:
http://www.flexicontent.org/forum/index.php?f=20&t=6762&rb_v=viewtopic
http://www.flexicontent.org/forum/index.php?f=20&t=6132&rb_v=viewtopic
In case anyone else is looking for how I solved this...
I did some research on this and came across a plugin called Phoca Gallery. It doesn't redirect the user to a specific page but rather lets you set viewing rights to specific users. So I created a "Client Page" that only shows to registered users (i.e. when someone is login in) and have the joomla login module redirect all users to that page after login.
Now on my "Client Page" I have the phoca gallery module set to only show albums that the user has rights to. A good work around for what I needed. It even lets you add watermarks to your images... a good bonus... and an even better bonus... It's free!
Find it here: http://www.phoca.cz/phocagallery

After facebook login, retrieve facebook address of user?

I am trying to utilize facebook login for my website's alumni tracer. What I want to do now is to be able to retrieve the facebook profile address of a user, how can I do that? What I am planning to do is to list down all the names with a link such that when the link is clicked then it will go to the users profile.
TIA
You can always just link to www.facebook.com/{userid}.
Or you could first check if the user has a username set [1], and then just link to www.facebook.com/{username} – if you want the links to look “prettier”. www.facebook.com/zuck maybe looks a little nicer then www.facebook.com/4 – but the numeric id link will always automatically redirect to the version with the user name anyway.
[1] AFAIK everyone has a username set nowadays – if the user did not set one explicitly themself, Facebook makes one up out of their first name/last name compination.

How to save Facebook user's data into our own database who like my app, page

Is there any way to save data of Facebook's users into my own database who has liked my applivation on page.
I wanted to know who liked my app, page and want to save those details into my database
you can do it & the way of doing it, depends on
do you mean Like button top of the page or like button like what is for websites ?
please explain more
You can get only a limited amount of data about a person who has liked your page. It is contained within the signed_request parameter that is posted to all facebook tabs when they load.
http://developers.facebook.com/docs/authentication/signed_request/
For an anonymous user who has not authenticated your app, the information you can get is
locale,
country,
age (this is an object containing minimum and maximum age - which you can use to control age restricted content on your page, but which doesn't give you a very accurate user age)
If you want more information than this, you need to authenticate the user with OAuth, and request that they give you permission to access their data - there is plenty of documentation on this.
http://developers.facebook.com/docs/guides/web/#login

page authentication to specific pages

In my web site, I want to ask the users for permission to manage their pages.
I saw in the documentation that I need to use the following:
https://www.facebook.com/dialog/oauth?client_id=MY_ID&redirect_uri=MY_URL&scope=manage_pages&response_type=token
However, I retrieve back a list of pages which are manages by the user.
Is there a way that inside the auth dialog the user will see list of pages managed by him so he could confirm only those that he allows?
I also don't know what are the pages id, and prefer not to call a method where I need to specify the page id, but to get a token and page id from what he has already selected.
In the old authorization dialogs there was a drop-down so the user can specify which pages they want to allow. However, that is now deprecated and the new dialog grants every page as you have found out. Basically, your app can show the user which pages they currently have under their management (display list from data return for HTTP Get /me/accounts) and let them choose.

What type of application to choose

I want to create facebook application that will allow to insert some data from my site to user's profile. User can choose to set up application. The users enters his ID on my site and when user's profile is viewed there is block of data loaded from my site (specified to the ID).
Is this possible to create such application with facebook ? If no the what type of application is closest to this? My site users want to display their profiles from my site inside their facebook profiles , so facebook friends can see this.
If I understand you correctly you want to add some additional data on the users Facebook profile, something like if Stackoverflow would add their flair on the Facebook profile.
I don't think this is possible, but you have a few alternatives:
Make the user post out a link to his profile on your site to his Facebook Wall, more details here.
Integrate your site to the new Open Graph Objects. Open Graph Objects will create a box on the users profile for your application which shows the users activity in your application. You should check out the demos and documentation for more information about this.
The users enters his ID on my site and when user's profile is viewed there is block of data loaded from my site
You can't do anything like this, you will need to use the authentication flow provided by Facebook in order to get access to the Facebook user data and then tie up the Facebook user to "your user", see documentation.
When it comes to what type of app you should create, there is basically only one type of app with some different options. But you should focus on the "Facebook for websites" documentation.