MyBB Community Forums

Full Version: Hide a link?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Okay, in the header, I had to make everything custom. Just so it suited my needs.

I input the register link, but I want it to be hidden for already registered users. Is there a way to do this? Thanks.

**Link to forum: http://x-ind.com/board
I guess its not possible?
If you put it in the header_welcomeblock_guest template it will only be shown to guests.
I have a custom header file though. :\ Meaning, everything is just in that file. Why? Because it makes things, except for this, easier.
You'll need a plugin.
Try it this way. Find in global.php
eval("\$header = \"".$templates->get("header")."\";");

over it insert:
if($mybb->user['uid'] == "0") {
$reg = "<li><a href=\"".$settings[bburl]."/member.php?action=register\"><img src=\"images/toplinks/register.png\" border=\"0\" alt=\"Register\" title=\"Register\" /> ".$lang->welcome_register."</a></li>";
} else {
$reg = "";
}

Use {$reg} in template header.

Best regards
NetHunter
(2010-01-17, 06:42 PM)Schmarvin Wrote: [ -> ]I input the register link, but I want it to be hidden for already registered users. Is there a way to do this? Thanks.

You can use this plugin:

http://community.mybboard.net/thread-31860.html
(2010-02-01, 07:10 PM)NetHunter Wrote: [ -> ]Try it this way. Find in global.php
eval("\$header = \"".$templates->get("header")."\";");

over it insert:
if($mybb->user['uid'] == "0") {
$reg = "<li><a href=\"".$settings[bburl]."/member.php?action=register\"><img src=\"images/toplinks/register.png\" border=\"0\" alt=\"Register\" title=\"Register\" /> ".$lang->welcome_register."</a></li>";
} else {
$reg = "";
}

Use {$reg} in template header.

Best regards
NetHunter

That worked! Thanks. Big Grin I may use this function for other needs/links.