MyBB Community Forums

Full Version: How to add my code in templates? need some help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I am trying to add a message to my forum index for a certain membergroup.
It is my understanding that I can not add raw php. I searched and searched but I could not find the answer. I would be very grateful if someone would help me.

This is the code I use

<if ($mybb->user["usergroup"]== 1){ then>
My text here
<else />the default text of the template</if>

I have seen that there is a plug in that will allow you to use php in templates but I want to code my text without it. Thanks you
I don't think mybb allows conditional statements in the templates so you would need the php template plug in to allow php code.
http://community.mybboard.net/thread-31860.html

That should be what your looking for. Smile
Thanks you for your answers. Yes, I know about that plug in but I wanted to do it without it.
I have an ipb forum and there you can do it.
(2009-06-05, 06:12 PM)that_guy Wrote: [ -> ]Thanks you for your answers. Yes, I know about that plug in but I wanted to do it without it.
I have an ipb forum and there you can do it.

Oops, didn't see that in your post. I believe it's the only way for PHP to work in templates(don't quote me on it).

Well, IPB is a different software.
I thought that it could have done in mybb as well but I guess I was wrong.
(2009-06-05, 07:41 PM)that_guy Wrote: [ -> ]I thought that it could have done in mybb as well but I guess I was wrong.

Only with a plugin
IPB =/= MyBB. Never assume things are criss-crossed over different forum platforms; other than the ability to make a post.

Use Yumi's plugin and you can.
I will, thanks for the advice.
I installed that plug in but it does not work. Some help please.
That plug in works excellent. I have used it for some minor modification for a buddy of mine that runs mybb.

Try the following and let me know if it would help:

<if $GLOBALS['mybb']->user['usergroup'] == 1 then> 
//The code that you want to display to that usergroup here
<else>
//The default code here
</if>

As I said I have tried it and it works perfect. Hope it will help you.
Pages: 1 2