Post by Admin on Sept 12, 2021 15:47:03 GMT
Testing to see if it works
Added using the following code in the Home layout template after $[news]
<!-- Custom Create Thread Button -->
{if $[current_user.is_member]}
<div style="margin: 20px 10%;">
<div id="create_thread_button" style="background-color: #f5f5f5;padding: 10px; border: 1px solid #000000; text-align: center;" ><h3>Click to Create New Thread</h3></div>
<div id="create_thread_boards" style="display: none;background-color: #f5f5f5; padding: 10px; border: solid #000000; border-width: 0px 1px 1px 1px;">
<div style="font-weight: bold;margin: 5px; padding: 5px;">
Click the board you wish to post a thread in
</div>
{foreach $[category]}
<div style="background-color: #105469; border: 1px solid #000000; margin: 5px; padding: 5px; pointer: hand; font-weight: bold; color: #FFFFFF;">
$[category.name]
</div>
{foreach $[category.board]}
<div class="create_thread_board_link" data-boardid="$[category.board.id]" style="border: 1px solid #000000; margin: 5px 5px 5px 20px; padding: 5px;background-color: #FFFFFF;">
$[category.board.name]
</div>
{if $[category.board.sub_board]}
{foreach $[category.board.sub_board]}
<div class="create_thread_board_link" data-boardid="$[category.board.sub_board.id]" style="border: 1px solid #000000; margin: 5px 5px 5px 35px; padding: 5px; background-color: #FFFFFF;">
$[category.board.sub_board.name]
</div>
{/foreach}
{/if}
{/foreach}
{/foreach}
</div>
</div>
<style>
#create_thread_button:hover, .create_thread_board_link:hover {
background-color: #f8e7b4!important; cursor: pointer;
}
</style>
<script>
$(document).ready(function(){
$("#create_thread_button").click(function(){
$("#create_thread_boards").toggle();
});
});
$(document).ready(function(){
$(".create_thread_board_link").click(function(){
location="/thread/new/"+this.dataset.boardid;
});
});
</script>
<!-- Custom Create Thread Button // end -->
{/if}