View Single Post
  #4  
Old 04-11-2021, 01:43 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 88,370
Kyttias is on a distinguished road
Default

So you know, you don't have to make a query for that information, its in the variable $mysidia->user->usergroup->gid, which exists in exactly the same way $mysidia->user->gid did in your query..

PHP Code:
$redirect "";
switch (
$mysidia->user->usergroup->gid){
  case 
1$redirect"yes"; break;
  case 
2$redirect"yes"; break;
  case 
3$redirect"yes"; break;
  case 
4$redirect "yes"; break;
  case 
5$redirect"yes"; break;
  default; 
$redirect "no";
}
if (
$redirect == "yes"){
  
$document->add(new Comment("<meta http-equiv='refresh' content='0; URL=http://www.dinotracks.mysidiahost.com/account' />"));

Which works great if you want to, in the future, redirect to different areas for the different groups, I guess...? But if you're only wanting different behavior for one of them... You could literally just do this in one if statement (if user group id does not equal 6, then redirect).

PHP Code:
if ($mysidia->user->usergroup->gid !== 6){
  
$document->add(new Comment("<meta http-equiv='refresh' content='0; URL=http://www.dinotracks.mysidiahost.com/account' />"));

I'm not sure if you could get away with a php header redirect with Mysidia's messiness, but I don't think have things up and running to test it out - so if your html redirect is good enough for your purposes, great!
__________________
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.

Last edited by Kyttias; 04-11-2021 at 01:50 PM.
Reply With Quote