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.
![]() 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? ![]() 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 |
#32
|
||||
|
||||
![]()
Then I have no idea. Is it a vBPortal page you're trying to include this on, or a non-vb page of your own?
And in which directory is it? Different from where your vB itself is? |
#33
|
||||
|
||||
![]()
It's the vBPortal pages, and it's in the web root, my forums are in root/forums.
|
#34
|
||||
|
||||
![]()
Then it might be a problem with vBPortal, or you haven't properly hardcoded the real path to your admin/functions.php ?
|
#35
|
||||
|
||||
![]()
I didn't realise I was supposed to hard code that path, any idea where I do it?
|
#36
|
||||
|
||||
![]()
I believe you only have to do it in global.php
however, note that I am totally not sure whether this will have any effect on your vBPortal. With my old site, however, I had to hardcode the real path in global.php (at least) to make it all work a directory lower than my forums... |
#37
|
||||
|
||||
![]()
I tried that and it didn't work. Thanks for trying anyway mate, it's appreciated.
![]() |
#38
|
||||
|
||||
![]()
sorry it didn't work, and no prob
![]() |
#39
|
||||
|
||||
![]()
I have a scrolling ticker box that I would like the guests to see but not the regular users. It is javascript. How could I call that with the banner option you have here? It uses a piece of code in the index.php and a .jar file that it calls.
Quote:
|
#40
|
||||
|
||||
![]()
why the HELL did you quote my post there?!
That was totally not necessary and annoying :/ As to your question, uhm, just put the javascript in place where it now has the Banner stuff? |
#41
|
||||
|
||||
![]()
Why don't you chill out a little bit. That whole quote was by accident. And I didn't quite understand the blahblah stuff you had in the code and I wasn't sure what was supposed to go there, so I thought I'd better quote it. Relax.
![]() Quote:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|