Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Questions and Supports (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=18)
-   -   Allow guests to View pages (http://www.mysidiaadoptables.com/forum/showthread.php?t=5468)

Fox 06-15-2017 03:01 AM

Allow guests to View pages
 
I saw this same post for an earlier version of the script, but I have the latest version and I only want to make a handful of pages viewable by guests not logged in.
I tried to find a loggin section of code to edit but I'm lost as to how to make a few views.

parayna 06-15-2017 05:37 AM

I don't have the script up right this moment but I think on the view files, on pages guests can't view, there is a line of code that says if user is not logged in display "Guests can't view this page please log in". I know lots of pages have that code somewhere :) Sorry I couldn't be more help! I'm out at the moment so can't get an example up.

Fox 06-15-2017 07:12 AM

I think that it only applies to earlier versions :/

Hall of Famer 06-15-2017 08:41 AM

To achieve this, you can add this line to your constructor method for the controller:

Code:

public function __construct(){     
    parent::__construct("member");       
    // The rest of constructor code if any     
}

This will mark the controller and its subsequent actions accessible only to logged in users, it is used in the account controller(http://yourdomain.com/account). If you want certain actions to be accessible by members only, you can add these lines to the action methods instead:

Code:

    $this->access = "member";       
    $this->handleAccess();

If you dont understand terms such as controller and actions, please let me know and I will explain further.

Fox 06-20-2017 06:03 AM

Thanks so much, I've had a play around and gotten the pages available to guests, cheers!

Hall of Famer 06-23-2017 03:38 PM

To make it available for guests, just change this part $this->access = "member" to $this->access = "guest".


All times are GMT -5. The time now is 07:52 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.