From 618b93d42e54e0ecefb69d6e1acf24429d39785e Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 17 Sep 2014 19:08:15 -0700 Subject: let the xchan diagnostic accept a webbie --- mod/xchan.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'mod') diff --git a/mod/xchan.php b/mod/xchan.php index e51cc53cc..a4dc70550 100644 --- a/mod/xchan.php +++ b/mod/xchan.php @@ -7,7 +7,7 @@ function xchan_content(&$a) { $o .= '

Xchan Lookup

'; $o .= '
'; - $o .= 'Lookup xchan beginning with: '; + $o .= 'Lookup xchan beginning with (or webbie): '; $o .= '
'; $o .= '

'; @@ -15,27 +15,27 @@ function xchan_content(&$a) { if(x($_GET,'addr')) { $addr = trim($_GET['addr']); - $r = q("select * from xchan where xchan_hash like '%s%%'", + $r = q("select * from xchan where xchan_hash like '%s%%' or xchan_addr = '%s' group by xchan_hash", + dbesc($addr), dbesc($addr) ); if($r) { - foreach($r as $rr) + foreach($r as $rr) { $o .= str_replace("\n","
",print_r($rr,true)) . EOL; - } - else - notice( t('Not found.') . EOL); - $r = q("select * from hubloc where hubloc_hash like '%s%%'", - dbesc($addr) - ); - - if($r) { - foreach($r as $rr) - $o .= str_replace("\n","
",print_r($rr,true)) . EOL; + $s = q("select * from hubloc where hubloc_hash like '%s'", + dbesc($r[0]['xchan_hash']) + ); + if($s) { + foreach($s as $rr) + $o .= str_replace("\n","
",print_r($rr,true)) . EOL; + } + } } - + else + notice( t('Not found.') . EOL); } return $o; -- cgit v1.2.3