vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Admin CP Button (https://vborg.vbsupport.ru/showthread.php?t=39991)

[D]Vincent 06-18-2002 02:14 AM

Admin CP Button
 
I have a question, I don't know PHP so I need to know how to make my Admin CP button invisible to members. Also I want to know how to make my music page on my website only to where Members can access it.

c-pr0mpt 06-18-2002 04:05 AM

For your admin button to be invisible do this:

Insert this into the php include area in your style.

Code:

//Admin Button only for Admin
if ($bbuserinfo['usergroupid'] == 6) {
        //i am admin
        $admin_only = "YOUR BUTTON AND LINK HERE";
} else {
        //they're not admin
        $admin_only = "";
}

Then in your page where you want the admin button put "$admin_only".

[D]Vincent 06-18-2002 10:32 PM

This appeared at the top on my forumhome page
Parse error: parse error in /usr/local/psa/home/vhosts/fflounge.com/httpdocs/board/global.php(302) : eval()'d code on line 10

scsa20 06-19-2002 02:31 AM

you probably did it like this (asuming your using a image):

PHP Code:

//Admin Button only for Admin
if ($bbuserinfo['usergroupid'] == 6) {
    
//i am admin
    
$admin_only "<a href="admin/index.php"><img src="{imagesforder}/admin.gif"></a>";
} else {
    
//they're not admin
    
$admin_only "";


if it looks like that, then your wrong, it should look like this:

PHP Code:

//Admin Button only for Admin
if ($bbuserinfo['usergroupid'] == 6) {
    
//i am admin
    
$admin_only "<a href=\"admin/index.php\"><img src=\"{imagesforder}/admin.gif\"></a>";
} else {
    
//they're not admin
    
$admin_only "";


that's the correct way of doing it (notices the \?? that's want it needs to know so that it knows that your doing something that's HTML related and not PHP related (I guess) with the end line). hopes this clears things up

c-pr0mpt 06-19-2002 11:54 AM

Exactly as scsa20 said, Vincent. For php every time there is a quotation in the code you need a \ before it.

Except the initial quotes surrounding your code of course.

[D]Vincent 06-20-2002 09:27 AM

Thanks, I'll try that in a minute, could I use that for like a non-vb page so that guests can't see that page O_o

scsa20 06-20-2002 08:42 PM

what you mean?? something like this??

c-pr0mpt 06-21-2002 04:08 AM

The above way does the exact same thing minus hacking your files. This one is done via templates.


All times are GMT. The time now is 07:28 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.01058 seconds
  • Memory Usage 1,730KB
  • 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
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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