Changeset 156183
- Timestamp:
- 09/19/2009 09:51:09 AM (17 years ago)
- Location:
- wpfriends/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (1 diff)
-
wpfriends.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wpfriends/trunk/readme.txt
r156124 r156183 4 4 Requires at least: 2.8.4 5 5 Tested up to: 2.8.4 6 Stable tag: 0.1 6 Stable tag: 0.1.1 7 7 8 8 -
wpfriends/trunk/wpfriends.php
r156124 r156183 50 50 51 51 // collect data 52 $entries = array(); 52 53 $friends = $wpdb->get_results('select * from wpfriends'); 53 54 foreach ($friends as $friend) … … 60 61 61 62 // prepare data 63 $sortarr = array(); 62 64 foreach ($entries as $entry) 63 65 { … … 90 92 { 91 93 if (empty($displayname)) $displayname = $data . ' @ ' . $type; 94 $rr = array(); 92 95 $r = array('displayname' => $displayname); 93 96 if ($type == 'lj') 94 97 { 95 98 $xmlstr = liz_download('http://'.$data.'.livejournal.com/data/atom'); 96 $xml = new SimpleXMLElement($xmlstr); 97 foreach ($xml->entry as $entry) 99 if (substr($xmlstr,0,5) == '<?xml') 98 100 { 99 $r['id'] = (string) $entry->id; 100 $r['time'] = strtotime((string) $entry->updated); 101 $r['title'] = (string) $entry->title; 102 $r['content'] = (string) $entry->content; 103 $r['link'] = (string) $entry->link[0]->attributes()->href; 104 // echo '<pre>'.htmlentities(print_r($entry->link[0]->attributes(),1)).'<pre>'; 105 $rr[] = $r; 101 $xml = new SimpleXMLElement($xmlstr); 102 foreach ($xml->entry as $entry) 103 { 104 $r['id'] = (string) $entry->id; 105 $r['time'] = strtotime((string) $entry->updated); 106 $r['title'] = (string) $entry->title; 107 $r['content'] = (string) $entry->content; 108 $r['link'] = (string) $entry->link[0]->attributes()->href; 109 // echo '<pre>'.htmlentities(print_r($entry->link[0]->attributes(),1)).'<pre>'; 110 $rr[] = $r; 111 } 106 112 } 107 113 }
Note: See TracChangeset
for help on using the changeset viewer.