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: 1338
Joined: Thu Sep 25, 2014 10:36 am

Can anyone help me change this code?

Post by Bruce Banner »

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
Registered User
Posts: 20646
Joined: Thu Dec 19, 2002 8:08 am

Re: Can anyone help me change this code?

Post by david63 »

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!

I now no longer support any of my extensions but they will start to become available here
User avatar
KevC
Support Team Member
Support Team Member
Posts: 72343
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: Can anyone help me change this code?

Post by KevC »

Let's be honest, they'll just click back..... no....
instead of close tab....no....
:)
-:|:- Support Request Template -:|:-
Image
"Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb"
Bruce Banner
Registered User
Posts: 1338
Joined: Thu Sep 25, 2014 10:36 am

Re: Can anyone help me change this code?

Post by Bruce Banner »

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: 1338
Joined: Thu Sep 25, 2014 10:36 am

Re: Can anyone help me change this code?

Post by Bruce Banner »

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
Former Team Member
Posts: 22016
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: Can anyone help me change this code?

Post by RMcGirr83 »

But why shouldn't it open in a new window?
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then buy me a beer Image
Bruce Banner
Registered User
Posts: 1338
Joined: Thu Sep 25, 2014 10:36 am

Re: Can anyone help me change this code?

Post by Bruce Banner »

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: 72343
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: Can anyone help me change this code?

Post by KevC »

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
"Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb"
Bruce Banner
Registered User
Posts: 1338
Joined: Thu Sep 25, 2014 10:36 am

Re: Can anyone help me change this code?

Post by Bruce Banner »

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 »

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: 1338
Joined: Thu Sep 25, 2014 10:36 am

Re: Can anyone help me change this code?

Post by Bruce Banner »

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”