The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Checking user group from a non vb page
I have the following code in my footer, which is included on every page:
PHP Code:
right now, it is showing the button regardless of log in status. what variable does vB use to store the user's usergroup? thanks, nick |
#2
|
|||
|
|||
Bump
|
#3
|
||||
|
||||
With conditionals I use:
Code:
<if condition="is_member_of($bbuserinfo, x)"> Your code here </if> |
#4
|
|||
|
|||
With:
PHP Code:
"Parse error: parse error, unexpected '<' in /home/.sites/22/site13/web/livexchange/footer.php on line 66" |
#5
|
|||
|
|||
bump
|
#6
|
||||
|
||||
You'll need to adjust the code to make it work. That was just an example conditional used in vB. I'm not sure exactly what the PHP protocol is but maybe:
Code:
if ($vbulletin->userinfo['usergroupid']=="6") { echo "Admin/Mod CP button goes here!"; } |
#7
|
|||
|
|||
Quote:
I think there needs to be some other code before it to tell the script that it is looking for a vB variable... |
#8
|
|||
|
|||
You need to include the config.php I'd say.
|
#9
|
|||
|
|||
No, Config.php just contains server-connect information.
You could do: PHP Code:
|
#10
|
|||
|
|||
Doesn't seem to be working. I tried the code you gave me, but it just causes the page to sit forever, then asks me if i want to run or download the PHP file.
The whole footer is as follows: HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <title>Xchange Footer</title> <style type="text/css"> <!-- .style10 {color: #FFFFFF; font-family: Copperplate;} --> </style> <script type="text/JavaScript"> <!-- function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } //--> </script> </head> <body onload="MM_preloadImages('forums/images/greenleaf/misc/contact_over.gif','http://www.rahlentertainment.com/livexchange/forums/images/greenleaf/misc/privacystatement_over.gif','forums/images/greenleaf/misc/top_over.gif','http://www.rahlentertainment.com/livexchange/forums/images/greenleaf/misc/contact_over.gif','http://www.rahlentertainment.com/livexchange/forums/images/greenleaf/misc/top_over.gif')"> <table width="850" border="0" cellspacing="0" align="center" cellpadding="0"> <tr height="25"> <td><img src="http://www.rahlentertainment.com/livexchange/forums/images/greenleaf/misc/mainbgbottom.jpg" width="850" height="25" /></td> </tr> <tr background="http://www.rahlentertainment.com/livexchange/forums/images/greenleaf/misc/navbg.gif"> <td><div align="center"> <table width="850" border="0" cellspacing="0" cellpadding="0"> <tr background="http://www.rahlentertainment.com/livexchange/forums/images/greenleaf/misc/navbg.gif"> <td width="258"><div align="left"><img src="http://www.rahlentertainment.com/livexchange/forums/images/greenleaf/misc/cp.gif" width="257" height="27" /></div></td> <td width="347" background="http://www.rahlentertainment.com/livexchange/forums/images/greenleaf/misc/navbg.gif"> <?PHP $forumpath = "http://www.rahlentertainment.com/livexchange/forums"; require_once($forumpath . '/global.php'); global $vbulletin; if ( is_member_of($vbulletin, 6) ) { echo "Admin CP and ModCP links go here"; } unset($vbulletin); ?> </td> <td width="245"><div align="right"><a href="http://www.rahlentertainment.com/livexchange/forums/sendmessage.php4" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('contactus','','http://www.rahlentertainment.com/livexchange/forums/images/greenleaf/misc/contact_over.gif',1)"><img src="http://www.rahlentertainment.com/livexchange/forums/images/greenleaf/misc/contact.gif" alt="Contact US" name="contactus" width="71" height="26" border="0" id="contactus" /></a><a href="http://www.rahlentertainment.com/livexchange/privacy.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Privacy','','http://www.rahlentertainment.com/livexchange/forums/images/greenleaf/misc/privacystatement_over.gif',1)"><img src="http://www.rahlentertainment.com/livexchange/forums/images/greenleaf/misc/privacystatement.gif" alt="Privacy Statement" name="Privacy" width="130" height="26" border="0" id="Privacy" /></a><a href="#top" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('top','','http://www.rahlentertainment.com/livexchange/forums/images/greenleaf/misc/top_over.gif',1)"><img src="http://www.rahlentertainment.com/livexchange/forums/images/greenleaf/misc/top.gif" alt="TOP" name="top" width="43" height="26" border="0" id="top" /></a></div></td> </tr> </table> </div></td> </tr> </table> </body> </html> |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|