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 |
#2
|
||||
|
||||
No screenshots cos this is so simple your imagination should suffice.
Sorry about the side-scrolling btw, I always work with wrapping on :/ (oh and please note that "blablabla ...." should, of course, be replaced with what's in there, above. ) |
#3
|
||||
|
||||
I edited your post to make it not scroll.
|
#4
|
||||
|
||||
Thanks, but it still scrolled on reso 1152x864 (and below) so I edited it even more.
(you beat me to it, I was still working on adding the hack to the DB before editing it myself to make it thinner, bah! ) |
#5
|
||||
|
||||
Nice hack KuraFire, shame I already added this to by board a few days ago
None the less good job. |
#6
|
||||
|
||||
Good hack, but I have a suggestion.. Why not replace the "new thread" and "new reply" buttons with a button that says "register to post" or "register". Then make it link to a page where you can choose to register, or log in (since some people just forget to log in, and log in when creating a new thread).
|
#7
|
||||
|
||||
Works nicely, thanks alot ^_^
*continues to add small subtle hacks to her board* :bunny: |
#8
|
||||
|
||||
Uh oh. you should note that in the php code box it doesnt escape the " in "Registration is free\"
or img src="https://vborg.vbsupport.ru/green/top_register.gif\" ". Plus it doesnt start the "s back in the else after the ". PHP Code:
|
#9
|
|||
|
|||
For Template driven:
PHP Code:
Not sure if this works, but it looks like it should. |
#10
|
||||
|
||||
Dark Odin, your code is backwards. It currently gives unreg-templates for members, and regged-templates for guests.
Takara, actually, my hack said { imagesfolder } but if I type it without the spaces, it gets parsed... o_O But it all looks commented out fine on _my_ screen, nonetheless.... o.o |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|