How do I create such dialog page in pbpBB (the pop-up page in the same window; with the bank details)?
Something similar to that of the pbpBB
Code: Select all
/viewonline.php?mode=whois
Code: Select all
/ucp.php?mode=delete_cookies
Code: Select all
/viewonline.php?mode=whois
Code: Select all
/ucp.php?mode=delete_cookies
Something similar to that of the pbpBBKevC wrote: ↑Wed Jan 09, 2019 11:03 am Probably with the pages extension https://www.phpbb.com/customise/db/extension/pages/
And then just drop in the code for the rest of it.
Whether I would trust putting my bank info in to such a page is a whole other matter.....
Code: Select all
/viewonline.php?mode=whois
Code: Select all
/ucp.php?mode=delete_cookies
Please keep in mind that we have a six hour bumping rule. All team members and community members here are volunteers, so we ask you to wait at least six hours before bumping your topic or, if no-one has replied to your last post, edit your last post. Thanks!
/ucp.php?mode=delete_cookies
example. I'm unclear on in what context /viewonline.php?mode=whois
might be showing such a "dialog", but not understanding that one example probably is not important. For me, the whois links in phpBB just create a "normal pop-up" in a new separate browser window.)<a href="link to your page" data-ajax="true">Click me</a>
.data-ajax="true"
is the important part here, as this makes it an AJAX call.Code: Select all
global $request, $template, $phpbb_container;
$title = 'My message title';
$message = 'My <strong>awesome</strong> message.';
if ($request->is_ajax())
{
// The request is AJAX, so send an AJAX response
$json_response = new \phpbb\json_response;
$json_response->send(array(
'MESSAGE_TITLE' => $title,
'MESSAGE_TEXT' => $message,
));
}
// If we get to this point, it means the request was NOT AJAX, so output a regular page.
$helper = $phpbb_container->get('controller.helper');
$template->assign_vars(array(
'MESSAGE_TITLE' => $title,
'MESSAGE_TEXT' => $message,
));
return $helper->render('message_body.html', $title);
Yes, I thought as much, that is why I was making reference with the /ucp.php?mode=delete_cookies page
This is exactly what I was looking for!mrgoldy wrote: ↑Wed Feb 20, 2019 8:58 am Add a link to your page with<a href="link to your page" data-ajax="true">Click me</a>
.
Thedata-ajax="true"
is the important part here, as this makes it an AJAX call.
Then wherever your link leads to in PHP, you need to do this:This will also take into account for when AJAX is not available on the device that is clicking the link and will show a regular page like any other.Code: Select all
global $request, $template, $phpbb_container; $title = 'My message title'; $message = 'My <strong>awesome</strong> message.'; if ($request->is_ajax()) { // The request is AJAX, so send an AJAX response $json_response = new \phpbb\json_response; $json_response->send(array( 'MESSAGE_TITLE' => $title, 'MESSAGE_TEXT' => $message, )); } // If we get to this point, it means the request was NOT AJAX, so output a regular page. $helper = $phpbb_container->get('controller.helper'); $template->assign_vars(array( 'MESSAGE_TITLE' => $title, 'MESSAGE_TEXT' => $message, )); return $helper->render('message_body.html', $title);