Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Register link for guests, User CP link (or button) for members. Details »
Register link for guests, User CP link (or button) for members.
Mod Version: 1.00, by KuraFire (Member) KuraFire is offline
Developer Last Online: Jan 2007 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 2.2.x Rating: (1 vote - 5.00 average) Installs: 75
Released: 08 May 2002 Last Update: Never Downloads: 2
Not Supported  

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:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Add ABOVE that, the following code:
Make sure to remove the space between {imagesfolder and }!!


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Step 2: save your global.php and go to Edit your Header template (Styles > modify > fonts/colors > Header). Now, put

$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:



Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Now place $banner in your header or footer wherever you want, and only guests will see it.

Enjoy!

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Similar Mod
Mod Developer Type Replies Last Post
New Posting Features Add Pm Button, Find Post By User Button, And User To Contacts Button, To Postbit technom8t vBulletin 3.7 Template Modifications 9 21 Aug 2013 04:18
Show Thread Enhancements Register to reply button in postfoot for guests Jack12 vBulletin 4.x Template Modifications 58 25 Dec 2012 09:04

Comments
  #2  
Old 08 May 2002, 11:49
KuraFire's Avatar
KuraFire KuraFire is offline
 
Join Date: Nov 2001
Real name: Faruk
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. )
__________________
EverythingvB.com is closed; it will merge into the KuraFire Network, version 6. KF*N 6 will have information about XHTML, CSS, PHP and vBulletin, and especially all those combined.
Reply With Quote
  #3  
Old 08 May 2002, 12:03
Chen's Avatar
Chen Chen is offline
 
Join Date: Sep 2001
I edited your post to make it not scroll.
__________________
Chen Avinadav
Formerly vBulletin.org Owner and Founder

[email protected]
Reply With Quote
  #4  
Old 08 May 2002, 12:13
KuraFire's Avatar
KuraFire KuraFire is offline
 
Join Date: Nov 2001
Real name: Faruk
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! )
__________________
EverythingvB.com is closed; it will merge into the KuraFire Network, version 6. KF*N 6 will have information about XHTML, CSS, PHP and vBulletin, and especially all those combined.
Reply With Quote
  #5  
Old 08 May 2002, 13:10
NTLDR's Avatar
NTLDR NTLDR is offline
 
Join Date: Apr 2002
Real name: Lee Botley, BSc (Hons)
Nice hack KuraFire, shame I already added this to by board a few days ago

None the less good job.
__________________
Lee Botley, BSc (Hons) - vBulletin.org Moderator
http://www.thesistersthree.com/lee/sigs/signature.ts3
The Sisters Three Charmed Discussion Forums

WinterDir .:. vBindex v2.1 for vB2 .:. vBindex v3.0.0 RC5 for vB3
Reply With Quote
  #6  
Old 08 May 2002, 14:42
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Real name: Mike
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).
Reply With Quote
  #7  
Old 08 May 2002, 19:05
Takara's Avatar
Takara Takara is offline
 
Join Date: Apr 2002
Works nicely, thanks alot ^_^

*continues to add small subtle hacks to her board* :bunny:
Reply With Quote
  #8  
Old 08 May 2002, 19:09
Takara's Avatar
Takara Takara is offline
 
Join Date: Apr 2002
Uh oh. you should note that in the php code box it doesnt escape the " in "Registration is free\"
or
img src="http://www.vbulletin.org/forum/green/top_register.gif\" ".

Plus it doesnt start the "s back in the else after the ".


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Sorry for correting you! But I got lots of icky errors >.< (btw, I know that you typed it right. Its the [ php] 's fault that it edited the escapes out ^^)

Last edited by Takara; 08 May 2002 at 21:27.
Reply With Quote
  #9  
Old 08 May 2002, 19:51
Dark Odin Dark Odin is offline
 
Join Date: Jan 2002
For Template driven:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Just create the templates unregged and place your register button code or link, and put your user cp link code in regged template.

Not sure if this works, but it looks like it should.
Reply With Quote
  #10  
Old 08 May 2002, 22:43
KuraFire's Avatar
KuraFire KuraFire is offline
 
Join Date: Nov 2001
Real name: Faruk
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
__________________
EverythingvB.com is closed; it will merge into the KuraFire Network, version 6. KF*N 6 will have information about XHTML, CSS, PHP and vBulletin, and especially all those combined.
Reply With Quote
  #11  
Old 08 May 2002, 23:23
Dark Odin Dark Odin is offline
 
Join Date: Jan 2002
First attempt at posting anything.
Reply With Quote
  #12  
Old 08 May 2002, 23:43
scsa20's Avatar
scsa20 scsa20 is offline
 
Join Date: Mar 2002
I did mine an easyer way (find this out by looking around the template mod. forum ) and here's how I did mine (2 different ways)....for the buttons (I used this on 2 template sets), I just added the following to the "phpinclude" template:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

and then just replace <!-- toplinks --> down to <!-- /toplinks --> with:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

(make sure you remove the spaces between from {imagesfolder and })

or you can put this in the "phpinclude" template:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

then just add $adminlogin anywhere in the footer template..and remember, you can always play around with the code
__________________
Simonsoft Network

Times like this, I wished that I knew PHP
Reply With Quote
  #13  
Old 09 May 2002, 00:00
Takara's Avatar
Takara Takara is offline
 
Join Date: Apr 2002
Originally posted by KuraFire
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
Oooohhhhh, lol. I uploaded what mine looked like.

Anyway ^-^
Attached Images
File Type: jpg see.jpg (10.4 KB, 149 views)
Reply With Quote
  #14  
Old 09 May 2002, 00:03
KuraFire's Avatar
KuraFire KuraFire is offline
 
Join Date: Nov 2001
Real name: Faruk
scsa20: sure, that works too, but it's totally not necessary on my board (how the hell you found that "an easier way" is beyond me, though. ).
I have my Admin Panel on my Personal Bookmark Folder, so I just have to click on one link to get there, no matter _what_ site or page I'm browsing (so I can be on this forum and still jump there with 1 click). As for the Mod panel, they don't have anything to do there on my board except ban users, and that's something they don't often have to do at all, and usually I'm the one doing it anyhow.

But, thanks for the addition anyway, some other people might well appreciate it.
__________________
EverythingvB.com is closed; it will merge into the KuraFire Network, version 6. KF*N 6 will have information about XHTML, CSS, PHP and vBulletin, and especially all those combined.
Reply With Quote
  #15  
Old 09 May 2002, 00:06
KuraFire's Avatar
KuraFire KuraFire is offline
 
Join Date: Nov 2001
Real name: Faruk
Takara, as a suggestion: export images as .GIF if they don't use a lot of colors (ie. forum screenshots, for instance) - top quality and very small filesizes. Much better than these horrid, horrid .jpg's
__________________
EverythingvB.com is closed; it will merge into the KuraFire Network, version 6. KF*N 6 will have information about XHTML, CSS, PHP and vBulletin, and especially all those combined.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 23:26.

Layout Options | Width: Wide Color: