diff options
author | Mike Macgirvin <mike@macgirvin.com> | 2010-09-20 19:34:44 -0700 |
---|---|---|
committer | Mike Macgirvin <mike@macgirvin.com> | 2010-09-20 19:34:44 -0700 |
commit | 3ad52463f633b060bee519e8aa4d6e9453fdc2aa (patch) | |
tree | 5235655b2dd2e9a2af5f1179ebbff20dfdbd05b6 /include/items.php | |
parent | 177a6d7f79f5e237eb6d0811e8e28732a4c90d03 (diff) | |
download | volse-hubzilla-3ad52463f633b060bee519e8aa4d6e9453fdc2aa.tar.gz volse-hubzilla-3ad52463f633b060bee519e8aa4d6e9453fdc2aa.tar.bz2 volse-hubzilla-3ad52463f633b060bee519e8aa4d6e9453fdc2aa.zip |
more robust feed error handling, at the expense of performance.
Pass profile owner through HTML (yuk) to the ajax updater - as
browser pre-fetch totally buggers passing it via the server session.
Diffstat (limited to 'include/items.php')
-rw-r--r-- | include/items.php | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/include/items.php b/include/items.php index 8ca0eeb16..c7738c3ed 100644 --- a/include/items.php +++ b/include/items.php @@ -91,6 +91,7 @@ function get_feed_for(&$a, $dfrn_id, $owner_id, $last_update, $direction = 0) { if(! strlen($last_update)) $last_update = 'now - 30 days'; + $check_date = datetime_convert('UTC','UTC',$last_update,'Y-m-d H:i:s'); $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, @@ -109,8 +110,9 @@ function get_feed_for(&$a, $dfrn_id, $owner_id, $last_update, $direction = 0) { dbesc($check_date), dbesc($sort) ); - if(! count($r)) - killme(); + + // Will check further below if this actually returned results. + // We will provide an empty feed in any case. $items = $r; @@ -135,7 +137,12 @@ function get_feed_for(&$a, $dfrn_id, $owner_id, $last_update, $direction = 0) { '$namdate' => xmlify(datetime_convert('UTC','UTC',$owner['name-date'] . '+00:00' , ATOM_TIME)) )); - + + if(! count($items)) { + $atom .= '</feed>' . "\r\n"; + return $atom; + } + foreach($items as $item) { // public feeds get html, our own nodes use bbcode |