Advertisement
Guest User

Untitled

a guest
Feb 10th, 2012
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. / linkedin integration
  2. add_action('pagelines_head', 'linkedin_integration');
  3. function linkedin_integration(){
  4. ?>
  5. <script type="text/javascript" src="http://platform.linkedin.com/in.js">
  6. api_key: blablabla
  7. onLoad: onLinkedInLoad
  8. authorize: true
  9. </script>
  10.  
  11. <script type="text/javascript">
  12. // 2. Runs when the JavaScript framework is loaded
  13. function onLinkedInLoad() {
  14. IN.Event.on(IN, "auth", onLinkedInAuth);
  15. }
  16.  
  17. // 2. Runs when the viewer has authenticated
  18. function onLinkedInAuth() {
  19. IN.API.Profile("me").result(displayProfiles);
  20. }
  21.  
  22. // 2. Runs when the Profile() API call returns successfully
  23. function displayProfiles(profiles) {
  24. member = profiles.values[0];
  25. document.getElementById("profiles").innerHTML =
  26.  
  27. var myRegExp = /mystery-man.jpg/;
  28. var string1 = document.getElementById("1").src;
  29. var matchPos1 = string1.search(myRegExp);
  30.  
  31. if(matchPos1 != -1)
  32. {
  33. document.getElementById("1").src = member.pictureUrl;
  34. }
  35. }
  36.  
  37. </script>
  38. <?php
  39.  
  40. }
  41. add_action('bp_before_profile_edit_content', 'linkedin_signin');
  42. function linkedin_signin(){
  43. ?>
  44. <!-- 3. Displays a button to let the viewer authenticate -->
  45. <script type="IN/Login"></script>
  46.  
  47. <!-- 4. Placeholder for the greeting -->
  48. <div id="profiles"></div>
  49. <?php
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement