View Full Version : Admin CP Button
[D]Vincent
06-18-2002, 02:14 AM
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.
//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):
//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:
//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 (https://vborg.vbsupport.ru/showthread.php?s=&threadid=38416)??
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.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.