Jump to content
TNG Community
Scifer

Redirecting to Login when using extrapgtemplate.php

Recommended Posts

Scifer

I am using the extrapgtemplate.php to create articles using Template 15.  Is there a way to direct a visitor to the login screen if they click on a photo or an article prior to logging into the site?  If they use the menu items it automatically directs them to the login screen.  But clicking on a photo or article linked to the extrapg template it  throws a 404 error if you are not logged in.   I have identified the area in the index.php that seem to do this for menu items but I am unable to figure the syntax I would use or even if this is where I should make the alteration if it is possible  

 The site url is www.dirtroadsandfrontporches.com and I have linked to a sample article page using the extra page template on the large sample photo included in the template.  It works fine when logged in but the error shows it is looking for login.php in the /articles/ folder. 

 

Thanks in advance for any help.

Share this post


Link to post
Share on other sites
Merv

Hi,

What you are asking should happen without changing or adding any code.

There may be something possibly wrong in your index.php file. You may want to first try saving what you have on there and changing it out with a fresh copy to see if that rectifies the problem. 

Share this post


Link to post
Share on other sites
Scifer

Thanks for the reply and I apologize for the delay in responding.  I tried recopying the index.php but it still is not working.  I believe it may be due to the fact that I am not placing the custom user page in an existing media file such as histories.  I believe I am going have to use the history folder until I am more familiar with PHP so I can customize the site template to my needs.

Share this post


Link to post
Share on other sites
p.skarsjo

I seem to have the same or a similar problem. When a user clicks on an article or an image without being logged in, he gets a 404 Not Found. The server tries to find the login.php in the histories directory as opposed to the root directory.

This is the message from the 404 page (my site resides in directory "slekt"):

The requested URL /slekt/histories/login.php was not found on this server.

Any ideas, anyone?

Share this post


Link to post
Share on other sites
p.skarsjo

Ok, it seems to be a small bug in the template. Hopefully this will be fixed in an update from the author.  In the meantime, here's a workaround:

Firstly, you have to run the history_x.php files from the installation root directory, not the histories subdirectory. Obviously you'll need to reflect this change in the template 15 setup.

Secondly, you'll have to modify the content of historytemplate.php (and all your files derived from this template) to reflect the new location. The required changes are:

line 15: include("tng_begin.php");

line 17: $cms['tngpath'] = "";

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

×