Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff
Author Message
Dawg
RavenNuke(tm) Development Team



Joined: Nov 07, 2003
Posts: 928

PostPosted: Sun Mar 16, 2008 9:49 pm Reply with quote

Greetings All,
Is there a way to alter the "You are trying to access a restricted area." for the folks that are not logged in? I am thinking a landing page of some sort. It would really be cool if you could call them on a module specfic basis.

Dawg
 
View user's profile Send private message
64bitguy
The Mouse Is Extension Of Arm



Joined: Mar 06, 2004
Posts: 1164

PostPosted: Mon Mar 17, 2008 5:31 am Reply with quote

Module access is controlled by the root file "modules.php".

It is this file that would tell (for example) an unregistered user that they are trying to access a module set to "Registered Users" as the minimum access level and thus, that they are trying "to access a restricted area". Other access levels are also controlled and deliver a different message depending on what your Security Level is (Anonymous, Registered, Administrator, Subscriber, etc...)

In fact, this IS a landing page (It has the Nuke wrapper around it!) inside the module itself.

Specifically, if you were trying to access "Downloads" and it requires that you be a registered user (and you weren't), you still end up at the downloads module homepage; however, you get this error inside a mock up of that page (instead of actually being able to execute the index.php of that module!

In other words, pay close attention to the hyperlink when accessing a restricted page and notice how it is the same value of the page that would work for a registered user!

Inside the module.php file you will find the code that does this (amongst other things) in the section starting with:
Code:
      $pagetitle = "- "._ACCESSDENIED;

      include("header.php");
      title($sitename.": "._ACCESSDENIED);
      OpenTable();
      echo "<center><strong>"._RESTRICTEDAREA."</strong><br><br>"._MODULEUSERS;


The language file (English for example) at \language\lang-english.php converts this to the message I have in quotes below (centered in the middle of my page).

Quote:
You are trying to access a restricted area.

We are Sorry, but this section of our site is for Registered Users Only.

You can register for free by clicking here, then you can
access this section without restrictions. Thanks.

[ Go Back ]


Now, if you wanted to pretty it up with graphics or what have you, that's fine and simple enough to do by altering what is displayed (either by editing the modules.php to insert graphics code, or in the language file itself.

I believe most sites have it formatted like mine and while you could alter the code to have it reflect a specific message for different modules, I would not recommend it only because it would become something that you need to maintain for each module. What is already built-in presents a nice, consistent message, inside a compliant wrapper that is easily customized.

Hope this helps!
Steph

_________________
Steph Benoit
100% Section 508 and W3C HTML5 and CSS Compliant (Truly) Code, because I love compliance. 
View user's profile Send private message
Dawg







PostPosted: Tue Mar 18, 2008 4:36 am Reply with quote

Thank You Thank You and Thank You!

That was the ticket. My issue is I have a TON of Custom Content that Google misses out on. So I will use this for Mr. G.

Thank You again....

Dawg
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff

View next topic
View previous topic
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 vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©