Guest User

Google Spreadsheet into Wordpress - Marktastic + GrowSocial

a guest
Dec 5th, 2012
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. $gsRSSArray = array(SimplePieWP('https://spreadsheets.google.com/feeds/cells/YOUR-KEY/od6/public/basic?min-row=2&min-col=10&max-row=6&max-col=10', array('enable_order_by_date' => false)));
  2. unset ($RSSParseString);
  3. foreach ($gsRSSArray as $key=>$value) { $RSSParseString = $value; }
  4. $RSSParseArray = explode('<br />', $RSSParseString);
  5. foreach ($RSSParseArray as $key=>$value)
  6. {
  7. switch($key) {
  8. case 1:
  9. $tmp = trim(substr($value,strlen(""),strlen($value)));
  10. $tmp = number_format((float)$tmp);
  11. $_SESSION['crewHuron'] = $tmp;
  12. unset($tmp);
  13. break;
  14. case 2:
  15. $tmp = trim(substr($value,strlen(""),strlen($value)));
  16. $tmp = number_format((float)$tmp);
  17. $_SESSION['crewOntario'] = $tmp;
  18. unset($tmp);
  19. break;
  20. case 3:
  21. $tmp = trim(substr($value,strlen(""),strlen($value)));
  22. $tmp = number_format((float)$tmp);
  23. $_SESSION['crewSuperior'] = $tmp;
  24. unset($tmp);
  25. break;
  26. case 4:
  27. $tmp = trim(substr($value,strlen(""),strlen($value)));
  28. $tmp = number_format((float)$tmp);
  29. $_SESSION['crewMichigan'] = $tmp;
  30. unset($tmp);
  31. break;
  32. case 5:
  33. $tmp = trim(substr($value,strlen(""),strlen($value)));
  34. $tmp = number_format((float)$tmp);
  35. $_SESSION['crewErie'] = $tmp;
  36. unset($tmp);
  37. break;
  38. }
  39. }
  40.  
  41. $huron = $_SESSION['crewHuron'];
  42. $ontario = $_SESSION['crewOntario'];
  43. $superior = $_SESSION['crewSuperior'];
  44. $michigan = $_SESSION['crewMichigan'];
  45. $erie = $_SESSION['crewErie'];
  46. ?>
  47. <table>
  48. <tbody width="50" cellpadding="0" cellspacing="0" align="right" valign="top">
  49. <tr height="15">
  50. <td><h4>Huron</h4></td>
  51. <td><h4>  <? echo "$huron"; ?></h4></td>
  52. </tr>
  53. <tr height="15">
  54. <td><h4>Ontario</h4></td>
  55. <td><h4>  <? echo "$ontario"; ?></h4></td>
  56. </tr>
  57. <tr height="15">
  58. <td><h4>Superior</h4></td>
  59. <td><h4>  <? echo "$superior"; ?></h4></td>
  60. </tr>
  61. <tr height="15">
  62. <td><h4>Michigan</h4></td>
  63. <td><h4>  <? echo "$michigan"; ?></h4></td>
  64. </tr>
  65. <tr height="15">
  66. <td><h4>Erie</h4></td>
  67. <td><h4>  <? echo "$erie"; ?></h4></td>
  68. </tr>
  69. </tbody>
  70. </table>
  71. <?
Add Comment
Please, Sign In to add comment