Jump to content
TNG Community
tngrlkrz

Template Switch Mod

Recommended Posts

tngrlkrz

Just posted a new Template_Switch mod.  It is a variation of a private mod I use for testing across TNG templates,  and also can be used to offer users ability to select  templates.  Much faster switching between templates without entering Administration.  It is supported on TNG 12.3 and greater. 

Share this post


Link to post
Share on other sites
Janusz

Hello, Ron. Interesting mod, but unfortunately for me it works only on the local TNG, in the network no longer switches the template. Do you have any idea?

My Site https://kielakowie.pl/index.php

 

Edited by Janusz

Share this post


Link to post
Share on other sites
tngrlkrz

Hi,

I did encounter that anomaly during testing.  In my case, I found once I had a correct logfile path defined in Prolog (error log reporting mod), all worked OK.  I have it running both on my personal local sites, and on my test and production Websites, but all of them do have Prolog installed. I don't understand why this happens myself, and hoping someone else has an idea after looking at my mod's code.

Do you have error log reporting setup on the local host and not on the website? Could you try installing Prolog_Mod to see if it then works?  It is just a workaround for now.

I put a cautionary note in the wiki article on this, and appreciate your reporting it.

Share this post


Link to post
Share on other sites
Janusz

I don't know how it happened, but it started to work ... :)

I turned it into template_setting.php

header('Location: ' . $_SERVER['HTTP_REFERER']);

to

header('Location: ' . $_SERVER['HTTPS_REFERER']);

but there was an error, so I restored the settings and it worked.

 

Share this post


Link to post
Share on other sites
tngrlkrz
1 hour ago, Janusz said:

header('Location: ' . $_SERVER['HTTPS_REFERER']);

Yea...that causes a white screen.  No idea why restoring fixed it though.

Share this post


Link to post
Share on other sites
Ken Roy

Ron,

It might be because https might not be valid option in the referer.  See PHP Superglobal - $_SERVER

Share this post


Link to post
Share on other sites
tngrlkrz
1 hour ago, Ken Roy said:

Ron,

It might be because https might not be valid option.

Ken,

I am aware of that. It was just something Janus tried. I had http.

I don't understand why installing prolog causes the mod to work.

Share this post


Link to post
Share on other sites
tngrlkrz

Janus, did you try prolog?

Share this post


Link to post
Share on other sites
tngrlkrz
53 minutes ago, Janusz said:

Yes, no mistakes.

Sorry, what does that mean?  You installed Prolog, and Template Switch still doesn't work?

Share this post


Link to post
Share on other sites
Janusz

I already wrote that Template Switching works. I've installed the Porlog, but now it shows nothing.

vor 3 Stunden schrieb Janusz:

I don't know how it happened, but it started to work ... :)

I turned it into template_setting.php

header('Location: ' . $_SERVER['HTTP_REFERER']);

to

header('Location: ' . $_SERVER['HTTPS_REFERER']);

but there was an error, so I restored the settings and it worked.

 

 

Share this post


Link to post
Share on other sites
tngrlkrz
1 hour ago, Janusz said:

I've installed the Porlog, but now it shows nothing.

Sorry Janus, just trying to confirm the sequence of events.

Did Template Switching first start working after you installed Prolog?  (no errors are expected, just that the error logfile path is setup).

 

Share this post


Link to post
Share on other sites
Janusz

First started working Template Switching, then I installed Prolog.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×