Log in

View Full Version : Calling a custom template


Leo[GR]
02-15-2003, 11:18 AM
]I have made a group called "Inactive users". In this group I move all the users that have been inactive for a long time (of course :)). Now at my question, if I make a custom template named "error_inactiveusers" how I call it when an inactive user tries to login ? (I don't let them see the forum). I just want to tell them to contact the admin if they want their account to be active again.

Xenon
02-15-2003, 11:23 AM
eval("standarderror(\"".gettemplate("error_inactiveusers")."\");");

Leo[GR]
02-15-2003, 11:26 AM
Thx Xenon, where do I insert this code ? I mean which .php file do I edit ?

Leo[GR]
02-15-2003, 12:07 PM
Ok, I think I must edit member.php If my $usergroupid=140 what exactly are the changes that I must make ?

Dean C
02-15-2003, 12:24 PM
Find in member.php:


if ($action=="login") {


Below it add:


if ($bbuserinfo['usergroupid']=140) {
eval("standarderror(\"".gettemplate("error_inactiveusers")."\");");


Not tested but should work :)

- miSt

Leo[GR]
02-15-2003, 12:42 PM
]Gives me a parse error. And if I change it to another location it works but gives all users the inactivity error :(

Dean C
02-15-2003, 01:15 PM
Eek i didn't close the statement. use this instead:


if ($bbuserinfo['usergroupid']=140) {
eval("standarderror(\"".gettemplate("error_inactiveusers")."\");");
}

Regards

- miSt

Leo[GR]
02-15-2003, 01:26 PM
]Thx but parse error again :(

Xenon
02-15-2003, 01:31 PM
if ($bbuserinfo['usergroupid']==140) {
eval("standarderror(\"".gettemplate("error_inactiveusers")."\");");
}

have forgotten an == that's why it occurs for all users..

also i'd put this at the end of global.php so every file is protected :)

Leo[GR]
02-15-2003, 02:19 PM
aaaah, are you sure guys it's the right place to insert the code ? I still get the default "no permission to access this page" error.

Xenon
02-15-2003, 04:17 PM
well if you put it directly after checkipban();
$logincode=makelogincode();

in global.php it would work.

Leo[GR]
02-15-2003, 05:32 PM
]Ok it works now :) One last question, what's the code for a user to logout ? I want to insert it in my template. Thx for your help :)

Edit: I have tried the "action logout" but it doesn't work. It just sits there without login out. I would like to logout and clear the cookies.

Xenon
02-16-2003, 10:09 AM
hmm, you can do it with a javascript redirect to call the logoutpage :)