Get user details in SocialEngine - php

I want to get user details in SocialEngine like we make a plugin in WordPress to get user details. How can I get the user details of the logged in user. I don't want to make any packages or widgets. Also I want to place a script into the head of the SocialEngine. How can I achieve this ?

You can easily get user info from 'fields_value' and 'users' table.This plugin will be very useful for you http://www.ipragmatech.com/socialapi-rest-socialengine.html .
The plugin have REST API and very useful to integrate socialengine with other CMS or ERP system.

You can access the current viewer or subject within the page through
$this->viewer()->getIdentity();
The viewer object will give you all the details of the current user viewing the page. You can also call subject with:
Engine_Api::_()->core()->getSubject();
I cover retrieving the user details in a blog post here:
http://garbtech.co.uk/socialengine-getting-the-current-users-id-and-data
I also discuss creating widgets for user profiles here:
http://garbtech.co.uk/socialengine-creating-widgets-for-user-profiles-getting-the-subject-rather-than-the-viewer-information/

Related

Facebook Messenger API - Possible to generate the "Persistent Menu" user-specific?

I'm developing a Messenger BOT by using the Facebook Messenger Platform. I was able to create a Persistent Menu by following their guide.
I used CURL to create that menu. Which means, the same Persistent Menu is applied (appeared) to everyone.
Now, i want to know whether that Persistent Menu is customizable for different users.
As a simplest example, let's say i want to put User's Name on one of that menu items, like:
Hello John Cena!
View my Credits
View Bills
Order History
Latest News
Promotions!
Obviously, i need to do more meaningful stuffs. Like, putting different Web Links based on User. Show/hide some menu items based on User. Etc.
Please kindly suggest.
(Note: i'm using PHP for backend.)
Persistent Menu is part of Messenger Profile. Messenger Profile is the central store for your bot's properties. All Messenger Profile properties are common for the bot and cannot be made user specific. However you can personalize greeting text with user's name using {{user_full_name}}.
Note: Not sure whether {{user_full_name}} will work on persistent menu.

What php function could I use to restrict access to the post page in Wordpress?

I know wordpress says it can't be done, but I also understand that this can't be true. I'm trying to restrict access to the post page to logged in users only. I have tried plugins, but no luck. There has to be a way to no allow unregistered users to view this page. Any help would be greatly appreciated. Thanks!
There are many reasons you may decide to restrict some content on your website from being viewed by the public. Whether it is to have user accounts, content for sale, or confidential data, you can use this method to house all your content in one place, thus allowing you to grant permission to those you choose to view it.
Top reasons to restrict access to a particular website might include:
User Accounts
Confidential Data
Personal Data
Digital Goods For Sale ( Books, Tutorials, Movies, Music)
Pro Rated Services
Pro Rated Media
Addons
An example of restricted access is lynda.com.
Download the Restrict Content Plugin
I’ll be using the Restrict Content plugin by pippinsplugins to get things started off. Head to your WordPress Admin area and add the plugin. I searched Restrict Content and it was the first plugin on the list. Download it and activate it.
Next head to the Settings area in the left navigation. Look for the newly added link titled Restrict Content.
Inside the Restrict Content Settings panel are input fields where you can enter in message which displays if users try to access areas in which they are not allowed.
If you’re following along, enter the message below:
Restricted Message – We’re sorry. You do not have permission to access this page. Please sign up to be granted access.
All the rest – Just add the same message above for each tier of user role.
If you plan on having multiple user roles on your site, feel free to fill these in where needed.
Lets create a page that will have some content we don’t want to be accessible unless it’s for users with accounts on our site. I’ll call the page Books.
The intent would be to have books available for download to those with access to the page. The books will be digital downloads that are free for those who have been granted permission.
With the Books page created, I’ll add the content below. Navigate to the new page and notice the new block below the text area titled Restrict this content.
check link here
You can change the visibility of any post to be public, password protected or private. The last two options can assist
see this link for help https://codex.wordpress.org/Content_Visibility
Note also, toward the end of this page there is a note giving another method by using .htaccess to restrict who can visit your web site.

How to get facebook friends details of logined user in my site?

I am trying to fetch the facebook friends details such as name, photo,current working and joined date. Am using PHP. I am tried to use the codes which are given in facebook-developer site.Url of that site is as followes.
http://developers.facebook.com/docs/reference/fql/
And i have completed the login code now i wants to display the friends details in my site as it is in the following url...
http://www.jobisjob.com/MyNetwork
In that please follow the facebook login link...
Can any one tell me how to do that using php?.
Make sure you request the proper permissions for this (look at the friends permissions column) - https://developers.facebook.com/docs/authentication/permissions/. Of course, getting this data depends on their privacy settings as well, so you should be able to handle both situations when this data is provided and when not.

Tumblr API - List a user's tumblogs? PHP

I'm having trouble finding out how to list an authorized user's Tumblr blogs in Tumblr's API documentation. As you all know, Tumblr allows users to create a bunch of different "tumblogs" in one account. How do I find out what other tumblogs the user has? I want to list it so that the user can pick which one to post to. I'm using PHP and TumblrOAuth.
Ah, nevermind, I kept on looking at the Blog Info section, the details for listing the user's blogs are at the User Methods section.

How to access custom fields Facebook PHP SDK

Facebook has in their documentation an example for a custom sign-up form:
<fb:registration
fields="[{'name':'name'}, {'name':'email'},
{'name':'favorite_car','description':'What is your favorite car?',
'type':'text'}]" redirect-uri="URL_TO_LOAD_AFTER_REGISTRATION">
</fb:registration>
I want to create something like this but instead of favorite car my custom field is the address and I want fb-only registrations:
<fb:registration
fields="[{'name':'name'}, {'name':'email'},
{'name':'address','description':'Address',
'type':'text'},{'name':'zipcode','description':'Zipcode',
'type':'text'}]" redirect-uri="http://example.com/register-exec.php"\
fb_only='true' fb_register='true'>
</fb:registration>
After the user registers, does Facebook keep in their database the custom field address and zipcode?
I can run
$facebook->api('\me')
to get user info but can I do something like
$facebook->api('\me\zipcode')
I am making the website facebook-only so I want facebook to keep track of these fields (I don't want to make my own database for this). Also, how can I know if someone has registered to the website when they access a page of the site?
Thanks
Facebook doesn't keep any record of the values provided by the user to any custom fields the developer requests
Your own app needs to process and store those in your own database - they won't be retrievable via the API as they're only passed during validation and submission of the registration plugin

Categories