MyBB Community Forums

Full Version: ModCPLink
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
In my header template, I call:
$modcplink
But I'm wondering if I can stop the link from displaying for admins...because my welcome block is running out of space.
Edit the header_welcomeblock_admin template and remove the link to the ModCP.
Already tried, but that variable is not there.
I think the links show up because admin is higher level than smod, so...still can't figure out how to remove it.
You won't be able to do it through templates without the template conditionals plugin - you'll need to modify core MyBB files. This means that everytime you need to upgrade MyBB, you might need to make these changes - in which case, write them down in a plain text file!

In global.php, around line 315, you'll find this:

	if($mybb->usergroup['canmodcp'] == 1)
	{
		eval("\$modcplink = \"".$templates->get("header_welcomeblock_member_moderator")."\";");
	}

Change the top line to:

	if($mybb->usergroup['canmodcp'] == 1 && !$mybb->usergroup['cancp'])

Basically this will that users who can access the modCP, but can't access the adminCP, can see this link.
Just what I needed, that's perfect, thanks. Wink
Btw, what is this "template conditionals" plugin...I'm currently making some custom pages and that would save me a lot of work if I could execute regular PHP code in the templates.
Template Conditionals Plugin will make your templates (php templates) more elastic means you can edit templates more easily Smile
(2009-04-15, 02:27 PM)ghazal Wrote: [ -> ]Template Conditionals Plugin will make your templates (php templates) more elastic means you can edit templates more easily Smile

In future remember to read the post with utter concentration Toungue

I think he knows what it does he just wants it

http://community.mybboard.net/thread-31860.html

Good luck with using them.
(2009-04-15, 02:54 PM)Hapatio Wrote: [ -> ]In future remember to read the post with utter concentration Toungue

I think he knows what it does he just wants it

http://community.mybboard.net/thread-31860.html

Good luck with using them.

I knows very well , But look at this post


(2009-04-15, 12:45 PM)Ricardo-san Wrote: [ -> ]Btw, what is this "template conditionals" plugin...

He asks What Is Template Conditionals Mean ? If he wants its procedure I will refer this file to him on that very instance Undecided
Dont take it to seriously Toungue

Quote:making some custom pages and that would save me a lot of work if I could execute regular PHP code in the templates.

I think he realised what it was the name is a giveaway, continue your great support Ghazal!
Thankyou , hapatio, and yes their is no serious matter, I am not anger atall Smile