vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   hidden link (https://vborg.vbsupport.ru/showthread.php?t=57649)

switch 10-06-2003 07:11 AM

hidden link
 
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

Rein Masamuri 10-06-2003 07:44 AM

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>';
}

Change the needed items to fit your need and put the $specialnav where you want the image
you can also change the == to < or > if you want a certain range of users to have a certain image.
good luck ^_^

KuraFire 10-06-2003 08:47 AM

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 :)

switch 10-06-2003 04:33 PM

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

Rein Masamuri 10-07-2003 07:11 AM

Search for vbtemplates, it allows you to make vBulletin powered pages, and you can call variables with it.


All times are GMT. The time now is 07:33 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00973 seconds
  • Memory Usage 1,715KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete