2014-06-08, 09:24 AM
http://docs.mybb.com/Plugin_Methods.html is incomplete, so I couldn't find this.
I have a little group of moderators that are restricted to doing certain things. They can move posts, close threads and also "junk" them. For now though, I'm just adding buttons for ease of access for staff members.
At the moment I have this;
The Junk button works like a charm, however the Open/close one doesn't work properly. I think, possibly, the $thread isn't being used properly. It displays Open regardless, the button works but it just shows the <else>, also tried with just $thread['open']. What's the correct way to check this?
BTW, I'm using Template Conditionals.
I have a little group of moderators that are restricted to doing certain things. They can move posts, close threads and also "junk" them. For now though, I'm just adding buttons for ease of access for staff members.
At the moment I have this;
<div class="float_right" style="padding-bottom: 8px;">
{$selfclose}{$newreply}
</div>
<if $mybb->user['usergroup'] == 4 || $mybb->user['usergroup'] == 3 then>
<div class="float_right" style="padding-bottom; 8px;">
<form action="{$mybb->settings['bburl']}/moderation.php" method="post">
<input type="hidden" name="modtype" value="thread" />
<input type="hidden" name="tid" value="{$thread['tid']}" />
<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
<input type="hidden" name="action" value="1" />
<input type="submit" class="button" value="Junk" />
</form>
</div>
</if>
<if $mybb->user['usergroup'] == 4 || $mybb->user['usergroup'] == 3 then>
<if $thread['open'] == 1 then>
<div class="float_right" style="padding-bottom; 8px;">
<form action="{$mybb->settings['bburl']}/moderation.php" method="post">
<input type="hidden" name="modtype" value="thread" />
<input type="hidden" name="tid" value="{$thread['tid']}" />
<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
<input type="hidden" name="action" value="4" />
<input type="submit" class="button" value="Close" />
</form>
</div>
<else>
<div class="float_right" style="padding-bottom; 8px;">
<form action="{$mybb->settings['bburl']}/moderation.php" method="post">
<input type="hidden" name="modtype" value="thread" />
<input type="hidden" name="tid" value="{$thread['tid']}" />
<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
<input type="hidden" name="action" value="4" />
<input type="submit" class="button" value="Open" />
</form>
</div>
</if>
</if>
The Junk button works like a charm, however the Open/close one doesn't work properly. I think, possibly, the $thread isn't being used properly. It displays Open regardless, the button works but it just shows the <else>, also tried with just $thread['open']. What's the correct way to check this?
BTW, I'm using Template Conditionals.