Files
ussr-hubzilla-addons/link/Mod_Link.php
T

41 lines
617 B
PHP
Raw Normal View History

<?php
namespace Zotlabs\Module;
2026-07-16 10:29:49 +03:00
use Zotlabs\Web\Controller;
2026-07-16 10:29:49 +03:00
class Link extends Controller {
2026-07-16 10:29:49 +03:00
function init() {
2020-11-07 16:02:21 +03:00
}
2026-07-16 10:29:49 +03:00
function get() {
2020-04-04 23:18:26 +03:00
2026-07-16 10:29:49 +03:00
$item_id = ((argc() > 1) ? intval(argv(1)) : 0);
2026-07-16 10:29:49 +03:00
if(! $item_id) {
\App::$error = 404;
notice( t('Item not found.') . EOL);
return;
2020-11-07 16:02:21 +03:00
}
2026-07-16 10:29:49 +03:00
$r = q("select uuid from item where id = %d limit 1",
intval($item_id)
2020-11-07 16:02:21 +03:00
);
2026-07-16 10:29:49 +03:00
if (!$r) {
notice( t('Item not found.') . EOL);
return;
2020-11-07 16:02:21 +03:00
}
2026-07-16 10:29:49 +03:00
if (get_config('link','hideasides')) {
goaway(z_root() . '/display/' . $r[0]['uuid'] . '?link_hideasides=1');
2020-11-07 16:02:21 +03:00
}
2020-04-04 23:18:26 +03:00
2026-07-16 10:29:49 +03:00
goaway(z_root() . '/display/' . $r[0]['uuid']);
2020-04-04 23:18:26 +03:00
}
2020-04-04 23:18:26 +03:00
}