Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Addons and Modifications > Mys v1.3.x Mods

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 01-15-2015, 03:17 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 111,494
Kyttias is on a distinguished road
Arrow Seamless Login/Logout Redirect to Index

login/logout redirect
I can't believe I didn't figure this one out sooner! Inside view/loginview.php, inside each of the functions, add in this line before the $mysidia variable is set:
PHP Code:
header"Location: /" ); 

(The online users count won't update until you visit another page, btw?)

  Spoiler: loginview.php 
In case anyone needs my final version of the file (you shouldn't), here it is, for reference:
PHP Code:
<?php

class LoginView extends View{
    
    public function 
index(){
        
header"Location: /" );
        
$mysidia Registry::get("mysidia");
        
$document $this->document;

        if(
$mysidia->input->post("submit")){
            
$document->setTitle($this->lang->success_title);
            
$document->addLangvar("Welcome back {$mysidia->input->post("username")}{$this->lang->success}");
            return;
        }
        
        
$document->setTitle($this->lang->title);
        
$document->addLangvar($this->lang->login);

        
# $loginForm = $mysidia->frame->getSidebar()->getLoginBar();
        # $document->add($loginForm);    
    
}
    
    public function 
logout(){
        
header"Location: /" );
        
$mysidia Registry::get("mysidia");
        
$document $this->document;        
        
$document->setTitle($this->lang->logout_title);
        
$document->addLangvar($this->lang->logout);    
    }
}
?>
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.
Reply With Quote
  #2  
Old 01-15-2015, 05:06 PM
rickasawr's Avatar
rickasawr rickasawr is offline
Member
 
Join Date: Apr 2011
Location: United States
Posts: 51
Gender: Male
Credits: 8,637
rickasawr is on a distinguished road
Default

Very interesting! Might make a use of this in my script!

Also, what do you use to make your gif's when you display your webpages? Ive seen some things like this on tumblr and was very interested in finding out!
__________________
Reply With Quote
  #3  
Old 01-15-2015, 08:26 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 111,494
Kyttias is on a distinguished road
Default

Quote:
Originally Posted by rickasawr View Post
Also, what do you use to make your gif's when you display your webpages? Ive seen some things like this on tumblr and was very interested in finding out!
It's a nifty little program called LICEcap. ^^
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.
Reply With Quote
  #4  
Old 01-15-2015, 08:38 PM
rickasawr's Avatar
rickasawr rickasawr is offline
Member
 
Join Date: Apr 2011
Location: United States
Posts: 51
Gender: Male
Credits: 8,637
rickasawr is on a distinguished road
Default

Thanks! I bookmarked the site for when i need to use it!
__________________
Reply With Quote
  #5  
Old 01-16-2015, 12:46 AM
MikiHeart's Avatar
MikiHeart MikiHeart is offline
Premium Member
 
Join Date: Apr 2009
Posts: 187
Gender: Female
Credits: 23,439
MikiHeart
Default

I love you <3 I wanted to do this <3
Reply With Quote
  #6  
Old 03-09-2015, 04:17 PM
CallumCharlton CallumCharlton is offline
Member
 
Join Date: Mar 2015
Posts: 33
Gender: Male
Credits: 6,696
CallumCharlton is on a distinguished road
Default

Thanks very much! Modding my script is becoming enticing :o
Reply With Quote
  #7  
Old 04-19-2015, 08:11 PM
AndromedaKerova's Avatar
AndromedaKerova AndromedaKerova is offline
ChibiFur Queen
 
Join Date: Nov 2014
Location: England
Posts: 83
Gender: Female
Credits: 4,274
AndromedaKerova is on a distinguished road
Default

It doesn't seem to work for me. The logout button seems to still take me to a "/login/logout" page
__________________
Failing at being normal since 1990.
Reply With Quote
  #8  
Old 04-19-2015, 09:44 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 111,494
Kyttias is on a distinguished road
Default

In the original post I left a spoiler tag. Open it up and paste the entire contents to replace the entire file? It appears I forgot to mention one also needs to place a header redirect inside the logout function a few lines down, as well. No one else mentioned this because they probably just replaced their entire file, I guess.
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.
Reply With Quote
  #9  
Old 04-20-2015, 12:16 AM
AndromedaKerova's Avatar
AndromedaKerova AndromedaKerova is offline
ChibiFur Queen
 
Join Date: Nov 2014
Location: England
Posts: 83
Gender: Female
Credits: 4,274
AndromedaKerova is on a distinguished road
Default

I think I might just be an idiot. Or tired.
All fixed and working now. :D
Doesn't even take me to that pointless /index page either.
__________________
Failing at being normal since 1990.
Reply With Quote
  #10  
Old 09-17-2015, 12:19 PM
Cirris's Avatar
Cirris Cirris is offline
Member
 
Join Date: Sep 2015
Posts: 3
Gender: Female
Credits: 397
Cirris is on a distinguished road
Default

Does anyone know what the proper way to write the location when your site is installed into a subfolder?

header( "Location: /" ); will redirect me to the root of my site. (Which is not where my install of mysidia is located.)

I tried header( "Location: subfolder/" ); but it only half works. When I login, it takes me to the correct page, but the url duplicates the subfolder. www.mysite.com/subfolder/subfolder When I logout, it duplicates the subfolder in the url so many times it breaks everything.
Reply With Quote
Reply

Tags
login, login redirect, redirect


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Redirect after login Empress_Swanbottom Questions and Supports 10 06-03-2020 11:12 AM
Mys v1.3.4 Index Page Mod (Use PHP inside Index!) Kyttias Mys v1.3.x Mods 1 01-19-2015 11:49 PM
Custom pages redirect to index Vaporman87 Questions and Supports 6 02-21-2014 07:57 PM
Login/Logout Error tahbikat Questions and Supports 15 02-15-2014 11:26 AM
Redirect to Previous Page after Login/Logout fadillzzz Mys v1.1.x Mods 6 02-02-2011 06:24 PM


All times are GMT -5. The time now is 08:23 AM.

Currently Active Users: 1097 (0 members and 1097 guests)
Threads: 4,081, Posts: 32,032, 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