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 |
#72
|
||||
|
||||
You're doing it all wrong:
"<a href=\"register.php?s=$session[sessionhash]&action=signup\">". "<a onmouseover=\"changeImages('image2', 'image2a')\" onmouseout=\"changeImages('image2', 'image2b')\" ". "img name=\"image2\" ". That's not valid HTML _whatsoever_ Make it: "<a href=\"register.php?s=$session[sessionhash]&action=signup\">". "<img onmouseover=\"changeImages('image2', 'image2a')\" onmouseout=\"changeImages('image2', 'image2b')\" ". " name=\"image2\" ". |
#73
|
|||
|
|||
thanks that worked...
|
#74
|
|||
|
|||
kurafire, k i thought it works, but i notice a strange behaviour problem... when i refresh the page it loads all my nav buttons up except for the usercp/registration one... it leaves an X there instead... the only way it shows up is if i hover my mouse over it... any ideas? but its rare that it loads up completely... any ideas?
|
#75
|
|||
|
|||
anyone? the rollover button or image will bot load up unless the user hovers his mouse over it, any ideas how to fix this? please this is really annoying me... arghhh... it works but only if i put the mouse pointer over where the x is... help me plz... here's what i have...
PHP Code:
|
#76
|
||||
|
||||
*sighs*
212rikanmofo, please learn the basics of HTML before you go hack up your site, next time you have a problem. <img> tags need an src= attribute. You didn't put one in... |
#77
|
|||
|
|||
And, for <img> tag's to be XHTML1.0 complient, they also need an alt="" and a trailing slash.
Ex: <img src="URL" height="" width="" alt="" /> |
#78
|
||||
|
||||
I get...
Parse error: parse error, unexpected T_VARIABLE in /home/vbhost/public_html/forum/global.php on line 345 Fatal error: Call to undefined function: getpermissions() in /home/vbhost/public_html/forum/index.php on line 10 |
#79
|
|||
|
|||
Quote:
so i do this? PHP Code:
|
#80
|
|||
|
|||
Quote:
|
#81
|
||||
|
||||
//########################## button change in nav #######################
if($bbuserinfo['userid'] != 0) { $regcp = "<a href=\"register.php?s=$session[sessionhash]&action=signup\">Register</a>"; } else { $regcp = "<a href=\"usercp.php?s=$session[sessionhash]\">Control Panel</a>"; } if ($bbuserinfo['usergroupid']==6) { $vadminbutton = "<a href=\"/admin/index.php?s=$session[sessionhash]\" target=\"_blank\">Admin Panel</a>"; } if ($bbuserinfo['usergroupid']==5) { $vmodbutton = "<a href=\"/mod/index.php?s=$session[sessionhash]\" target=\"_blank\">Mod Panel</a>"; } if ($bbuserinfo['usergroupid']==7) { $vmodbutton = "<a href=\"/mod/index.php?s=$session[sessionhash]\" target=\"_blank\">Mod Panel</a>"; } and it kicks back.... Parse error: parse error, unexpected T_VARIABLE in /home/sports/public_html/global.php on line 292 Fatal error: Call to undefined function: getpermissions() in /home/sports/public_html/index.php on line 14 |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|