2009-01-31, 06:25 AM
To re-direct after login based on user-group:
In member.php search for
change to: (for example)
Quick, easy questions
1) Do I need the { brackets? }
...or for this type of simple code, or should it be...
2) How about the space? I've seen examples both ways, so both must work?
if(
or
if (
##
Any suggestions on writing this better, or is it good enough now?
Thank you very much.
In member.php search for
redirect("index.php", $lang->redirect_registered);
change to: (for example)
if($mybb->user['usergroup'] == 1) {
redirect("forum1.php", $lang->redirect_registered1);
}
elseif($mybb->user['usergroup'] == 2) {
redirect("example2.php", $lang->redirect_registered2);
}
elseif($mybb->user['usergroup'] == 3) {
redirect("forum3.php", $lang->redirect_registered3);
}
elseif($mybb->user['usergroup'] == 4) {
redirect("example4.php", $lang->redirect_registered4);
}
else {
redirect("forum5.php", $lang->redirect_registered5);
}
Quick, easy questions
1) Do I need the { brackets? }
...or for this type of simple code, or should it be...
elseif($mybb->user['usergroup'] == 3)
redirect("forum3.php", $lang->redirect_registered3);
2) How about the space? I've seen examples both ways, so both must work?
if(
or
if (
##
Any suggestions on writing this better, or is it good enough now?
Thank you very much.