2016-09-30, 03:11 AM
Pages: 1 2
2016-09-30, 03:21 AM
There is generally only one way to implement conditions, other than making direct core code changes.
Install template conditionals plugin, then use something like
<if $GLOBALS['mybb']->user['usergroup'] >= 3 then>{$posticons}</if>
you will want to check the condition above, because banned group has the id=7 by default, but that gives you the idea.
Install template conditionals plugin, then use something like
<if $GLOBALS['mybb']->user['usergroup'] >= 3 then>{$posticons}</if>
you will want to check the condition above, because banned group has the id=7 by default, but that gives you the idea.
2016-09-30, 03:39 AM
Thanks...i didnt know about that option.
I installed that plugin, and edited the posticon template from
to this
in your example you show a {variable} , but can you leave out html td tags too wtihin the if condition?
So i tried
I installed that plugin, and edited the posticon template from
<tr>
<td class="trow1" style="vertical-align: top"><strong>{$lang->post_icon}</strong><span class="smalltext"><label class="posticons_label"><input type="radio" class="radio" name="icon" value="-1"{$no_icons_checked} />{$lang->no_post_icon}</label></span></td>
<td class="trow1" valign="top">{$iconlist}</td>
</tr>
to this
<tr>
<td class="trow1" style="vertical-align: top"><strong>{$lang->post_icon}</strong><span class="smalltext"><label class="posticons_label"><input type="radio" class="radio" name="icon" value="-1"{$no_icons_checked} />{$lang->no_post_icon}</label></span></td>
<td class="trow1" valign="top"><if $GLOBALS['mybb']->user['usergroup'] >= 3 then>{$iconlist}</if></td>
</tr>
but regular users can still see the post icon optionsin your example you show a {variable} , but can you leave out html td tags too wtihin the if condition?
So i tried
<if $GLOBALS['mybb']->user['usergroup'] >= 3 then>
<tr>
<td class="trow1" style="vertical-align: top"><strong>{$lang->post_icon}</strong><span class="smalltext"><label class="posticons_label"><input type="radio" class="radio" name="icon" value="-1"{$no_icons_checked} />{$lang->no_post_icon}</label></span></td>
<td class="trow1" valign="top">{$iconlist}</td>
</tr>
</if>
but that still shows up as well2016-09-30, 03:47 AM
It should work as i gave it. you just need to find {$posticons} in the relevant templates and replace it with what i gave.
newreply_thread, newthread templates etc.
newreply_thread, newthread templates etc.
2016-09-30, 03:59 AM
OK i replaced
{$posticons}
with
<if $GLOBALS['mybb']->user['usergroup'] >= 3 then>{$posticons}</if>
in both new threads and re reply templates.
But both admin and users can see post icons in when both reply and creating a new thread.
{$posticons}
with
<if $GLOBALS['mybb']->user['usergroup'] >= 3 then>{$posticons}</if>
in both new threads and re reply templates.
But both admin and users can see post icons in when both reply and creating a new thread.
2016-09-30, 04:08 AM
Erm...that's what you asked for ? Admin and mods to see only. Guests and regular users won't be able to see it.
2016-09-30, 04:09 AM
Quote:Erm...that's what you asked for ? Admin and mods to see only. Guests and regular users won't be able to see it.correct. I was jsut checking both accounts to see if either could not see if by any chance.
I am also not worried about core edits. I have already made a ton of them.
2016-09-30, 04:11 AM
(2016-09-30, 04:09 AM)metulburr Wrote: [ -> ]Quote:Erm...that's what you asked for ? Admin and mods to see only. Guests and regular users won't be able to see it.correct. I was jsut checking both accounts to see if either could not see if by any chance.
I am also not worried about core edits. I have already made a ton of them.
No need for core edits, I have just tested this on my test forum, and it works perfectly.
2016-09-30, 04:21 AM
hmm...
All i can think to do is to verify everything
here is my template conditional plugin activated. There is no settings available at all i see? No enable or disable options? All i see for this plugin is this. No other way to verify if it worked.
[attachment=37503]
ACP -> Templates and STyle -> Templates -> {theme} (mine is default) -> New Reply TEmplates -> newreply
http://codepad.org/6Yc52ATN
and
ACP -> Templates and STyle -> Templates -> {theme} (mine is default) -> New Thread Templates -> newthread
http://codepad.org/2M8MqKRi
and after that i still get post icons showing in reply and new thread editors.
EDIT:
I cant post the codepad here as i get blocked
All i can think to do is to verify everything
here is my template conditional plugin activated. There is no settings available at all i see? No enable or disable options? All i see for this plugin is this. No other way to verify if it worked.
[attachment=37503]
ACP -> Templates and STyle -> Templates -> {theme} (mine is default) -> New Reply TEmplates -> newreply
http://codepad.org/6Yc52ATN
and
ACP -> Templates and STyle -> Templates -> {theme} (mine is default) -> New Thread Templates -> newthread
http://codepad.org/2M8MqKRi
and after that i still get post icons showing in reply and new thread editors.
EDIT:
I cant post the codepad here as i get blocked
2016-09-30, 04:31 AM
This is what i have, logged in as a test user. Before the change
After the change.
After the change.
Pages: 1 2