Quote:
Originally posted by Erwin
Sure, but this means guests cannot contact you using the form.
Open contact.php.
Find:
PHP Code:
require('./global.php');
Add BELOW:
PHP Code:
if ($bbuserinfo[usergroupid] !=2 AND $bbuserinfo[usergroupid] !=6 AND $bbuserinfo[usergroupid] !=5) {
eval("standarderror(\"".gettemplate("error_nocontact")."\");");
exit;
}
Make sure you add the usergroupid's of your staff usergroups in there too so they can use the form.
The make a new template called:
error_nocontact
Add this as contents:
Code:
You have no permission to access the contact form.
Or whatever you want.
Done.
|
whats does the " exit; " do ? is that needed ?
also is it possible to place the group in an array.
Am a newbie at php, bit am trying different methods to get the same result at the moment.
i have :
PHP Code:
<?php
error_reporting(7);
include ("../../mainfile.php");
$index = 1;
global $Pmenu,$breadcrumb;
$Pmenu="";
$breadcrumb="Account Activation";
$defaultmessage = "Your message here... \n\n - $bbuserinfo[username]";
$defaultemail = "$bbuserinfo[email]";
$unwantedgroups = array('1', '6', '11');
getvbpvars();
include("header.php");
if ($bbuserinfo[usergroupid] == $unwantedgroups) {
eval("dooutput(\"".gettemplate('contact_error')."\");");
} else {
eval("dooutput(\"".gettemplate('contact')."\");");
}
include("footer.php");
?>
now i dont get any errors when running this, but the contact template is always displayed, even when am using a group id of 6 - so this dont work for some reason
i can get it to work, using this :
PHP Code:
<?php
error_reporting(7);
include ("../../mainfile.php");
$index = 1;
global $Pmenu,$breadcrumb;
$Pmenu="";
$breadcrumb="Account Activation";
$defaultmessage = "Your message here... \n\n - $bbuserinfo[username]";
$defaultemail = "$bbuserinfo[email]";
getvbpvars();
include("header.php");
if ($bbuserinfo[usergroupid]==1 || $bbuserinfo[usergroupid]==6 || $bbuserinfo[usergroupid]==11) {
eval("dooutput(\"".gettemplate('contact_error')."\");");
} else {
eval("dooutput(\"".gettemplate('contact')."\");");
}
include("footer.php");
?>
why dont my array version work ?