Advertisement
Guest User

Untitled

a guest
Feb 13th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. // SHORTCODE INFO
  2. add_shortcode('data_loop', function($atts) {
  3. echo '<?php
  4. $dom_object = new DOMDocument();
  5. $dom_object->load("http://www.url.com/xml/xml.php?uid=USERNAME&cname='.$atts['city'].'");
  6. $item = $dom_object->getElementsByTagName("item");
  7. foreach( $item as $value )
  8. {
  9. $firsts = $value->getElementsByTagName("first_name");
  10. $first = $firsts->item(0)->nodeValue;
  11. $lasts = $value->getElementsByTagName("last_name");
  12. $last = $lasts->item(0)->nodeValue;
  13. $dates = $value->getElementsByTagName("date");
  14. $date = $dates->item(0)->nodeValue;
  15. $charges = $value->getElementsByTagName("desc");
  16. $charge = $charges->item(0)->nodeValue;
  17. $urls = $value->getElementsByTagName("url");
  18. $url = $urls->item(0)->nodeValue;
  19. echo "<center><p><hr color=#FF99DC><br><h7>$first $last</h7><br>$date<br>$charge<br><a href=$url target=blank>more info</a></p></center>";
  20. }?>';
  21. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement