UBB.Dev
Posted By: oceanwest Alternate Nav Bar by Group... - 01/26/2005 8:19 PM
I altered this in my ubb.inc.php but it isn't working...

Code
<br /> if (($user['U_Groups'] == '-6-') ||  ($user['U_Groups'] == '-10-') || ($user['U_Groups'] == '-11-') || ($user['U_Groups'] == '-12-')) {<br /><br /><br />				// -------------------------------------------<br />				// Now require the registerednav.php template<br />				$html = new html;<br />				list($tbopen,$tbclose) = $this -> table_wrapper();<br />				if (!$debug) {<br />					include("$thispath/templates/$tempstyle/ubbt_registerednav2.tmpl");<br />				}<br />				<br />				}<br /><br />else{<br />			// -------------------------------------------<br />				// Now require the registerednav.php template<br />				$html = new html;<br />				list($tbopen,$tbclose) = $this -> table_wrapper();<br />				if (!$debug) {<br />					include("$thispath/templates/$tempstyle/ubbt_registerednav.tmpl");<br />				}<br />				}<br />
Posted By: oceanwest Re: Alternate Nav Bar by Group... - 01/26/2005 8:30 PM
Changed it to this still no workie

Code
<br />				// -------------------------------------------<br />				// Now require the registerednav.php template<br />				$html = new html;<br />				list($tbopen,$tbclose) = $this -> table_wrapper();<br />				if (!$debug) {<br />				<br />				 if (($user['U_Groups'] == '-6-') ||  ($user['U_Groups'] == '-10-') || ($user['U_Groups'] == '-11-') || ($user['U_Groups'] == '-12-')) {<br />				<br />					include("$thispath/templates/$tempstyle/ubbt_registerednav2.tmpl");<br />					<br />				}<br />				else {<br />					include("$thispath/templates/$tempstyle/ubbt_registerednav.tmpl");<br />					<br />				}<br />					<br />					<br />				}
Posted By: Zackary Re: Alternate Nav Bar by Group... - 01/27/2005 12:25 AM
Try this, I do something similar to make sure certain group members have access to addon pages on my site:

Code
 if (preg_match("-6-", $user[U_Groups]) ) 


Should look through the U_Groups variable and match for 6.

For example with your code:

Code
 if ((preg_match("-6-", $user[U_Groups]))  ||  (preg_match("-10-", $user[U_Groups])) || (preg_match("-11-", $user[U_Groups])) || (preg_match("-12-", $user[U_Groups]))) { 


Hope that helps.
Posted By: oceanwest Re: Alternate Nav Bar by Group... - 01/29/2005 11:09 AM
it worked.
Posted By: Anno Re: Alternate Nav Bar by Group... - 01/29/2005 12:36 PM
You should better use
if (strchr($user['U_Groups'],"-6-"))

instead of
if (preg_match("-6-", $user['U_Groups']))
© UBB.Developers