Advertisement
Guest User

Google Docs into Wordpress - Midacad

a guest
Dec 5th, 2012
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. Page Code
  2.  
  3. [one_third][crews_points] First third of content - Pull Crew Points from Google Doc [/one_third]
  4.  
  5. PHP Code from Shortcode UI
  6.  
  7. $gsRSSArray = array(SimplePieWP('https://spreadsheets.google.com/feeds/list/0AjmAOGsTcBETdDlGUEVqbzVndGtUTzlVMDhDQnUzM3c/od6/public/basic?min-row=2&min-col=9&max-row=6&max-col=10', array('enable_order_by_date' => false)));
  8. unset ($RSSParseString);
  9. foreach ($gsRSSArray as $key=>$value) { $RSSParseString = $value; }
  10. $RSSParseArray = explode('<br />', $RSSParseString);
  11. foreach ($RSSParseArray as $key=>$value)
  12. {
  13. switch($key) {
  14. case 1:
  15. $tmp = trim(substr($value,strlen("$"),strlen($value)));
  16. $tmp = number_format((float)$tmp);
  17. $_SESSION['crewHuron'] = $tmp;
  18. unset($tmp);
  19. break;
  20. case 2:
  21. $tmp = trim(substr($value,strlen("$"),strlen($value)));
  22. $tmp = number_format((float)$tmp);
  23. $_SESSION['crewOntario'] = $tmp;
  24. unset($tmp);
  25. break;
  26. case 3:
  27. $tmp = trim(substr($value,strlen("$"),strlen($value)));
  28. $tmp = number_format((float)$tmp);
  29. $_SESSION['crewSuperior'] = $tmp;
  30. unset($tmp);
  31. break;
  32. case 4:
  33. $tmp = trim(substr($value,strlen("$"),strlen($value)));
  34. $tmp = number_format((float)$tmp);
  35. $_SESSION['crewMichigan'] = $tmp;
  36. unset($tmp);
  37. break;
  38. case 5:
  39. $tmp = trim(substr($value,strlen("$"),strlen($value)));
  40. $tmp = number_format((float)$tmp);
  41. $_SESSION['crewErie'] = $tmp;
  42. unset($tmp);
  43. break;
  44. }
  45. }
  46. echo "{$_SESSION['crewHuron']} <br />";
  47. echo "{$_SESSION['crewOntario']} <br />";
  48. echo "{$_SESSION['crewSuperior']} <br />";
  49. echo "{$_SESSION['crewMichigan']} <br />";
  50. echo "{$_SESSION['crewErie']} <br />";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement