diff --git a/featherbb/Controller/Post.php b/featherbb/Controller/Post.php index 6b698ce1..68916185 100644 --- a/featherbb/Controller/Post.php +++ b/featherbb/Controller/Post.php @@ -357,6 +357,13 @@ public function gethost($req, $res, $args) { $args['pid'] = Hooks::fire('controller.post.gethost', $args['pid']); - $this->model->displayIpAddress($args['pid']); + $message = $this->model->displayIpAddress($args['pid']); + + return View::setPageInfo([ + 'title' => [\FeatherBB\Core\Utils::escape(ForumSettings::get('o_board_title')), __('Info')], + 'msg' => $message['message'], + 'backlink' => $message['back'], + 'html' => $message['html'], + ])->addTemplate('@forum/info')->display(); } } diff --git a/featherbb/Controller/Profile.php b/featherbb/Controller/Profile.php index d73cb6cb..28c06663 100644 --- a/featherbb/Controller/Profile.php +++ b/featherbb/Controller/Profile.php @@ -364,6 +364,13 @@ public function gethostip($req, $res, $args) { $args['ip'] = Hooks::fire('controller.profile.gethostip', $args['ip']); - $this->model->displayIpInfo($args['ip']); + $message = $this->model->displayIpInfo($args['ip']); + + return View::setPageInfo([ + 'title' => [\FeatherBB\Core\Utils::escape(ForumSettings::get('o_board_title')), __('Info')], + 'msg' => $message['message'], + 'backlink' => $message['back'], + 'html' => $message['html'], + ])->addTemplate('@forum/info')->display(); } } diff --git a/featherbb/Model/Post.php b/featherbb/Model/Post.php index af21562d..70720fbc 100644 --- a/featherbb/Model/Post.php +++ b/featherbb/Model/Post.php @@ -1374,6 +1374,10 @@ public function displayIpAddress($pid) $ip = Hooks::fire('model.post.display_ip_address_post', $ip); - throw new Error(sprintf(__('Host info 1'), $ip).'
'.sprintf(__('Host info 2'), @gethostbyaddr($ip)).'

'.__('Show more users').'', 400, true, true); + return [ + 'message' => sprintf(__('Host info 1'), $ip).'
'.sprintf(__('Host info 2'), @gethostbyaddr($ip)).'

'.__('Show more users').'', + 'back' => true, + 'html' => true, + ]; } } diff --git a/featherbb/Model/Profile.php b/featherbb/Model/Profile.php index e19cbe1c..823a6c75 100644 --- a/featherbb/Model/Profile.php +++ b/featherbb/Model/Profile.php @@ -1366,6 +1366,11 @@ public function sendEmail($mail) public function displayIpInfo($ip) { $ip = Hooks::fire('model.profile.display_ip_info', $ip); - throw new Error(sprintf(__('Host info 1'), $ip).'
'.sprintf(__('Host info 2'), @gethostbyaddr($ip)).'

'.__('Show more users').'', 400, true, true); + + return [ + 'message' => sprintf(__('Host info 1'), $ip).'
'.sprintf(__('Host info 2'), @gethostbyaddr($ip)).'

'.__('Show more users').'', + 'back' => true, + 'html' => true, + ]; } } diff --git a/featherbb/View/info.html.twig b/featherbb/View/info.html.twig new file mode 100644 index 00000000..b16fe415 --- /dev/null +++ b/featherbb/View/info.html.twig @@ -0,0 +1,26 @@ +{% extends '@forum/layout.html.twig' %} + +{% block content %} + {{ fireHook('view.error.start') }} + +
+

{{ trans('Info') }}

+
+
+

+ {% if html %} + {{ msg|raw }} + {% else %} + {{ msg }} + {% endif %} +

+ + {% if backlink %} +

{{ trans('Go back') }}

+ {% endif %} +
+
+
+ + {{ fireHook('view.error.end') }} +{% endblock content %} diff --git a/featherbb/View/layout.html.twig b/featherbb/View/layout.html.twig index 9ddf9d66..3f018de5 100644 --- a/featherbb/View/layout.html.twig +++ b/featherbb/View/layout.html.twig @@ -140,7 +140,7 @@ {% if can('board.read') and can('search.topics') %}