The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
Just a quick question. I would like to have a few links in my nav, but I would like certain links to only be shown either to mods or admins. I would like the link to show based on there group. How would I do this.
Thanks in advance |
|
#2
|
||||
|
||||
|
Ok, I did a quick put together of code here and I havn't tested it so :S
First off goto your templates and goto the template named phpincludes at the very bottom put: Code:
//if admin
if ($bbuserinfo['userid'] == 6)
{
//show this button
$specialnav = '<a href="url"><img src="{imagesfolder}/adminimage.gif" alt="hover text" border="0"></a>';
}
//like above, the number is equal to the usergroup - this next one is if moderator
if ($bbuserinfo['userid'] == 7)
{
//then show this image
$specialnav = '<a href="url"><img src="{imagesfolder}/modimage.gif" alt="hover text" border="0"></a>';
}
you can also change the == to < or > if you want a certain range of users to have a certain image. good luck ^_^ |
|
#3
|
||||
|
||||
|
You can check which usergroupid's belong to which group in the Usergroup manager. Hover over the edit link and check your statusbar...
By default, vB2 creates: admins = usergroupid 6 moderators = usergroupid 7 supermods = usergroupid 5 members = usergroupdi 2 oh, and the template is phpinclude, no s
|
|
#4
|
|||
|
|||
|
Thanks for the quick replies. I guess I should have mentioned this part. I wanted to do it from a non-vb page. I wanted to do something like this:
<?php if ((isset($_SESSION['usergroupid'])) && ($_SESSION['usergroupid']==3)) { ?> Bascially if the usergroupid matches the users group the link would show. What would be the best way to go about this. Thanks again |
|
#5
|
||||
|
||||
|
Search for vbtemplates, it allows you to make vBulletin powered pages, and you can call variables with it.
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|