MyBB Community Forums
PHP in Templates and Template Conditionals - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Plugins (https://community.mybb.com/forum-73.html)
+---- Forum: Plugin Support (https://community.mybb.com/forum-72.html)
+---- Thread: PHP in Templates and Template Conditionals (/thread-31860.html)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22


RE: PHP in Templates and Template Conditionals - Yumi - 2008-11-01

(2008-11-01, 01:22 AM)Hime Wrote: How to put specific chunk of code....say "Test:Test" using gid & conditionals!?

Can I actually use GID in templates?
Sorry, I really don't know what you're trying to say there... :/


RE: PHP in Templates and Template Conditionals - Hime - 2008-11-01

(2008-11-01, 04:24 AM)ZiNgA BuRgA Wrote:
(2008-11-01, 01:22 AM)Hime Wrote: How to put specific chunk of code....say "Test:Test" using gid & conditionals!?

Can I actually use GID in templates?
Sorry, I really don't know what you're trying to say there... :/

Is there any way to put Group Specific code in the postbit with conditionals?

I meant group id by "gid" in my previous post....but somehow vbulletin codes messes with my mybb experiences, so please take my apology for not being clear Smile


RE: PHP in Templates and Template Conditionals - Yumi - 2008-11-01

It depends on where you put it, but you could try something like this:
<if $GLOBALS['mybb']->user['usergroup'] == 4 then> stuff for usergroup 4</if>



RE: PHP in Templates and Template Conditionals - Hime - 2008-11-01

Quote:Is there any way to put Group Specific code in the postbit with conditionals?

I want to put it in postbit & the code didn't work when I tried Sad

Edit 1:Well it worked....I tried with additional usergroups earlier...Smile I will give more feedbacks soon Smile

Edit 2: naah, when I put the exact code from you, all usergroup got same thing! Sad


RE: PHP in Templates and Template Conditionals - Yumi - 2008-11-01

Can you give the HTML output of what is being generated?


RE: PHP in Templates and Template Conditionals - Lennart Sauter - 2008-11-01

Is this plugin compatible with 1.4?


RE: PHP in Templates and Template Conditionals - Yumi - 2008-11-01

Yes, it should be.


RE: PHP in Templates and Template Conditionals - Lennart Sauter - 2008-11-01

Okay, thank you!


RE: PHP in Templates and Template Conditionals - vat0r - 2009-02-10

Is there are way I could use this in showthread to say:

IF attachment type = X
do something
ELSE
normal attachment display

I would like to use different styling based on attachment type if possible.


RE: PHP in Templates and Template Conditionals - Yumi - 2009-02-10

Try something like this in postbit_attachments_attachment:
<if $ext == 'zip' then>
blah
<else>
bleh
</if>