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) |
RE: PHP in Templates and Template Conditionals - Leefish - 2012-10-08 It could be this :
It should be
You did not write the variable correctly. I think that is it. RE: PHP in Templates and Template Conditionals - ratosluaf - 2012-10-15 It's a problem with this, if i want to use it: And it's asd.php:
It adds smth like this: http://scr.hu/0et9/kcygj . there's a blank area like <br /> This code works brilliant: screen: http://scr.hu/0et9/ep9ex
RE: PHP in Templates and Template Conditionals - blogantinom - 2012-12-15 I'm trying to debug a if statement that doesn't shows a script (ads) only to 4 groups, to the other groups it should show normally. I'm using the following: Quote:<if !in_array($GLOBALS['mybb']->user['usergroup'], array(13,3,6,4)) then> I happens that an user i gave the additional group 4 to it is still showing the ads (it has the script). I would like then to show the $GLOBALS['mybb']->user['usergroup'] at the page to be able to debug and see what is going on that my plan doesn't work. How can I do that? And if someone would have some idea about what am I doing wrong that the script is showing for the group id 4 would be highly appreciated RE: PHP in Templates and Template Conditionals - crazy4cs - 2012-12-15 To include additional groups, try this:
Additional groups might need more work, but try if that works. RE: PHP in Templates and Template Conditionals - blogantinom - 2012-12-15 I found out now, I had to use the "additionalgroups" field of the user. But the code below won't work when the user has more than one field, anyone could help me with that? <if !in_array($GLOBALS['mybb']->user['usergroup'], array(13,3,6,4)) AND !in_array($GLOBALS['mybb']->user['additionalgroups'], array(13,3,6,4)) then> <script src="http://ads33751.hotwords.com.br/show.jsp?id=33751&cor=005F00"></script> </if> RE: PHP in Templates and Template Conditionals - Omar G. - 2012-12-15 Maybe this:
X, Y, Z are the groups which are not supposed to see the ads. RE: PHP in Templates and Template Conditionals - 0000 - 2013-05-24 Hi I can't speak English well, I have a question : can remove Private Messaging Completely in Configuration (For All user) But How To Remove Private Message Completely For one User-Group by use this method ? i want ,not show private message panel in user controlpanel. Thanks Sorry, my English is very poor RE: PHP in Templates and Template Conditionals - .m. - 2013-05-24 ^ use if condition in usercp_nav_messenger template (User Control Panel Templates) you can put starting of the if condition at the top of usercp_nav_messenger and end it at the bottom (x is usergroup number)
RE: PHP in Templates and Template Conditionals - 0000 - 2013-05-24 (2013-05-24, 04:06 AM).m. Wrote: ^ use if condition in usercp_nav_messenger template (User Control Panel Templates) please more help x=2 <if $mybb->usergroup['gid'] != 2 then> usercp_nav_messenger template code ? </if> RE: PHP in Templates and Template Conditionals - .m. - 2013-05-24 ^ add <if $mybb->usergroup['gid'] != 2 then> at the top of usercp_nav_messenger template and add </if> at the end of the template. |