Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 06-15-2017, 03:01 AM
Fox Fox is offline
Member
 
Join Date: Oct 2016
Location: Australia
Posts: 34
Gender: Female
Credits: 5,942
Fox is on a distinguished road
Default 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.
Reply With Quote
  #2  
Old 06-15-2017, 05:37 AM
parayna's Avatar
parayna parayna is offline
Member
 
Join Date: May 2013
Location: Devon, UK
Posts: 342
Gender: Female
Credits: 16,082
parayna is on a distinguished road
Default

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.
__________________
It's been a long time. I had so much fun making a site back in 2016 that recently, when I started thinking about it again, I decided to come back and work on something small. It'll probably just be a personal project but who knows? We'll see, anyway.

Reply With Quote
  #3  
Old 06-15-2017, 07:12 AM
Fox Fox is offline
Member
 
Join Date: Oct 2016
Location: Australia
Posts: 34
Gender: Female
Credits: 5,942
Fox is on a distinguished road
Default

I think that it only applies to earlier versions :/
Reply With Quote
  #4  
Old 06-15-2017, 08:41 AM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 327,285
Hall of Famer is on a distinguished road
Default

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.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #5  
Old 06-20-2017, 06:03 AM
Fox Fox is offline
Member
 
Join Date: Oct 2016
Location: Australia
Posts: 34
Gender: Female
Credits: 5,942
Fox is on a distinguished road
Default

Thanks so much, I've had a play around and gotten the pages available to guests, cheers!
Reply With Quote
  #6  
Old 06-23-2017, 03:38 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 327,285
Hall of Famer is on a distinguished road
Default

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


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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

Currently Active Users: 365 (0 members and 365 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636