The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Register link for guests, User CP link (or button) for members. Details »» | |||||||||||||||||||||||||||
Register link for guests, User CP link (or button) for members.
Developer Last Online: Nov 2023
Oh my Kura, you're releasing small, simple hacks every day now, huh? What's this one about?
Rest assured, after this one I don't have anything to release for a while (only stuff that has no purpose outside my own board). Well, this hack. What it does is 'merge' the Register and User CP buttons. If a viewer is a guest or just not logged in, the link will display a Register button (or text link, whatever you want). If the viewer IS logged in, and therefore a member, it will display the User CP button instead. Click here for an example (where `register` is will be `user cp` when you're logged in). I mean, why have a Register button for members available, and a User CP button available for guests? Exactly, that makes no sense, therefore, this hack. Instructions Step 1: Open your global.php and find this line: PHP Code:
Make sure to remove the space between {imagesfolder and }!! PHP Code:
$reg_ucp somewhere in your Header, where you want the UserCP / Register button to appear. Make sure to remove the 'hardcoded' buttons that are already in there, of course. Save, and you're done. Note that if you aren't using the default vB templates and graphics (which is 99% likely? ) you'll have to adjust the code above to suit your needs. If you don't use images, just remove the image part there and replace it with text links. Extra feature that you can use with this hack: add Guest-only banners or something alike. In other words, only guests will see the banner (which could say something like "Want to get rid of this annoying banner? Then sign up now!") and users who are logged in won't see anything. To do so, use something like this: PHP Code:
Enjoy! Show Your Support
|
Comments |
#22
|
||||
|
||||
Well I'm using an official, English version of vBulletin [2.2.5] - yesterday I couldn't find that code in my global.php, but today I could. LOL. And rather than hardcoding it I used the template version I mentioned above and created the two relevant templates, all running great now. Thanks for the help anyway.
|
#23
|
||||
|
||||
Hmmmm... But it doesn't work in my vBPortal on my test board.
|
#24
|
||||
|
||||
Anyone have any knowledge on how I could go about making this work in non-vb pages, such as my vBPortal P_themeheader template? Would I need to include anything in the external files that the portal wouldn't do as default? All input is appreciated.
|
#25
|
||||
|
||||
It'll work on any page where you include global.php
If you have non-vB pages, make sure to include global.php and it'll work. If you don't want to includ global.php, then there's no way for the page to know whether a user is a guest or a member. |
#26
|
||||
|
||||
I get this error when I try to include it...
Code:
Fatal error: Cannot redeclare stripslashesarray() in /web/gamerforums/board/global.php on line 14 |
#27
|
||||
|
||||
I think your version of PHP is just too old...
what version you running? |
#28
|
||||
|
||||
I'm running version 4.1.2 [February 27 2002], which is only outdated by one more release - so it isn't that.
|
#29
|
||||
|
||||
*Bump...*
|
#30
|
||||
|
||||
Err, see one of the sticky threads in the Full Releases forum. I believe one of 'm contains a small fix on that problem.
|
#31
|
||||
|
||||
I've had the replacement code variables fix installed for a long time.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|