Can anyone help me change this code?

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
Bruce Banner
Registered User
Posts: 626
Joined: Thu Sep 25, 2014 10:36 am

Can anyone help me change this code?

Post by Bruce Banner » Sat May 27, 2017 2:07 pm

From includes/ucp/ucp_register.php

Code: Select all

					'U_COPPA_NO'		=> append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register&coppa=0'),
					'U_COPPA_YES'		=> 'https://www.google.com',
My problem is I have an extension installed called External Links Open in New Window and if a guest on my forum clicks the button indicating they're underage, they're redirected to Google as I want them to be, but in another tab because of the extension. I'd like to force Google to open in the same tab regardless of the extension. Is there any way I can do that?

User avatar
david63
Jr. Extension Validator
Posts: 14932
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Can anyone help me change this code?

Post by david63 » Sat May 27, 2017 2:32 pm

Bruce Banner wrote:
Sat May 27, 2017 2:07 pm
Is there any way I can do that?
Disable the extension that is opening in a new window would be the obvious answer
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

User avatar
KevC
Support Team Member
Support Team Member
Posts: 68406
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: Can anyone help me change this code?

Post by KevC » Sat May 27, 2017 2:43 pm

Let's be honest, they'll just click back..... no....
instead of close tab....no....
:)
-:|:- Support Request Template -:|:-
Image
Cheap UK Hosting
"In the land of the blind the little green bloke with no pupils is king - init!"

Bruce Banner
Registered User
Posts: 626
Joined: Thu Sep 25, 2014 10:36 am

Re: Can anyone help me change this code?

Post by Bruce Banner » Sat May 27, 2017 2:44 pm

david63 wrote:
Sat May 27, 2017 2:32 pm
Bruce Banner wrote:
Sat May 27, 2017 2:07 pm
Is there any way I can do that?
Disable the extension that is opening in a new window would be the obvious answer
I don't want to though, because the registration page is the only location where the extension gives me a problem. Is there no way to just modify that code?

Bruce Banner
Registered User
Posts: 626
Joined: Thu Sep 25, 2014 10:36 am

Re: Can anyone help me change this code?

Post by Bruce Banner » Sat May 27, 2017 2:48 pm

KevC wrote:
Sat May 27, 2017 2:43 pm
Let's be honest, they'll just click back..... no....
instead of close tab....no....
:)
That doesn't quite make sense but I think I understand you anyway. It would just look better to me if the redirect opened in the same window. It just looks silly opening in a new tab, imo. Is there no way around it?

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 20957
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: Can anyone help me change this code?

Post by RMcGirr83 » Sat May 27, 2017 3:19 pm

But why shouldn't it open in a new window?
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

Bruce Banner
Registered User
Posts: 626
Joined: Thu Sep 25, 2014 10:36 am

Re: Can anyone help me change this code?

Post by Bruce Banner » Sat May 27, 2017 3:29 pm

RMcGirr83 wrote:
Sat May 27, 2017 3:19 pm
But why shouldn't it open in a new window?
Like I said, I just think it looks silly. I'd just prefer the redirect to Google to open in the same window.

User avatar
KevC
Support Team Member
Support Team Member
Posts: 68406
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: Can anyone help me change this code?

Post by KevC » Sat May 27, 2017 4:46 pm

Bruce Banner wrote:
Sat May 27, 2017 2:48 pm
KevC wrote:
Sat May 27, 2017 2:43 pm
Let's be honest, they'll just click back..... no....
instead of close tab....no....
:)
That doesn't quite make sense but I think I understand you anyway. It would just look better to me if the redirect opened in the same window. It just looks silly opening in a new tab, imo. Is there no way around it?
What I mean is, if they click one answer and it doesn't let them in, they'll just go back a page and click the other answer instead. So it's a little bit moot as to how it takes them to google.
-:|:- Support Request Template -:|:-
Image
Cheap UK Hosting
"In the land of the blind the little green bloke with no pupils is king - init!"

Bruce Banner
Registered User
Posts: 626
Joined: Thu Sep 25, 2014 10:36 am

Re: Can anyone help me change this code?

Post by Bruce Banner » Sun May 28, 2017 10:27 am

KevC wrote:
Sat May 27, 2017 4:46 pm
Bruce Banner wrote:
Sat May 27, 2017 2:48 pm
KevC wrote:
Sat May 27, 2017 2:43 pm
Let's be honest, they'll just click back..... no....
instead of close tab....no....
:)
That doesn't quite make sense but I think I understand you anyway. It would just look better to me if the redirect opened in the same window. It just looks silly opening in a new tab, imo. Is there no way around it?
What I mean is, if they click one answer and it doesn't let them in, they'll just go back a page and click the other answer instead. So it's a little bit moot as to how it takes them to google.
I understand. Like I said, it's just a matter of how it looks to me.

crossfire151
Registered User
Posts: 4
Joined: Thu Jun 01, 2017 12:31 pm

Re: Can anyone help me change this code?

Post by crossfire151 » Fri Jun 02, 2017 1:34 am

That's pretty simple to do, goto the extensions folder and navigate to: styles\all\template\event
Edit the file: overall_footer_after.html

Change this:

Code: Select all

if(hostname && removeSubdomain(hostname)!==source)
   {
      window.open(href);
      return false;
   }
Replace it with this:

Code: Select all

if(hostname && removeSubdomain(hostname)!==source)
   {
	  if (href == "https://www.google.com")
		  {
			  window.location = "https://www.google.com";
		  }
	   else {
		   window.open(href);
	   }
      return false;
   }
Hope this helped :)


-Crossfire151

Bruce Banner
Registered User
Posts: 626
Joined: Thu Sep 25, 2014 10:36 am

Re: Can anyone help me change this code?

Post by Bruce Banner » Mon Sep 24, 2018 12:31 am

Sorry for taking over a year to thank ya for this but when a coupla days passed, I just gave up on the topic and didn't know about your reply until now. That worked perfectly, thanks!

Post Reply

Return to “phpBB Custom Coding”

Who is online

Users browsing this forum: No registered users and 209 guests