Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- / linkedin integration
- add_action('pagelines_head', 'linkedin_integration');
- function linkedin_integration(){
- ?>
- <script type="text/javascript" src="http://platform.linkedin.com/in.js">
- api_key: blablabla
- onLoad: onLinkedInLoad
- authorize: true
- </script>
- <script type="text/javascript">
- // 2. Runs when the JavaScript framework is loaded
- function onLinkedInLoad() {
- IN.Event.on(IN, "auth", onLinkedInAuth);
- }
- // 2. Runs when the viewer has authenticated
- function onLinkedInAuth() {
- IN.API.Profile("me").result(displayProfiles);
- }
- // 2. Runs when the Profile() API call returns successfully
- function displayProfiles(profiles) {
- member = profiles.values[0];
- document.getElementById("profiles").innerHTML =
- var myRegExp = /mystery-man.jpg/;
- var string1 = document.getElementById("1").src;
- var matchPos1 = string1.search(myRegExp);
- if(matchPos1 != -1)
- {
- document.getElementById("1").src = member.pictureUrl;
- }
- }
- </script>
- <?php
- }
- add_action('bp_before_profile_edit_content', 'linkedin_signin');
- function linkedin_signin(){
- ?>
- <!-- 3. Displays a button to let the viewer authenticate -->
- <script type="IN/Login"></script>
- <!-- 4. Placeholder for the greeting -->
- <div id="profiles"></div>
- <?php
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement