vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How to check priveleges (https://vborg.vbsupport.ru/showthread.php?t=47449)

ChrisLohman 01-06-2003 07:26 PM

How to check priveleges
 
In my showthread template I want to show the "New Thread" and "Post Reply" buttons to the Administrators group and one custom "Authors" group.

Can anyone help write the if statement that will check to see if they have "Admin" or "Author" privs and if so, show the button?

FYI: My php abilities are null. I know enough html to be dangerous with the templates and that's about all.

Any assistance would be appreciated.

N9ne 01-06-2003 07:58 PM

if ($bbuserinfo[usergroupid]==6 OR $bbuserinfo[usergroupid]==9) {

That's about as far as I can go being 100% correct (i think lol!), replace the 9 with your author group's usergroup id. I'm not too sure about vB's terminoligy and the reply button and new thread button variables, so I can't help much there sorry.

ChrisLohman 01-06-2003 11:49 PM

Great, thank you very much!

ChrisLohman 01-07-2003 03:01 PM

Well, I've hit the wall with this miniscule php matter. If anyone could provide some help with writing this I'd appreciate it.

I need to do the equivelant of this in the forumdisplay template:

if ($bbuserinfo[usergroupid]==6) {

$newthreadlink

}

I don't seem to be formatting it correctly as that doesn't work. I also tried the same in the forumdisplay_newthreadlink, to no avail.

I tried wrapping it in <? tags, I tried modifying the forumdisplay_newthreadlink, I know it's something increadibly basic that I just don't know. I have an ASP/IIS background and am just now (past 3 days) getting into PHP. In ASP I would write

<%

If usergroupid = 6 then
Response.Write "button stuff here"
end if

%>

I obviously don't understand how php and/or vB interpret code in the template.

So, while I'm trying to "rtfm" and learn a little about php sytanx and any caveats related to vB templates; if anyone could help me write that out it would certainly be helpful.

Thanks


All times are GMT. The time now is 04:22 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.01045 seconds
  • Memory Usage 1,708KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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