Creating A Dialog Page

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
User avatar
Exclusive
Registered User
Posts: 676
Joined: Mon Jun 25, 2018 1:33 pm

Creating A Dialog Page

Post by Exclusive »

Please someone should click on (this link), Select Wire transfer, Then scroll down and click the PURCHASE button.

dialog-page.png

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
(or)

Code: Select all

/ucp.php?mode=delete_cookies
Last edited by Exclusive on Thu Jan 10, 2019 8:05 am, edited 4 times in total.
Use Search Button to get Instant Results | Follow Forum Rules
Avoid Spams in the forum to prevent banning the offending account. | ⟿ Visit My Awesome phpBB Forum! ⬳

Best Web Hosting with 99.9% Uptime! | ✔ Buy Cheap Domain Names
User avatar
KevC
Support Team Member
Support Team Member
Posts: 72342
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: Creating A Dialog Page

Post by KevC »

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.....
-:|:- Support Request Template -:|:-
Image
"Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb"
User avatar
Exclusive
Registered User
Posts: 676
Joined: Mon Jun 25, 2018 1:33 pm

Re: Creating A Dialog Page

Post by Exclusive »

KevC 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.....
Something similar to that of the pbpBB

Code: Select all

/viewonline.php?mode=whois
(or)

Code: Select all

/ucp.php?mode=delete_cookies
Last edited by Exclusive on Thu Jan 10, 2019 8:15 am, edited 1 time in total.
Use Search Button to get Instant Results | Follow Forum Rules
Avoid Spams in the forum to prevent banning the offending account. | ⟿ Visit My Awesome phpBB Forum! ⬳

Best Web Hosting with 99.9% Uptime! | ✔ Buy Cheap Domain Names
User avatar
Exclusive
Registered User
Posts: 676
Joined: Mon Jun 25, 2018 1:33 pm

Re: Creating A Dialog Page

Post by Exclusive »

Any help??
Use Search Button to get Instant Results | Follow Forum Rules
Avoid Spams in the forum to prevent banning the offending account. | ⟿ Visit My Awesome phpBB Forum! ⬳

Best Web Hosting with 99.9% Uptime! | ✔ Buy Cheap Domain Names
User avatar
KevC
Support Team Member
Support Team Member
Posts: 72342
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: Creating A Dialog Page

Post by KevC »

a) be patient
b) I suspect not many people have a clue what you want, especially with that online and cookie link analogy.
-:|:- Support Request Template -:|:-
Image
"Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb"
User avatar
HiFiKabin
Community Team Member
Community Team Member
Posts: 6673
Joined: Wed May 14, 2014 9:10 am
Location: Swearing at the PC, UK
Name: James
Contact:

Re: Creating A Dialog Page

Post by HiFiKabin »

Exclusive wrote: Wed Jan 09, 2019 2:32 pm Any help??
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!
User avatar
Exclusive
Registered User
Posts: 676
Joined: Mon Jun 25, 2018 1:33 pm

Re: Creating A Dialog Page

Post by Exclusive »

Any help??
I created a post(viewtopic.php?f=556&t=2498826) for this in the support forum and it was locked!
Use Search Button to get Instant Results | Follow Forum Rules
Avoid Spams in the forum to prevent banning the offending account. | ⟿ Visit My Awesome phpBB Forum! ⬳

Best Web Hosting with 99.9% Uptime! | ✔ Buy Cheap Domain Names
User avatar
EA117
Registered User
Posts: 2158
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Creating A Dialog Page

Post by EA117 »

Hi Exclusive.

I'm assuming the core question here is regarding the HTML & CSS nature of the box that is shown "in front of the web page" in at least two of the three example cases referenced. (The bank info dialog, and the /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.)

Are you looking for just "what kind of HTML and CSS is used to create such a thing?" In which case the information needed may be https://www.w3schools.com/howto/howto_css_modals.asp and their example https://www.w3schools.com/howto/tryit.a ... _css_modal. If you're just trying to make such a display within an otherwise static page, using this in conjunction with the Pages extension like KevC suggested might be the way to go. (I've never used the Pages extension myself yet.)

I would think with Javascript, HTML and CSS alone, you could add such a display for a particular item within a phpBB style.

Or are you saying "I'm writing a phpBB extension or modifying core phpBB code, and want to use whatever framework support phpBB has for creating such a display as part of my new processing bring written in php?" That isn't something I could usefully comment on, but maybe someone else can.
User avatar
Exclusive
Registered User
Posts: 676
Joined: Mon Jun 25, 2018 1:33 pm

Re: Creating A Dialog Page

Post by Exclusive »

Any help on this??
Use Search Button to get Instant Results | Follow Forum Rules
Avoid Spams in the forum to prevent banning the offending account. | ⟿ Visit My Awesome phpBB Forum! ⬳

Best Web Hosting with 99.9% Uptime! | ✔ Buy Cheap Domain Names
User avatar
mrgoldy
Former Team Member
Posts: 1394
Joined: Tue Oct 06, 2009 7:34 pm
Location: The Netherlands
Name: Gijs
Contact:

Re: Creating A Dialog Page

Post by mrgoldy »

That is already available within phpBB itself.
Add a link to your page with <a href="link to your page" data-ajax="true">Click me</a>.
The data-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:

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);
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.
phpBB Studio / Member of the Studio

Contributing: You can do it too! Including testing Pull Requests (PR).
phpBB Development and Testing made easy.
User avatar
Exclusive
Registered User
Posts: 676
Joined: Mon Jun 25, 2018 1:33 pm

Re: Creating A Dialog Page

Post by Exclusive »

mrgoldy wrote: Wed Feb 20, 2019 8:58 am That is already available within phpBB itself.
Yes, I thought as much, that is why I was making reference with the /ucp.php?mode=delete_cookies page
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>.
The data-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:

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);
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.
This is exactly what I was looking for!

But I'm a bit confused with the above codes provided, where do I add them to?
Use Search Button to get Instant Results | Follow Forum Rules
Avoid Spams in the forum to prevent banning the offending account. | ⟿ Visit My Awesome phpBB Forum! ⬳

Best Web Hosting with 99.9% Uptime! | ✔ Buy Cheap Domain Names
User avatar
Exclusive
Registered User
Posts: 676
Joined: Mon Jun 25, 2018 1:33 pm

Re: Creating A Dialog Page

Post by Exclusive »

Bump...
Use Search Button to get Instant Results | Follow Forum Rules
Avoid Spams in the forum to prevent banning the offending account. | ⟿ Visit My Awesome phpBB Forum! ⬳

Best Web Hosting with 99.9% Uptime! | ✔ Buy Cheap Domain Names
User avatar
Exclusive
Registered User
Posts: 676
Joined: Mon Jun 25, 2018 1:33 pm

Re: Creating A Dialog Page

Post by Exclusive »

Exclusive wrote: Tue Dec 03, 2019 10:25 pm Bump...
Bump...
Use Search Button to get Instant Results | Follow Forum Rules
Avoid Spams in the forum to prevent banning the offending account. | ⟿ Visit My Awesome phpBB Forum! ⬳

Best Web Hosting with 99.9% Uptime! | ✔ Buy Cheap Domain Names
Post Reply

Return to “phpBB Custom Coding”