MyBB Community Forums

Full Version: PHP in Templates and Template Conditionals
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
(2013-05-24, 07:41 AM).m. Wrote: [ -> ]^ add <if $mybb->usergroup['gid'] != 2 then> at the top of usercp_nav_messenger template and add </if> at the end of the template.

worked
Very Thanks

A few problems and questions

1-important(error)
when i use code
in member cp show this error on the top
Parse error: syntax error, unexpected ')' in /home/........./public_html/Forum/inc/functions_user.php(458) : eval()'d code on line 20


2-How use this code for Multiple groups
(group1 & gorup4 & gorup3 ==access)
and (group2 == Inaccessible)

3-can use code this form
<if $mybb->usergroup['gid'] !== 2 then>

$mybb->settings['enablepms'] == 0)
{
error($lang->pms_disabled);
}
</if>

Sorry, my English is very poor
thanks
1. - probably caused by 3. You have a redundant ) somewhere.

2. and 3.
<if in_array($mybb->user['usergroup'], array(1,2,3)) then>
<if $mybb->settings['enablepms'] == 0 then>
{$lang->pms_disabled}
</if>
</if> 
1,2,3 - comma separated group ids which aren't allowed to view PMs.
Not sure why you want to use $mybb->settings['enablepms'] for that, so the result of the code I posted may be unexpected for you.
(2013-05-24, 06:42 PM)Destroy666 Wrote: [ -> ]1. - probably caused by 3. You have a redundant ) somewhere.

2. and 3.
<if in_array($mybb->user['usergroup'], array(1,2,3)) then>
<if $mybb->settings['enablepms'] == 0 then>
{$lang->pms_disabled}
</if>
</if> 
1,2,3 - comma separated group ids which aren't allowed to view PMs.
Not sure why you want to use $mybb->settings['enablepms'] for that, so the result of the code I posted may be unexpected for you.

thanks
worked without error
But messenger disable for all group
Sad

I use this form

<if in_array($mybb->user['usergroup'], array(2,1,5,13)) then>
<if $mybb->settings['enablepms'] == 0 then>
{$lang->pms_disabled}

PM links code

</if>
</if> 
Well, sorry, but I'm not entirely sure what you want to achieve. To block groups let's say 2 and 34 from viewing the nav PM links use this in usercp_nav_messenger:
<tr>
<if !in_array($mybb->user['usergroup'], array(2,34)) then>
(... replace this with rest of code which had been before except trs and tbody, so tds etc...)
<else>
<td class="trow1 smalltext">
{$lang->pms_disabled}
</td>
</if>
</tr>
</tbody>

Still don't know why you want to use $mybb->settings['enablepms'] so I removed it because it made no sense for me there.
(2013-05-25, 01:08 AM)Destroy666 Wrote: [ -> ]Well, sorry, but I'm not entirely sure what you want to achieve. To block groups let's say 2 and 34 from viewing the nav PM links use this in usercp_nav_messenger:
<tr>
<if !in_array($mybb->user['usergroup'], array(2,34)) then>
(... replace this with rest of code which had been before except trs and tbody, so tds etc...)
<else>
<td class="trow1 smalltext">
{$lang->pms_disabled}
</td>
</if>
</tr>
</tbody>
Still don't know why you want to use $mybb->settings['enablepms'] so I removed it because it made no sense for me there.


Thanks Dear DESTROY666
& thanks .m.
excellent Smile
Does anybody have a mirror because mybbhacks is down please.
@Yumi, what happened to http://mybbhacks.zingaburga.com
Hey guys, If anybody could please supply a mirror, I will kill for this awesome plugin!
^ kill whom ? anyway, check your PM
Would I be able to call in forum info into another template using this? For instance, if I want to call a board's last post somewhere into the footer or header, would I use something like "{$lastpost['fid2']}" to call in that specific board's last post info there?
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22