Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum

Get help for TinyWebGallery, the best image gallery. The forum is also home for the Joomla JFUploader, TWG Flash Uploader and the Wordpress flash uploader.
It is currently 26. Nov 2024, 00:09

This forum is readonly now. Please use the new forum if you don't find the answer to your question here. The new forum is at https://www.tinywebgallery.com/blog/forum/


All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 30 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: 20. Apr 2017, 22:41 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
Because the difference is only the page parameter?

then you need to do some custom coding that the page itself is added encoded to the redirect url.

Best, Michael


Top
 Profile  
 
PostPosted: 20. Apr 2017, 22:55 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
You can use the following:

var iframe_redirect_url = "http://www.hafdal.dk/legstadaleit/gagnagrunnur/?lang=is&page=" + escape(window.location.href);

if
http://www.hafdal.dk/tng/getperson.php?personID=I4042&tree=Tree2

Should be redirected to this page:
http://www.hafdal.dk/legstadaleit/database/?lang=is&page=www.hafdal.dk%2Ftng%2Fgetperson.php%3FpersonID%3DI4042%26tree%3DTree2

Best, Michael


Top
 Profile  
 
PostPosted: 20. Apr 2017, 23:09 
Offline

Joined: 15. May 2016, 21:44
Posts: 78
Sorry I am not making myself clear.

I have thousands of pages in www.hafdal.dk/tng, like for example

http://www.hafdal.dk/tng/getperson.php?personID=I4042&tree=Tree2
or
www.hafdal.dk/tng/statistics.php
or
http://www.hafdal.dk/tng/showmedia.php?mediaID=3802
or
www.hafdal.dk/tng/cemeteries.php
or
http://www.hafdal.dk/tng/showmap.php?cemeteryID=72&tree=Tree2


ALL these pages have footer.php in common.

Normally, people view these pages in an advancd iframe in my WP page http://www.hafdal.dk/legstadaleit BUT Google finds these pages and links to them directly, and they are displayed without being inside my main site (http://www.hafdal.dk/legstadaleit).

I understand now, I cannot make the page redirect in an iframe in the main site, but what I want is, if people get a link to my "iframe pages" (in red color above), they get redirected to http://www.hafdal.dk/legstadaleit

Is that still possible?


Top
 Profile  
 
PostPosted: 20. Apr 2017, 23:18 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
does my last post not help you?
Is the parent domain completely different for all you pages?

You can define one url really easy. I think this is what you have running.
If you can define a pattern how the url is created you can do this with Javascript also before the ai_external.js.

Best, Michael


Top
 Profile  
 
PostPosted: 20. Apr 2017, 23:47 
Offline

Joined: 15. May 2016, 21:44
Posts: 78
Hello again Michael

Sorry! I didn not see your second post! I have now corrected the script in footer.php to be:
Code:
<script>
var iframe_redirect_url = "http://www.hafdal.dk/legstadaleit/gagnagrunnur/?lang=is&page=" + escape(window.location.href);
</script>
<script src="http://www.hafdal.dk/legstadaleit/wp-content/plugins/advanced-iframe/js/ai_external.js"></script>


The redirect works (YAY!!!!!!!!!) BUT it does not redirect correcly.

So going to http://www.hafdal.dk/tng/getperson.php?personID=I4042&tree=Tree2 gives me this URL: http://www.hafdal.dk/legstadaleit/gagnagrunnur/?lang=is&page=www.hafdal.dk%2Ftng%2Fthispagedoesnotexist.html&tree=Tree2 and not http://www.hafdal.dk/legstadaleit/database/?lang=is&page=www.hafdal.dk%2Ftng%2Fgetperson.php%3FpersonID%3DI4042%26tree%3DTree2

Thank you for being so patient! I have an illness that affects my brain (memory and concentration) so I am a bit slow sometimes :roll: Your support is excellent!!


Top
 Profile  
 
PostPosted: 21. Apr 2017, 06:24 
Offline

Joined: 15. May 2016, 21:44
Posts: 78
I have tested this a litte further and noticed that some links do redirect correctly.

Does not work: http://www.hafdal.dk/tng/getperson.php?personID=I4042&tree=Tree2
Does not work: http://www.hafdal.dk/tng/showmedia.php?mediaID=3802

Works OK: http://www.hafdal.dk/tng/statistics.php
Works OK: http://www.hafdal.dk/tng/cemeteries.php
Works OK: http://www.hafdal.dk/tng/showmap.php?cemeteryID=72&tree=Tree2

Any idea why some pages work and others do not work?


Top
 Profile  
 
PostPosted: 21. Apr 2017, 09:19 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
Why is

gagnagrunnur

var iframe_redirect_url = "http://www.hafdal.dk/legstadaleit/gagnagrunnur/?lang=is&page=" + escape(window.location.href);

and not
var iframe_redirect_url = "http://www.hafdal.dk/legstadaleit/database/?lang=is&page=" + escape(window.location.href);

set?

stange is that
window.location.href gives a pagedoesnotexist.html :(.

can you add

console.log('current url: ' window.location.href);

before the
var iframe_redirect_url

To get some debug information?

Best, Michael


Top
 Profile  
 
PostPosted: 21. Apr 2017, 13:59 
Offline

Joined: 15. May 2016, 21:44
Posts: 78
var iframe_redirect_url = "http://www.hafdal.dk/legstadaleit/gagnagrunnur/?lang=is&page=" + escape(window.location.href);

and

var iframe_redirect_url = "http://www.hafdal.dk/legstadaleit/database/?lang=is&page=" + escape(window.location.href);

work in the same way, I think it's because I use WPML plugin.

I added

console.log('current url: ' window.location.href);

to the script so it now looks like this:
Code:
<script>
 console.log('current url: ' window.location.href);
var iframe_redirect_url = "http://www.hafdal.dk/legstadaleit/database/?lang=is&page=" + escape(window.location.href);
</script>
<script src="http://www.hafdal.dk/legstadaleit/wp-content/plugins/advanced-iframe/js/ai_external.js"></script>


Top
 Profile  
 
PostPosted: 21. Apr 2017, 14:24 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
Sorry. a + is missing:

console.log('current url: ' + window.location.href);

Best, Michael


Top
 Profile  
 
PostPosted: 21. Apr 2017, 14:28 
Offline

Joined: 15. May 2016, 21:44
Posts: 78
Fixed it!


Top
 Profile  
 
PostPosted: 21. Apr 2017, 21:54 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
I know the problem. iframe_redirect_url does automatically add the parameters to the redirect url because then it is possible to pass them through the parent again. But In your case this does break the functionality.

I have fixed this in my code but you can try

var iframe_redirect_url = "http://www.hafdal.dk/legstadaleit/gagnagrunnur/?lang=is&page=" + escape(window.location.href) + "&";

this will cause that the invalid part I add for you is not used.

Please give it a try. If this does not work I can provide you with the fixed code.

Best, Michael


Top
 Profile  
 
PostPosted: 21. Apr 2017, 22:01 
Offline

Joined: 15. May 2016, 21:44
Posts: 78
That works perfectly! THANK YOU!!!

Should I keep this in my script?
Code:
 console.log('current url: ' + window.location.href);


Top
 Profile  
 
PostPosted: 21. Apr 2017, 22:25 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
No - this was only for debugging. I will also include into my script that this works even without the &

Best, Michael


Top
 Profile  
 
PostPosted: 21. Apr 2017, 22:27 
Offline

Joined: 15. May 2016, 21:44
Posts: 78
Ok thank you!

When the next update comes, will I have to change anything?


Top
 Profile  
 
PostPosted: 21. Apr 2017, 22:30 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
No - I simply check internally if a ? is already in the url and don't include the extra parameters then.

Best, Michael


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 30 posts ]  Go to page Previous  1, 2

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron
powered by phpbb | Datenschutz/ Privacy policy