From 2a4e8972e0edfa3156d9ce54d68ce0e54c0ec289 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 18 Apr 2016 20:38:38 -0700 Subject: module updates --- Zotlabs/Module/Xchan.php | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Zotlabs/Module/Xchan.php (limited to 'Zotlabs/Module/Xchan.php') diff --git a/Zotlabs/Module/Xchan.php b/Zotlabs/Module/Xchan.php new file mode 100644 index 000000000..526580fad --- /dev/null +++ b/Zotlabs/Module/Xchan.php @@ -0,0 +1,47 @@ +' . t('Xchan Lookup') . ''; + + $o .= '
'; + $o .= t('Lookup xchan beginning with (or webbie): '); + $o .= ''; + $o .= '
'; + $o .= '

'; + + if(x($_GET, 'addr')) { + $addr = trim($_GET['addr']); + + $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) { + $o .= str_replace(array("\n", " "), array("
", " "), 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 $rrr) + $o .= str_replace(array("\n", " "), array("
", " "), print_r($rrr, true)) . EOL; + } + } + } + else + notice( t('Not found.') . EOL); + + } + return $o; + } + +} -- cgit v1.2.3