PDA

View Full Version : Button Hack


SiXXGuNNZ
31 Dec 2002, 04:23
Based on:

[vB v2.2.5] Register link for guests, User CP link (or button) for members.

http://www.vbulletin.org/forum/showthread.php?s=&threadid=38416


By:

KuraFire


Additional Code Written By:

TECK


What it does:

For logged in users this will show the user cp, member, search & logout buttons
for logged out users this will remove the member, search & log out button and in place of user cp it will show a register button.
For Super Mods this will show a mod cp button.
for admins this will show a admin cp button(admin cp and mod cp buttons not included).


Edits:

forum/global.php & Templates --> header


Additional info to install this with vBHome(lite) v3.8


---------------------
That all! Enjoy :)
---------------------

Lanigironu
31 Dec 2002, 05:12
So what happens if a mod or admin wants to access his user panel?

SiXXGuNNZ
31 Dec 2002, 05:39
hmmm, I think I get what you are asking.

log out users: no user cp, registration instead, no log out, admin cp or mod cp button

logged in regular members: no registration, mod cp or admin cp buttons. user cp is where the registration button was and the log out button appears.

mods: same as registered users but they get the mod cp button.

admins: same as registered users but they get the admin cp button.

Attached Example.

snyx
31 Dec 2002, 07:03
handy..

Lanigironu
31 Dec 2002, 07:33
Ok, that makes sense. Good hack, but I don't need it.

Herman
31 Dec 2002, 17:10
U don't need to edit php files for this, I'll explain.

Just go into php Parced code in the style page.

//Register/usercp
if ($bbuserinfo[usergroupid]==1) { //guests
$regcp = "<a href=\"register.php\"><img src="images/top_register.gif"></a>";
} else { //Everyone else
$regcp = "<a href=\"usercp.php\"><img src="images/top_profile.gif"></a>";
}
//End Register/usercp

//Mod and Admin cp login
if ($bbuserinfo[usergroupid]==6) { //admins
$modadminlogin = "<a href=\"admin/index.php\">adminCP</a>&nbsp";
} elseif (($bbuserinfo[usergroupid]==5) or ($bbuserinfo[usergroupid]==7)) { //Mods
$modadminlogin = "<a href=\"mod/index.php\">modCP</a>&nbsp";
} else { //Everybody
$modadminlogin = "";
}
//End Mod and Admin cp login

Add that code to your php parced code, and then go to your forumhome and add $modadminlogin and $regcp wherever you want the buttons to appear, for $modadmin login I suggest in the foooter because that way it doesn't make where you look look weird also, if you edit the code in any way make sure to put a \ before every " when you start putting html, that switches the code from PHP to HTML.:)

SiXXGuNNZ
09 Mar 2003, 04:58
Originally posted by Herman
U don't need to edit php files for this, I'll explain.

Just go into php Parced code in the style page.

//Register/usercp
if ($bbuserinfo[usergroupid]==1) { //guests
$regcp = "<a href=\"register.php\"><img src="images/top_register.gif"></a>";
} else { //Everyone else
$regcp = "<a href=\"usercp.php\"><img src="images/top_profile.gif"></a>";
}
//End Register/usercp

//Mod and Admin cp login
if ($bbuserinfo[usergroupid]==6) { //admins
$modadminlogin = "<a href=\"admin/index.php\">adminCP</a>&nbsp";
} elseif (($bbuserinfo[usergroupid]==5) or ($bbuserinfo[usergroupid]==7)) { //Mods
$modadminlogin = "<a href=\"mod/index.php\">modCP</a>&nbsp";
} else { //Everybody
$modadminlogin = "";
}
//End Mod and Admin cp login

Add that code to your php parced code, and then go to your forumhome and add $modadminlogin and $regcp wherever you want the buttons to appear, for $modadmin login I suggest in the foooter because that way it doesn't make where you look look weird also, if you edit the code in any way make sure to put a \ before every " when you start putting html, that switches the code from PHP to HTML.:)

but you do have to edit each themes php Parced code ;)

I myself like to do things one time and call it good :)

jwoodall.2
05 Aug 2003, 03:04
I got this, I think.. cept I don't know where to put the

Templates --> home_header Add:
-------------------------------------------------------------------------------------
Put $reg_upc where you want the user cp/register buttons to swap out
Put $memberhead where you want your member button to appear
Put $searchhead where you want your search button to appear
Put $logout where you want your log out button to appear
Put $admincp where you want the admin cp button to appear
Put $modcp where you want the mod cp button to appear

jwoodall.2
05 Aug 2003, 03:08
Hrm.. it appears I already had a pretty major hack on mine (a friend set it up originally).