vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   New is_super_admin Function (https://vborg.vbsupport.ru/showthread.php?t=64930)

Majik? 05-09-2004 10:00 PM

New is_super_admin Function
 
New is_super_admin Function
Version: 1.0
vB-version: 3.0.0
Developer: Majik?
Install difficulty: Easy
File edits: 2
Template edits: 0


Description of the Hack:
This hack creates a new function similar to is_member_of which can be used to check if a user's a Super Administrator.

Examples:
PHP Code:

if (is_super_admin($bbuserinfo['userid']))
{
// user is a super admin so do it
}
else
{
// user isn't a super admin
// so do something else or nothing at all


Code:

<if condition="is_super_admin($bbuserinfo['userid'])">
<!-- user's a super admin so do something -->
<else />
<!-- user's not a super admin so do something else -->
</if>

HACK INSTALLATION DETAILS:
Files modified for this Hack:
/includes/adminfunctions_template.php
/includes/functions.php


Thanks to Boofo for allowing me to use part of his code for this. ;)

???`S?LV?R???` 05-10-2004 01:50 AM

interesting

insanctus 05-10-2004 02:35 AM

Different, I do not see much use for it, unless you have alot of admins.

Majik? 05-10-2004 02:51 AM

Quote:

Originally Posted by insanctus
Different, I do not see much use for it, unless you have alot of admins.

I only have one admin other than myself at the moment, but the admin permissions don't always restrict everything I want. So, I use it for some of those as well as some other stuff I may want only myself or other SAdmins (if I add any) to see or access, but not other normal admins in templates (on the main site) or other parts of the site that aren't covered by the admin permissions.

If you can use, use it.. If not, don't. ;p Was mainly done for my own use/needs anyhow. ;)

Floris 05-10-2004 05:03 PM

Quote:

Originally Posted by Majik?
I only have one admin other than myself at the moment, but the admin permissions don't always restrict everything I want. So, I use it for some of those as well as some other stuff I may want only myself or other SAdmins (if I add any) to see or access, but not other normal admins in templates (on the main site) or other parts of the site that aren't covered by the admin permissions.

If you can use, use it.. If not, don't. ;p Was mainly done for my own use/needs anyhow. ;)

Isn't the variable $superadministrators set in the config.php file? And therefor usable in array in template conditionals already?

Zachery 05-10-2004 05:05 PM

Quote:

Originally Posted by floris
Isn't the variable $superadministrators set in the config.php file? And therefor usable in array in template conditionals already?

Yes..

Majik? 05-10-2004 05:26 PM

Quote:

Originally Posted by floris
Isn't the variable $superadministrators set in the config.php file? And therefor usable in array in template conditionals already?

I've gotten errors using arrays in the template conditionals. So, I use this and no problems.


All times are GMT. The time now is 09:57 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.01211 seconds
  • Memory Usage 1,731KB
  • 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)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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