diff options
-rw-r--r-- | include/api.php | 6 | ||||
-rw-r--r-- | include/hubloc.php | 4 | ||||
-rw-r--r-- | mod/ping.php | 6 | ||||
-rw-r--r-- | version.inc | 2 |
4 files changed, 12 insertions, 6 deletions
diff --git a/include/api.php b/include/api.php index fdc8edece..3ac8ddbda 100644 --- a/include/api.php +++ b/include/api.php @@ -622,10 +622,14 @@ require_once('include/items.php'); function api_red_xchan(&$a,$type) { + logger('api_xchan'); + if(api_user() === false) return false; + logger('api_xchan'); require_once('include/hubloc.php'); - if($_SERVER['request_method'] === 'POST') { + + if($_SERVER['REQUEST_METHOD'] === 'POST') { $r = xchan_store($_REQUEST); } $r = xchan_fetch($_REQUEST); diff --git a/include/hubloc.php b/include/hubloc.php index ece7bd21a..a4efe1c75 100644 --- a/include/hubloc.php +++ b/include/hubloc.php @@ -184,6 +184,8 @@ function hubloc_mark_as_down($posturl) { function xchan_store($arr) { + logger('xchan_store: ' . print_r($arr,true)); + if(! $arr['hash']) $arr['hash'] = $arr['guid']; if(! $arr['hash']) @@ -202,7 +204,7 @@ function xchan_store($arr) { if(! $arr['url']) $arr['url'] = z_root(); if(! $arr['photo']) - $arr['photo'] = get_default_profile_photo(); + $arr['photo'] = z_root() . '/' . get_default_profile_photo(); $r = q("insert into xchan ( xchan_hash, xchan_guid, xchan_guid_sig, xchan_pubkey, xchan_addr, xchan_url, xchan_connurl, xchan_follow, xchan_connpage, xchan_name, xchan_network, xchan_instance_url, xchan_flags, xchan_name_date ) values ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s','%s','%s','%s',%d,'%s') ", dbesc($arr['hash']), diff --git a/mod/ping.php b/mod/ping.php index 001c5594d..b676726fe 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -274,7 +274,7 @@ function ping_init(&$a) { $r = q("SELECT * FROM item WHERE item_restrict = 0 and item_unseen = 1 and uid = %d - and author_xchan != '%s' ORDER BY created DESC", + and author_xchan != '%s' ORDER BY created DESC limit 300", intval(local_channel()), dbesc($ob_hash) ); @@ -295,7 +295,7 @@ function ping_init(&$a) { if(argc() > 1 && (argv(1) === 'intros')) { $result = array(); - $r = q("SELECT * FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash where abook_channel = %d and (abook_flags & %d) > 0 and not ((abook_flags & %d) > 0 or (xchan_flags & %d) > 0) ORDER BY abook_created DESC", + $r = q("SELECT * FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash where abook_channel = %d and (abook_flags & %d) > 0 and not ((abook_flags & %d) > 0 or (xchan_flags & %d) > 0) ORDER BY abook_created DESC LIMIT 50", intval(local_channel()), intval(ABOOK_FLAG_PENDING), intval(ABOOK_FLAG_SELF|ABOOK_FLAG_IGNORED), @@ -327,7 +327,7 @@ function ping_init(&$a) { $r = q("SELECT * FROM event left join xchan on event_xchan = xchan_hash WHERE `event`.`uid` = %d AND start < '%s' AND start > '%s' and `ignore` = 0 - ORDER BY `start` DESC ", + ORDER BY `start` DESC LIMIT 1000", intval(local_channel()), dbesc(datetime_convert('UTC', date_default_timezone_get(), 'now + ' . intval($evdays) . ' days')), dbesc(datetime_convert('UTC', date_default_timezone_get(), 'now - 1 days')) diff --git a/version.inc b/version.inc index b6ad25842..0d9e1b8e7 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -2015-03-22.979 +2015-03-23.980 |