| 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 |
| 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; |
| 320 |
); |
); |
| 321 |
} |
} |
| 322 |
} |
} |
|
|
|
| 323 |
return $data ? $data : array(); |
return $data ? $data : array(); |
| 324 |
} |
} |
| 325 |
|
|
| 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); |
| 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 |
|
|
| 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 |
|
|
| 388 |
$data["$value->link"]->updated = 0; |
$data["$value->link"]->updated = 0; |
| 389 |
} |
} |
| 390 |
} |
} |
|
|
|
| 391 |
return $data ? $data : array(); |
return $data ? $data : array(); |
| 392 |
} |
} |
| 393 |
|
|