MyBB Community Forums

Full Version: Show-Hide buttons in postbit.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Go to: ACP > Templates & Style > Themes > global.css

Add CSS code:
.buttons {
	display: none;
	margin-top: 10px;
}

Go to: ACP > Templates & Style > Templates > Post Bit Templates > postbit_classic

Find:
<div class="postbit_buttons author_buttons float_left">
	{$post['button_email']}{$post['button_pm']}{$post['button_www']}{$post['button_find']}{$post['button_rep']}
</div>

Change to:
<button onclick="FunctionButtons_{$post['pid']}()">Options</button>
<div class="buttons" id="buttons_{$post['pid']}">
<div class="postbit_buttons author_buttons float_left">
{$post['button_email']}{$post['button_pm']}{$post['button_www']}{$post['button_find']}{$post['button_rep']}		
</div>		
</div>

At the end, add code:
<script type="text/javascript">
function FunctionButtons_{$post['pid']}() {
	var x = document.getElementById("buttons_{$post['pid']}");
	if (x.style.display === "none") {
		x.style.display = "block";
  } else {
    x.style.display = "none";
  }
}
</script>

I only edited the buttons on the left side, or you can add all the variables on the left / right side.

Demo:


Sorry to edit the topic 9 times. I had a formatting problem.