2019-02-19 20:31:39 +00:00
|
|
|
<?php
|
|
|
|
|
2022-02-16 04:08:28 +00:00
|
|
|
namespace Code\Module;
|
2019-02-19 20:31:39 +00:00
|
|
|
|
2022-02-16 04:08:28 +00:00
|
|
|
use Code\Web\Controller;
|
2019-02-19 20:31:39 +00:00
|
|
|
|
2021-12-02 23:02:31 +00:00
|
|
|
class Q extends Controller
|
|
|
|
{
|
|
|
|
|
|
|
|
public function init()
|
|
|
|
{
|
|
|
|
|
|
|
|
$ret = ['success' => false];
|
|
|
|
|
|
|
|
$h = argv(1);
|
|
|
|
if (!$h) {
|
|
|
|
json_return_and_die($ret);
|
|
|
|
}
|
|
|
|
|
2021-12-03 03:01:39 +00:00
|
|
|
$r = q(
|
|
|
|
"select * from hubloc left join site on hubloc_url = site_url where hubloc_hash = '%s' and site_dead = 0",
|
2021-12-02 23:02:31 +00:00
|
|
|
dbesc($h)
|
|
|
|
);
|
|
|
|
if ($r) {
|
|
|
|
$ret['success'] = true;
|
|
|
|
$ret['results'] = ids_to_array($r, 'hubloc_id_url');
|
|
|
|
}
|
|
|
|
json_return_and_die($ret);
|
|
|
|
}
|
2021-12-03 03:01:39 +00:00
|
|
|
}
|