Plugin Directory

Changeset 156183


Ignore:
Timestamp:
09/19/2009 09:51:09 AM (17 years ago)
Author:
lizardwuff
Message:
  • wrong usernames in LJ accouts does not break the whole friendspange anymore
  • fixed errors if no friends was entered
Location:
wpfriends/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wpfriends/trunk/readme.txt

    r156124 r156183  
    44Requires at least: 2.8.4
    55Tested up to: 2.8.4
    6 Stable tag: 0.1
     6Stable tag: 0.1.1
    77
    88
  • wpfriends/trunk/wpfriends.php

    r156124 r156183  
    5050
    5151  // collect data
     52  $entries = array();
    5253  $friends = $wpdb->get_results('select * from wpfriends');
    5354  foreach ($friends as $friend)
     
    6061
    6162  // prepare data
     63  $sortarr = array();
    6264  foreach ($entries as $entry)
    6365  {
     
    9092{
    9193  if (empty($displayname)) $displayname = $data . ' @ ' . $type;
     94  $rr = array();
    9295  $r = array('displayname' => $displayname);
    9396  if ($type == 'lj')
    9497  {
    9598    $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')
    98100    {
    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      }
    106112    }
    107113  }
Note: See TracChangeset for help on using the changeset viewer.