/[drupal]/contributions/modules/blog_reactions/blog_reactions.module
ViewVC logotype

Diff of /contributions/modules/blog_reactions/blog_reactions.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.2.2.23, Mon Mar 30 08:58:00 2009 UTC revision 1.2.2.24, Mon Mar 30 10:16:11 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  /* $Id: blog_reactions.module,v 1.2.2.22 2009/03/30 08:51:55 sanduhrs Exp $ */  /* $Id: blog_reactions.module,v 1.2.2.23 2009/03/30 08:58:00 sanduhrs Exp $ */
3    
4  /**  /**
5   * Blog reactions   * Blog reactions
# Line 197  function blog_reactions_get_item($brid) Line 197  function blog_reactions_get_item($brid)
197   */   */
198  function blog_reactions_item_exists($item) {  function blog_reactions_item_exists($item) {
199    $brid = $item->brid;    $brid = $item->brid;
200    $href = $item->href;    $href = $item->link['href'];
201    $result_brid = db_result(db_query_range("SELECT COUNT(brid) as count FROM {blog_reactions} WHERE brid='%s'", $brid, 0, 1));    $result_brid = db_result(db_query_range("SELECT COUNT(brid) as count FROM {blog_reactions} WHERE brid='%s'", $brid, 0, 1));
202    $result_href = db_result(db_query_range("SELECT COUNT(brid) as count FROM {blog_reactions} WHERE href='%s'", $href, 0, 1));    $result_href = db_result(db_query_range("SELECT COUNT(brid) as count FROM {blog_reactions} WHERE href='%s'", $href, 0, 1));
203    $result = $result_brid || $result_href;    $result = $result_brid || $result_href;
# Line 320  function blog_reactions_fetch_blogsearch Line 320  function blog_reactions_fetch_blogsearch
320        );        );
321      }      }
322    }    }
   
323    return $data ? $data : array();    return $data ? $data : array();
324  }  }
325    
# Line 328  function blog_reactions_fetch_blogsearch Line 327  function blog_reactions_fetch_blogsearch
327   * Fetch XML-Feed from bloglines.com   * Fetch XML-Feed from bloglines.com
328   */   */
329  function blog_reactions_fetch_bloglines($nid = NULL, $uri = NULL) {  function blog_reactions_fetch_bloglines($nid = NULL, $uri = NULL) {
330    $feed_url    = 'http://www.bloglines.com/search?q=bcite:'. ($uri ? $uri : url('node/'. $nid, NULL, NULL, TRUE)) .'&format=rss';    $feed_url    = 'http://www.bloglines.com/search?q=bcite:'. ($uri ? $uri : url('node/'. $nid, array('absolute' => TRUE))) .'&format=rss';
331    $comment_url = 'http://www.bloglines.com/search?q=bcite:';    $comment_url = 'http://www.bloglines.com/search?q=bcite:';
332    $response    = drupal_http_request($feed_url);    $response    = drupal_http_request($feed_url);
333    $xml         = simplexml_load_string($response->data);    $xml         = simplexml_load_string($response->data);
# Line 355  function blog_reactions_fetch_bloglines( Line 354  function blog_reactions_fetch_bloglines(
354        $data["$value->guid"]->updated   = (integer) strtotime(trim($value->pubDate));        $data["$value->guid"]->updated   = (integer) strtotime(trim($value->pubDate));
355      }      }
356    }    }
   
357    return $data ? $data : array();    return $data ? $data : array();
358  }  }
359    
# Line 363  function blog_reactions_fetch_bloglines( Line 361  function blog_reactions_fetch_bloglines(
361   * Fetch XML-Feed from blogato.net   * Fetch XML-Feed from blogato.net
362   */   */
363  function blog_reactions_fetch_blogato($nid = NULL, $uri = NULL) {  function blog_reactions_fetch_blogato($nid = NULL, $uri = NULL) {
364    $feed_url    = 'http://www.blogato.net/rss.php?search='. ($uri ? $uri : url('node/'. $nid, NULL, NULL, TRUE));    $uri = str_replace('http://', '', $uri);
365      $feed_url    = 'http://www.blogato.net/rss.php?search='. ($uri ? $uri : url('node/'. $nid, array('absolute' => TRUE)));
366    $response    = drupal_http_request($feed_url);    $response    = drupal_http_request($feed_url);
367    $xml         = simplexml_load_string(utf8_encode($response->data));    $xml         = simplexml_load_string(utf8_encode($response->data));
368    
# Line 390  function blog_reactions_fetch_blogato($n Line 388  function blog_reactions_fetch_blogato($n
388        $data["$value->link"]->updated   = 0;        $data["$value->link"]->updated   = 0;
389      }      }
390    }    }
   
391    return $data ? $data : array();    return $data ? $data : array();
392  }  }
393    

Legend:
Removed from v.1.2.2.23  
changed lines
  Added in v.1.2.2.24

  ViewVC Help
Powered by ViewVC 1.1.2