Advertisement
Guest User

MagPress - Magloss feedcount.php fix

a guest
Apr 27th, 2013
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.16 KB | None | 0 0
  1. <?php
  2. $feed = get_option('rk_gfeds');
  3. if( $feed == 'disable' ):
  4. //get cool feedburner count
  5. $whaturl="https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=" . $feed;
  6. //Initialize the Curl session
  7. $ch = curl_init();
  8. //Set curl to return the data instead of printing it to the browser.
  9. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  10. //Set the URL
  11. curl_setopt($ch, CURLOPT_URL, $whaturl);
  12. //Execute the fetch
  13. $data = curl_exec($ch);
  14. //Close the connection
  15. curl_close($ch);
  16. $xml = new SimpleXMLElement($data);
  17. $fb = $xml->feed->entry['circulation'];
  18. //end get cool feedburner count
  19. ?>
  20.  
  21. <div id="rss-link">
  22. <div class="rss-info">
  23. <span class="subscribers"><?php echo $fb; ?>&nbsp;Subscribers</span>
  24. <span class="updates">Get Updates By <a href="http://feeds2.feedburner.com/<?php echo $feed; ?>">RSS</a> Or <a onclick="window.open('http://feedburner.google.com/fb/a/mailverify?uri=<?php echo $feed; ?>', 'popupwindow', 'scrollbars=yes,width=550,height=520');return true" target="popupwindow" href="http://feedburner.google.com/fb/a/mailverify?uri=<?php echo $feed; ?>">Email</a></span>
  25. </div><!-- RSSINFO END -->
  26. </div><!-- RSSLINK END -->
  27.  
  28. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement