MyBB Community Forums

Full Version: PHP in forum description
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I'm wondering if this is possible. I have installed the "PHP and Template Conditionals" plugin for my theme, but it doesn't obviously affect forum description.

Is there any other plugin I can use?
(2019-06-01, 11:44 AM)ShadowOne Wrote: [ -> ]I'm wondering if this is possible. I have installed the "PHP and Template Conditionals" plugin for my theme, but it doesn't obviously affect forum description.

Is there any other plugin I can use?

There's no need for a plugin. 

If you want to do something similar to what I have done on my website as shown in the screenshot, just follow the tabs.

[Image: 5ba2d1057e6b81e27735be0cc9b429cd.png]

To add a new document, which essentially creates a new page for your website... Do this.

[Image: e42b534acd5baacb029daf0700ffcf05.png]

Then... obtain the URL of that document and link that into your main forum page for all to click on.
can you tell us why you want to use php for the forum descriptions ..
(2019-06-01, 12:34 PM)Serpius Wrote: [ -> ]
(2019-06-01, 11:44 AM)ShadowOne Wrote: [ -> ]I'm wondering if this is possible. I have installed the "PHP and Template Conditionals" plugin for my theme, but it doesn't obviously affect forum description.

Is there any other plugin I can use?

There's no need for a plugin. 

If you want to do something similar to what I have done on my website as shown in the screenshot, just follow the tabs.

-snip-

Then... obtain the URL of that document and link that into your main forum page for all to click on.

That's not what I need, sorry

(2019-06-01, 01:03 PM).m. Wrote: [ -> ]can you tell us why you want to use php for the forum descriptions ..

My need is placing some links inside description that have to be viewable (or not viewable) depending on user group. They have to be specifically inside description due to how I'm building my site.
(2019-06-01, 03:53 PM)ShadowOne Wrote: [ -> ]
(2019-06-01, 12:34 PM)Serpius Wrote: [ -> ]
(2019-06-01, 11:44 AM)ShadowOne Wrote: [ -> ]I'm wondering if this is possible. I have installed the "PHP and Template Conditionals" plugin for my theme, but it doesn't obviously affect forum description.

Is there any other plugin I can use?

There's no need for a plugin. 

If you want to do something similar to what I have done on my website as shown in the screenshot, just follow the tabs.

-snip-

Then... obtain the URL of that document and link that into your main forum page for all to click on.

That's not what I need, sorry

(2019-06-01, 01:03 PM).m. Wrote: [ -> ]can you tell us why you want to use php for the forum descriptions ..

My need is placing some links inside description that have to be viewable (or not viewable) depending on user group. They have to be specifically inside description due to how I'm building my site.

You need a template conditional to do that.

See this thread here
https://community.mybb.com/thread-48224-...49330.html

<if $GLOBALS['mybb']->user['usergroup'] == 4 then>
stuff to show
</if>
(2019-06-01, 03:57 PM)Michael2014 Wrote: [ -> ]You need a template conditional to do that.

See this thread here
https://community.mybb.com/thread-48224-...49330.html

<if $GLOBALS['mybb']->user['usergroup'] == 4 then>
stuff to show
</if>

That's fine, but the point is having that conditional executed inside forum description
(2019-06-01, 04:00 PM)ShadowOne Wrote: [ -> ]
(2019-06-01, 03:57 PM)Michael2014 Wrote: [ -> ]You need a template conditional to do that.

See this thread here
https://community.mybb.com/thread-48224-...49330.html

<if $GLOBALS['mybb']->user['usergroup'] == 4 then>
stuff to show
</if>

That's fine, but the point is having that conditional executed inside forum description

Use the same conditional, because any user group that is not designated to view will be excluded.
(2019-06-01, 04:04 PM)Michael2014 Wrote: [ -> ]
(2019-06-01, 04:00 PM)ShadowOne Wrote: [ -> ]
(2019-06-01, 03:57 PM)Michael2014 Wrote: [ -> ]You need a template conditional to do that.

See this thread here
https://community.mybb.com/thread-48224-...49330.html

<if $GLOBALS['mybb']->user['usergroup'] == 4 then>
stuff to show
</if>

That's fine, but the point is having that conditional executed inside forum description

Use the same conditional, because any user group that is not designated to view will be excluded.

If you try adding that code inside a description you will see that it is displayed fully, including the "ifs". That's the problem.
(2019-06-01, 04:07 PM)ShadowOne Wrote: [ -> ]
(2019-06-01, 04:04 PM)Michael2014 Wrote: [ -> ]
(2019-06-01, 04:00 PM)ShadowOne Wrote: [ -> ]
(2019-06-01, 03:57 PM)Michael2014 Wrote: [ -> ]You need a template conditional to do that.

See this thread here
https://community.mybb.com/thread-48224-...49330.html

<if $GLOBALS['mybb']->user['usergroup'] == 4 then>
stuff to show
</if>

That's fine, but the point is having that conditional executed inside forum description

Use the same conditional, because any user group that is not designated to view will be excluded.

If you try adding that code inside a description you will see that it is displayed fully, including the "ifs". That's the problem.

He is using template conditionals plugin so that should not be an issue
^ template conditionals or php in templates execute in templates.
does NOT work in forum description field. a different method is needed for it.
Pages: 1 2